R scripts/codes for in-vivo conc. [Dissolution / BCS / IVIVC]
Hi amer,
I see. But it is still part of model validation. I prepare the codes (R script) mainly pulled from ivivc for R. The following steps are required to run the codes (amer.R).
I don't know if this is what you want. Let me know you still have question about running the codes. I have tested the codes and it works well.
Not validated with WLN. Should I? I do not have WLN. If you have WNL, can you help to validate?
❝ ... However, i didnt actually mean external validation. What i meant is this: I have constructed IVIVC using in vivo data and dissolution data done at pH 1.2. if i have a new dissolution data (say done at pH 2), how can i predict the in vivo concentrations based on the new dissolution (i.e. does ivivc for R does convulution where the input is the dissolution data and we want to predict the output which is plasma concentration profile?).
I see. But it is still part of model validation. I prepare the codes (R script) mainly pulled from ivivc for R. The following steps are required to run the codes (amer.R).
- Run ivivc first and get Levy plots. Take a note about the slope and intercept of Levy plots. You will need that later. This step will also generate PK parameters saved in a file called pk_values.rds in working path. You will need this file too.
- prepare your dataset as csv format with 4 columns named as "pH","subj","time","FRD". Then save this dataset file as csv format in R working path (getwd() to know where it is).
- copy the the following codes and paste it with plain editor. Now, you can update Slope, Intercept,dose of MR, and your dataset file name (red-inked parts in the codes). Save it in your R working path.
- open R console/terminal. type source("amer.R") to run the codes, supposed the codes are saved as amer.R. Go to your R working path to find a file called predicted_in-vivo_dataset.csv. Done.
### amer.R
Slope<- 0.939 ### from levy plots; change the value if necessary
Intercept<- 10.6 ### from levy plot; change the value if necessary
Dose<- 200000 ### dose of MR administered; change the value if necessary
### the unit of 'Dose' may need to be converted, depending
### unit of conc. and Vd.
keindex<- readRDS("pk_values.rds") ### load kel & Vd from previous Wagner-Nelson method
cnames<- c("pH","subj","time","FRD")
InVVTestindex<- load.csv.data("your_dataset.csv",cnames) ### pls change the file name.
W.data<- data.frame(pH=InVVTestindex$pH,subj=InVVTestindex$subj, time=InVVTestindex$time,FRD=InVVTestindex$FRD)
W.split<- split(W.data,list(W.data$pH,W.data$subj))
pH<- 0 ### not used at all.
PredCp<- NULL
time<- NULL
for (j in 1:length(W.split)){
PFab<- 0
PCp<- 0
for(x in 1: length(unique(keindex$subj))) {
if (W.split[[j]][["subj"]][1]==keindex$subj[[x]]) {
ke<- keindex$ke[[x]];Vd<- keindex$Vd[[x]]}} ### load kel, Vd from previous Wagner-Nelson
for(i in 2:length(W.split[[j]][["FRD"]])){
PFab[i]<-(W.split[[j]][["FRD"]][i])*Slope + Intercept} ### calc predicted Fab
for(i in 2:length(W.split[[j]][["time"]]))
PCp[i]<-((PCp[i-1]*(2-((W.split[[j]][["time"]][i]-W.split[[j]][["time"]][i-1])*ke))+(2*(PFab[i]-PFab[i-1])*1/100*Dose/Vd))/(2+(ke*(W.split[[j]][["time"]][i]-W.split[[j]][["time"]][i-1])))) ### PCp[i] = predicted in-vivo conc.
time[[j]]<- c(W.split[[j]][["time"]])
PredCp[[j]]<- c(PCp)
}
CC<- reshape2::melt(PredCp)
DD<- reshape2::melt(time)
Predvivo<- data.frame(subj=InVVTestindex$subj,time=DD$value,conc.pred=CC$value)
write.csv(Predvivo,"predicted_in-vivo_dataset.csv",row.names=FALSE)
cat("\nDone.\n\n") ### done.
I don't know if this is what you want. Let me know you still have question about running the codes. I have tested the codes and it works well.
❝ on the side, just wondering if the ivivc package been validated against standard ivivc software (say WinNonlin?)
Not validated with WLN. Should I? I do not have WLN. If you have WNL, can you help to validate?
—
All the best,
-- Yung-jin Lee
bear v2.9.2:- created by Hsin-ya Lee & Yung-jin Lee
Kaohsiung, Taiwan https://www.pkpd168.com/bear
Download link (updated) -> here
All the best,
-- Yung-jin Lee
bear v2.9.2:- created by Hsin-ya Lee & Yung-jin Lee
Kaohsiung, Taiwan https://www.pkpd168.com/bear
Download link (updated) -> here
Complete thread:
- predicting in vivo PK profiles from in vitro data after establishing IVIVC amer 2019-09-09 05:04 [Dissolution / BCS / IVIVC]
- external predictability for ivivc yjlee168 2019-09-09 10:46
- external predictability for ivivc amer 2019-09-10 02:31
- identical pH Helmut 2019-09-10 10:58
- identical pH yjlee168 2019-09-10 15:30
- R scripts/codes for in-vivo conc.yjlee168 2019-09-10 15:13
- Software validation, another round Helmut 2019-09-10 15:37
- Deconvolution mittyri 2019-09-10 15:54
- Software validation, another round yjlee168 2019-09-11 10:29
- Software validation, another round Helmut 2019-09-11 13:39
- Software validation, another round amer 2019-09-12 05:26
- Should we also consider to validate the validation? yjlee168 2019-09-12 09:46
- Who inspects the inspectors? Helmut 2019-09-13 12:07
- Who inspects the inspectors? nobody 2019-09-13 12:55
- Sapienti sat Helmut 2019-09-13 12:59
- Who inspects the inspectors? nobody 2019-09-13 12:55
- Who inspects the inspectors? Helmut 2019-09-13 12:07
- Should we also consider to validate the validation? yjlee168 2019-09-12 09:46
- Software validation, another round amer 2019-09-12 05:26
- Software validation, another round Helmut 2019-09-11 13:39
- R scripts/codes for in-vivo conc. amer 2019-09-11 05:35
- Bioavailabity term in predicted in-vivo conc. yjlee168 2019-09-11 10:16
- Software validation, another round Helmut 2019-09-10 15:37
- identical pH Helmut 2019-09-10 10:58
- external predictability for ivivc amer 2019-09-10 02:31
- external predictability for ivivc yjlee168 2019-09-09 10:46