R Under development (unstable) (2024-08-26 r87056 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > # R CMD BATCH --no-timing --no-restore --no-save unit_test.R unit_test.Rout > > # Get rid of anything in the workspace: > rm(list=ls()) > > library(httk) > # > # MW BPA is 228.29 g/mol > # 1 mg/L -> 1/228.29*1000 = 4.38 uM > convert_units("mg/L","uM",chem.cas="80-05-7") [1] 4.38 > # > # MW Diclofenac is 296.148 g/mol > # 1 uM -> 296.148/1000 = 0.296 > convert_units("uM","mg/L",chem.name="diclofenac") [1] 0.2962 > > # > # Compare with > # https://www.eurofinsus.com/environment-testing/services/air-and-vapor/unit-conversion-calculator/ > # STP assumes 24.45 = (25?C and 1 atm) > # 1 ug/L Toluene -> 0.26539 ppmv > convert_units("ug/L","ppmv", + chem.name="toluene", + state="gas") [1] 0.2655 > # > # 1 ppmv Toluene -> 0.0038 mg/L > convert_units("ppmv","mg/L", + chem.name="toluene", + state="gas") [1] 0.003766 > # 1 ug/L Styrene -> 0.23478 ppmv > convert_units("ug/L","ppmv", + chem.name="styrene", + state="gas") [1] 0.2348 > > # Test that convert_solve_x doesn't throw any errors: > head(solve_gas_pbtk(chem.name="bisphenol a", + times=c(0,0.1,0.05), + output.units=setNames("mg/m3","Cendexhppmv"), + method = "lsode", + mf = 10, + rtol=1e-7, + atol=1e-7)) output.unit conversion.factor Cendexhppmv mg/m3 9.332 AUC is area under the plasma concentration curve in uM*days units with Rblood2plasma = 0.795. The model outputs are provided in the following units: uM: Cgut, Cliver, Cven, Clung, Cart, Crest, Ckidney, Cplasma, Cmuc ppmv: Calvppmv, Cmixexhppmv mg/m3: Cendexhppmv umol: Atubules, Ametabolized uM*days: AUC time Cgut Cliver Cven Clung Cart Crest Ckidney Cplasma Calvppmv [1,] 0.00 0.0000 0.0000 0.00000 0.0000 0.00000 0.0000 0.000 0.00000 0.00e+00 [2,] 0.05 0.6995 0.7266 0.02590 0.3303 0.04856 0.1135 1.147 0.03258 1.77e-07 [3,] 0.10 0.9994 1.1760 0.04326 0.5201 0.06637 0.2477 1.588 0.05443 2.42e-07 Cendexhppmv Cmixexhppmv Cmuc Atubules Ametabolized AUC [1,] 0.00000 0.3000 0 0.00000 0.0000 0.0000000 [2,] 0.07408 0.3056 1841 0.01023 0.1622 0.0009357 [3,] 0.14560 0.3109 3634 0.02613 0.5917 0.0031250 Warning messages: 1: In get_clint(dtxsid = dtxsid, chem.name = chem.name, chem.cas = chem.cas, : Clint is provided as a distribution. 2: In apply_clint_adjustment(Clint.point, Fu_hep = Fu_hep, suppress.messages = suppress.messages) : Clint adjusted for in vitro partitioning (Kilford, 2008), see calc_hep_fu. 3: In parameterize_gas_pbtk(chem.cas = "80-05-7", chem.name = "bisphenol a", : Funbound.plasma adjusted for in vitro partitioning (Pearce, 2017). Set adjusted.Funbound.plasma to FALSE to use original value. 4: In parameterize_gas_pbtk(chem.cas = "80-05-7", chem.name = "bisphenol a", : Cannot calculate saturable metabolism with Vmax = 0. Defaulting to first-order metabolic clearance. 5: In get_caco2(chem.cas = chem.cas, chem.name = chem.name, dtxsid = dtxsid, : Default value of 1.6 used for Caco2 permeability. > > # Quit without saving or displaying messages: > quit("no") > proc.time() user system elapsed 4.23 0.29 4.51