Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2020-04-23 Add TIME UNIT of "H" to option of "HR" in unit_conversion.R to avoid warning messages that "H" is inappropriate. #230

Closed
TomTensfeldt opened this issue Apr 23, 2020 · 2 comments

Comments

@TomTensfeldt
Copy link
Collaborator

Currently, if mct$ACTTIMEU or mct$NOMTIMEU point to a variable that is in "H" rather than "HR" units, a warning message is displayed that the units are invalid:

2: In unit_conversion(data = data_data, map = map_data, result = computation_df, ... :
'PKATPDU' and/or 'TIMEOUTPUTUNIT' value provided via 'map' is not valid for unit conversion

This is because in unit_conversion.R, there's no provision for the "H" in the units, val, and class vectors. Adding "H" would resolve this
Change

  units    <- c("HR", "MIN", "KG", "GM", "DPM", "ngeq",  "DG", "CG", "MG", "UG", "MCG", "NG",  "PG",  "FG", "KL", "L", "DL", "CL", "ML", "UL", "NL",  "PL",  "FL",        "")
  val      <- c(  60,     1,  1e3,    1,     1,      1,  1e-1, 1e-2, 1e-3, 1e-6,  1e-6, 1e-9, 1e-12, 1e-15,  1e3,   1, 1e-1, 1e-2, 1e-3, 1e-6, 1e-9, 1e-12, 1e-15,        NA)
  class    <- c( "T",   "T",  "M",  "M",   "M",    "M",   "M",  "M",  "M",  "M",   "M",  "M",   "M",   "M",  "V", "V",  "V",  "V",  "V",  "V",  "V",   "V",   "V", "MISSING")

to

  units    <- c("H", "HR", "MIN", "KG", "GM", "DPM", "ngeq",  "DG", "CG", "MG", "UG", "MCG", "NG",  "PG",  "FG", "KL", "L", "DL", "CL", "ML", "UL", "NL",  "PL",  "FL",        "")
  val      <- c(  60, 60,     1,  1e3,    1,     1,      1,  1e-1, 1e-2, 1e-3, 1e-6,  1e-6, 1e-9, 1e-12, 1e-15,  1e3,   1, 1e-1, 1e-2, 1e-3, 1e-6, 1e-9, 1e-12, 1e-15,        NA)
  class    <- c( "T", "T",   "T",  "M",  "M",   "M",    "M",   "M",  "M",  "M",  "M",   "M",  "M",   "M",   "M",  "V", "V",  "V",  "V",  "V",  "V",  "V",   "V",   "V", "MISSING")
@jhhughes256
Copy link
Collaborator

The computation engine appears to successfully handle "H" as a unit with commit 8e304f8 for various testcases, but without the change suggested above. @TomTensfeldt Was there a side effect of this issue that we can look for to validate that this issue is closed?

@jhhughes256
Copy link
Collaborator

This issue no appears to no longer occur with the latest commit cca452d based on unit_conversion output for tc120 & tc144. Output for tc144 shown below where parameters are shown to be scaled from H to HR via a scaling factor of 1.

## unit_conversion : Unit Class 1 (Time) time_col:  DOF1 DOF2 TENDINF1 TENDINF2 TMAX TMAX1 TMAX2 TMIN TMIN1 TMIN2 TLAST TLAST1 TLAST2 KELTMLO KELTMHI THALF LASTTIME LASTTIME1 LASTTIME2 MRTLAST MRTLAST1 MRTLAST2 MRTIVIFO1 MRTIVIFO2 MRTIVIFP1 MRTIVIFP2 TAU1 TAU2 TOLD1 TOLD2  parameters are scaled from  H  to  HR  via scaling factor:  1
## Warning in unit_conversion(data = data_data, map = map_data, result =
## computation_df, : 'AMOUNTU' #2# is not present in the dataset provided via
## 'map'
## unit_conversion : Unit Class 3 (Dose) dose_col:  DOSE1 DOSE2  parameters are scaled from  UG  to  MG  via scaling factor:  0.001 
## unit_conversion : Unit Class 4 (Volume) volume_col:  VSSO1 VSSO2 VSSP1 VSSP2 VZTAU1 VZTAU2  parameters are scaled from  ML  to  L  via scaling factor:  0.001 
## unit_conversion : Unit Class 5 (Amount/Volume) conc_col:  CENDINF1 CENDINF2 CMAX CMAX1 CMAX2 CMIN CMIN1 CMIN2 CLAST CLAST1 CLAST2 CTROUGH1 CTROUGH2 CTROUGHEND1 CTROUGHEND2 KELC0 CEST CAV1 CAV2 CTOLDest1 CTOLDest2  parameters are scaled from  NG/ML  to  NG/ML  via scaling factor:  1 
## unit_conversion : Unit Class 6 (1/Time) kel_col:  KEL  parameters are scaled from  1/H  to  1/HR  via scaling factor:  1 
## unit_conversion : Unit Class 7 (Volume/Time) cl_col:  CLTAU1 CLTAU2  parameters are scaled from  ML/H  to  L/HR  via scaling factor:  0.001 
## unit_conversion : Unit Class 8: (Amount.Time/Volume) auc_col:  AUCALL AUCLAST AUCLAST1 AUCLAST2 AUC1 AUC2 AUC3 AUC4 AUC5 AUC6 AUC7 AUC8 AUC9 AUC10 AUC11 AUC12 AUC13 AUC14 AUC15 AUC16 AUC0_12 AUC12_24 AUCINFO AUCINFO1 AUCINFO2 AUCINFOC1 AUCINFOC2 AUCINFP AUCINFP1 AUCINFP2 AUCINFPC1 AUCINFPC2 AUCTAU1 AUCTAU2  parameters are scaled from  NG.H/ML  to  NG.HR/ML  via scaling factor:  1 
## unit_conversion : Unit Class 9: (Amount.Time.Time/Volume) aumc_col:  AUMCLAST1 AUMCLAST2 AUMCINFO1 AUMCINFO2 AUMCINFP1 AUMCINFP2 AUMCTAU1 AUMCTAU2  parameters are scaled from  NG.H.H/ML  to  NG.HR.HR/ML  via scaling factor:  1 
## unit_conversion : Unit Class 10: ([Amount.Time/Volume]/Amount) aucdn_col:  AUCALLDN1 AUCALLDN2 AUCLASTDN AUCLASTDN1 AUCLASTDN2 AUC1DN AUC2DN AUC3DN AUC4DN AUC5DN AUC6DN AUC7DN AUC8DN AUC9DN AUC10DN AUC11DN AUC12DN AUC13DN AUC14DN AUC15DN AUC16DN AUCINFODN AUCINFODN1 AUCINFODN2 AUCINFPDN AUCINFPDN1 AUCINFPDN2 AUCTAUDN1 AUCTAUDN2  parameters are scaled from  NG.H/ML/UG  to  NG.HR/ML/MG  via scaling factor:  1000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants