R Under development (unstable) (2024-09-04 r87094 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 [1,] 0e+00 0.0000000 0.0000000 0.0000000 0.0000000 0.000000 0.0000000 0.000000 [2,] 1e-04 0.0004556 0.0000776 0.0000018 0.0001213 0.005812 0.0000224 0.001836 [3,] 5e-02 0.6995000 0.7266000 0.0259000 0.3303000 0.048560 0.1135000 1.147000 [4,] 1e-01 0.9994000 1.1760000 0.0432600 0.5201000 0.066370 0.2477000 1.588000 Cplasma Calvppmv Cendexhppmv Cmixexhppmv Cmuc Atubules Ametabolized [1,] 0.0000000 0e+00 0.0000000 0.3000 0.000 0.0000000 0.0000 [2,] 0.0000023 0e+00 0.0001616 0.3000 3.733 0.0000017 0.0000 [3,] 0.0325800 2e-07 0.0740800 0.3056 1841.000 0.0102300 0.1622 [4,] 0.0544300 2e-07 0.1456000 0.3109 3634.000 0.0261300 0.5917 AUC [1,] 0.0000000 [2,] 0.0000000 [3,] 0.0009357 [4,] 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.00 0.34 4.37