# \donttest{
library(httk)
# Number of chemicals distributed with the package:
num.chems <- length(get_cheminfo())
fake <- data.frame(Compound="Tester",
CASRN="222-11-1",
DTXSID="DTX111222",
MW=200,
logP=3.5,
Fup=0.1,
Clint=0.1,
Clint.pValue=0.001,stringsAsFactors=FALSE)
chem.physical_and_invitro.data <- add_chemtable(
fake,
current.table=chem.physical_and_invitro.data,
data.list=list(
Compound="Compound",
CAS="CASRN",
DTXSID="DTXSID",
MW="MW",
logP="logP",
Funbound.plasma="Fup",
Clint="Clint",
Clint.pValue="Clint.pValue"),
species="Human",
reference="Fake")
calc_css(chem.name="Tester")
#load_sipes2017()
# We should have the ADMet Predicted chemicals from Sipes et al. (2017),
# this one is a good test since the logP is nearly 10!
#calc_css(chem.cas="26040-51-7")
#Let's see how many chemicals we have now with the Sipes (2017) data loaded)=:
#length(get_cheminfo())
#Now let's reset
reset_httk()
# We should be back to our original number:
num.chems == length(get_cheminfo())
# Now add chemicals A, B, and C:
my.new.data <- as.data.frame(c("A","B","C"),stringsAsFactors=FALSE)
my.new.data <- cbind(my.new.data,as.data.frame(c(
"111-11-2","222-22-0","333-33-5"),
stringsAsFactors=FALSE))
my.new.data <- cbind(my.new.data,as.data.frame(c("DTX1","DTX2","DTX3"),
stringsAsFactors=FALSE))
my.new.data <- cbind(my.new.data,as.data.frame(c(200,200,200)))
my.new.data <- cbind(my.new.data,as.data.frame(c(2,3,4)))
my.new.data <- cbind(my.new.data,as.data.frame(c(0.01,0.02,0.3)))
my.new.data <- cbind(my.new.data,as.data.frame(c(0,10,100)))
colnames(my.new.data) <- c("Name","CASRN","DTXSID","MW","LogP","Fup","CLint")
chem.physical_and_invitro.data <- add_chemtable(my.new.data,
current.table=
chem.physical_and_invitro.data,
data.list=list(
Compound="Name",
CAS="CASRN",
DTXSID="DTXSID",
MW="MW",
logP="LogP",
Funbound.plasma="Fup",
Clint="CLint"),
species="Human",
reference="MyPaper 2015")
parameterize_steadystate(chem.name="C")
calc_css(chem.name="B")
# Initialize a column describing proton donors ("acids")
my.new.data$pka.a <- NA
# set chemical C to an acid (pKa_donor = 5):
my.new.data[my.new.data$Name=="C","pka.a"] <- "5"
chem.physical_and_invitro.data <- add_chemtable(my.new.data,
current.table=
chem.physical_and_invitro.data,
data.list=list(
Compound="Name",
CAS="CASRN",
DTXSID="DTXSID",
pKa_Donor="pka.a"),
species="Human",
reference="MyPaper 2015")
# Note Rblood2plasma and hepatic bioavailability change (relative to above):
parameterize_steadystate(chem.name="C")
# Initialize a column describing proton acceptors ("bases")
my.new.data$pka.b <- NA
# set chemical B to a base with multiple pka's (pKa_accept = 7 and 8):
my.new.data[my.new.data$Name=="B","pka.b"] <- "7;8"
chem.physical_and_invitro.data <- add_chemtable(my.new.data,
current.table=
chem.physical_and_invitro.data,
data.list=list(
Compound="Name",
CAS="CASRN",
DTXSID="DTXSID",
pKa_Accept="pka.b"),
species="Human",
reference="MyPaper 2015")
# Note that average and max change (relative to above):
calc_css(chem.name="B")
# }
Run the code above in your browser using DataLab