# NOT RUN {
calc_css(chem.name='Bisphenol-A',doses.per.day=5,f=.001,output.units='mg/L')
# }
# NOT RUN {
parms <- parameterize_3comp(chem.name='Bisphenol-A')
parms$Funbound.plasma <- .07
calc_css(parms,concentration='blood',model='3compartment')
library("ggplot2")
out <- solve_pbtk(chem.name = "Bisphenol A", days = 50, doses.per.day = 3)
plot.data <- as.data.frame(out)
css <- calc_analytic_css(chem.name = "Bisphenol A")
c.vs.t <- ggplot(plot.data,aes(time, Cplasma)) + geom_line() +
geom_hline(yintercept = css) + ylab("Plasma Concentration (uM)") +
xlab("Day") + theme(axis.text = element_text(size = 16), axis.title =
element_text(size = 16), plot.title = element_text(size = 17)) +
ggtitle("Bisphenol A")
print(c.vs.t)
days <- NULL
avg <- NULL
max <- NULL
for(this.cas in get_cheminfo()){
css.info <- calc_css(chem.cas = this.cas, doses.per.day = 1,suppress.messages=T)
days[[this.cas]] <- css.info[["the.day"]]
avg[[this.cas]] <- css.info[["avg"]]
max[[this.cas]] <- css.info[["max"]]
}
days.data <- as.data.frame(days)
hist <- ggplot(days.data, aes(days)) +
geom_histogram(fill = "blue", binwidth = 1/6) + scale_x_log10() +
ylab("Number of Chemicals") + xlab("Days") + theme(axis.text =
element_text(size = 16), axis.title = element_text(size = 16))
print(hist)
avg.max.data <- as.data.frame(cbind(avg, max))
avg.vs.max <- ggplot(avg.max.data, aes(avg, max)) + geom_point() +
geom_abline() + scale_x_log10() + scale_y_log10() +
xlab("Average Concentration at Steady State (uM)") +
ylab("Max Concentration at Steady State (uM)") +
theme(axis.text = element_text(size = 16),
axis.title = element_text(size = 16))
print(avg.vs.max)
# }
Run the code above in your browser using DataLab