ggpmxdevelopment / ggpmx Goto Github PK
View Code? Open in Web Editor NEWggPMX R package
ggPMX R package
Using an already fitted monolix project with pmx_mlxtran(), the controller output does not show any VPC object whereas the VPC files exist in the Monolix project folder.
All other diagnostic plots are present in the controller.
I also tried with a random monolix project from the demo of Monolix and I got the same result, no VPC.
The legend seems to work fine for linetypes, but not colors (both are shown in the color of pop.predictions in the legend).
ctr <- theophylline()
ctr %>% pmx_plot_individual(
is.legend=TRUE,
point=list(shape=20),
pred_line=list(linetype=6),
pred_line=list(linetype=3))
(Old ticket #237)
It works nicely now! Thank you Amine! Much appreciated.
Can you do the minor additional changes for the default setting:
Put the legend on the right hand side as suggested by Thomas in his first post
Shaded area for median in red
Dotted line for the percentiles (lowest and highest)
Straight line for median
In legend, below the word Simulation, can you add (XX% CI) with XX corresponding to the percent confidence interval -need to change interactively when user customize the pi=pmx_vpc_ci(interval=c(0.1,0.9)) to 80% for example - by default should be 95% confidence interval pi=pmx_vpc_ci(interval=c(0.025,0.975))
The footnote should come as separate option and not together with option is.legend - is.footnote=F by default
Is there a timeline for adding support for NONMEM and nlmixr?
changing the cats labels did not work
#user settings for report
mySet=pmx_settings(is.draft=DRAFT_STATUS!= "Final", use.labels = TRUE,
cats.labels = list(
RACE = c("Asian"= "As", "Black"="Bl", "Caucasian" = "Ca", "Other"= "Ot"),
ETHN = c("Chinese" = "Ch",
"Hispanic/Latino" = "Hi",
"Indian (Indian subcontinent)" = "In",
"Japanese" = "Ja",
"Mixed Ethnicity" = "Mi",
"Other"="Ot"),
JAP = c("0"="non-Japanese", "1"="japanese")
)
)
ctr <- pmx_mlxtran(mlxpath, config = "standing", settings = mySet )
ctr %>% pmx_plot_eta_cats
'''
show the original names
Many customizations are not effective when specified in pmx_settings
.
It would be good if changing of labels of parameters, covariates and categories to full words would be effective with specification in the pmx_settings
. Currently this only works for parameter labels.
my_settings <- pmx_settings(
# for names of categories # **not effective via pmx_settings**
cats.labels=list(
SEX=c("0"="Male","1"="Female"),
AGECAT=c("0"="<50","1"=">=50")
),
use.labels=TRUE,
# for names of parameters # **works ok**
effects=list(
levels=c("ka", "V", "Cl", "Tlag"),
labels=c("Absorption_rate", "Volume", "Clearance", "Absorption_delay")
),
# for labels of covariates # **not effective via pmx_settings**
covariates=pmx_cov(
values=list("sex", "AGECAT", "STUD"),
labels=list("Sex", "Age group", "Study")
)
)
ctr <- pmx_mlx(
directory=work_dir,
input=input_data,
dv="dv",
dvid="dvid",
conts=c("wt","age"),
cats=c("sex","AGECAT","STUD"),
strats=c("sex","AGECAT","STUD"),
settings=my_settings,
config="standing"
)
(Old Ticket #229)
When customizing identity_line, it is not shown.
When using scale_x_log10 = T and scale_y_log10 = T, ranges are ignored.
When using scale_x_log10 = T and scale_y_log10 = T, the identity line is not shown
(Linked to old ticket #238)
data.table factors isn't working well.
You are first running cmt2fit.logn with nlmixr()
then you call update() with a proportional model: linCmt()~prop.sd
Where prop.sd comes from (no ini values)?
I tried on my data and get the following:
Error in model(.uif, .lines = .deparse(.x)):
Could not find a part of the model to modify.
Suggest to have an option to exclude the BLQ points from the spline while still showing them.
In ggplot2, it can be done by specifying a subsetted dataset for the smoother, e.g.
ggplot(db, aes(time, npde)) +
geom_point() +
geom_smooth(data = db[db$cens==0,])
The option naming could be:
smooth_with_bloq = T/F.
(Old Ticket #240)
When using strat.color stratification by a categorical covariate, it would be useful if it was possible to have splines for the different strata in different colour (like in ggplot2 with aes(color=cat_covar))
(Old Ticket #227)
cats.labels (+use.labels) does not work.
How to change covariate labels to full words?
How to specify symmetric ranges of y-axis different for each parameter?
Does not work to add hline.
Shrinkage is not shown.
Jitter does not work.
(Old Ticket #235)
Currently defaults to empty. In nlmixr the CMT
will also call out the name of each endpoint since it is a factor.
Grid format #265
"xlab" and "ylab" are shown as arguments for "labels" in the pmx_gpar function.
They do not work. The arguments that work are "x" and "y".
To be double-checked
(Old ticket #221)
Hi guys
I would recommend a few changes concerning random effects (RE, or eta).
following plots I have been using
ctr %>% pmx_plot_eta_box
ctr %>% pmx_plot_eta_matrix
ctr %>% pmx_plot_eta_cats
I think there is confusion in the definition of EBE.
Not clear if you are plotting individual parameter estimate (as the x label shows in the plot) or random effect (eta, as the title and the name of the plot shows). I don't think it is clear in the guidance as well what EBE is: Sometimes it is EBE of phi (individual parameter), sometimes it is EBE of eta (individual random effect).
To me this is NONMEM linguo that we should avoid.
Can you change the label of the parameters to show eta_parameter?
Test the following setting - never tested before
ctr <- theophylline( settings = pmx_settings(
effects=list( levels=c("ka", "V", "Cl"),
labels=c("Concentration","Volume","Clearance")
)
)
)
ctr %>% pmx_plot_eta_conts(
covariates=pmx_cov(values=list("WT0","AGE0"),
labels=list("Weight","Age"))
)
(Old Ticket #236)
From the master
branch I try the 2-compartment model for ACoP:
> ctr <- pmx_nlmixr(cmt2fit.logn, conts = c("WEIGHTB"), cats="")
Compiling VPC model...done
done (14.77 sec)
No data predictions provided for plot abs_iwres_ipred
No data predictions provided for plot iwres_ipred
No data predictions provided for plot iwres_time
No data predictions provided for plot iwres_dens
No data predictions provided for plot iwres_qq
No data predictions provided for plot npde_time
No data predictions provided for plot npde_pred
No data predictions provided for plot npde_qq
No data predictions provided for plot dv_pred
No data predictions provided for plot dv_ipred
No data eta provided for plot eta_hist
No data eta provided for plot eta_box
No data eta provided for plot eta_matrix
No data eta provided for plot eta_cats
No data eta provided for plot eta_conts
No data eta provided for plot eta_qq
However these data are availble in the fit dataset:
> summary(cmt2fit.logn)
ID TIME DV EVID
68 : 26 Min. : -24.401 Min. :0.05005 Min. :0.0000
95 : 26 1st Qu.: 1.079 1st Qu.:0.10660 1st Qu.:0.0000
97 : 26 Median : 503.766 Median :0.22912 Median :0.0000
100 : 26 Mean : 917.604 Mean :0.62802 Mean :0.2501
101 : 26 3rd Qu.:2017.648 3rd Qu.:0.72274 3rd Qu.:0.0000
109 : 26 Max. :2043.464 Max. :6.99600 Max. :2.0000
(Other):2051 NA's :276
PRED RES IPRED IRES
Min. :0.00000 Min. :-2.90123 Min. :0.00000 Min. :-2.18264
1st Qu.:0.09647 1st Qu.:-0.12011 1st Qu.:0.08453 1st Qu.:-0.03372
Median :0.23525 Median :-0.00322 Median :0.18924 Median : 0.00407
Mean :0.55695 Mean :-0.00854 Mean :0.52614 Mean : 0.02668
3rd Qu.:0.56559 3rd Qu.: 0.07286 3rd Qu.:0.57658 3rd Qu.: 0.05016
Max. :3.55127 Max. : 3.91663 Max. :5.27843 Max. : 3.20780
NA's :276 NA's :276
IWRES eta.ka eta.v eta.cl
Min. :-6.56312 Min. :-1.47793 Min. :-0.234460 Min. :-1.17410
1st Qu.:-0.51551 1st Qu.:-0.30356 1st Qu.:-0.048226 1st Qu.:-0.22807
Median : 0.07591 Median :-0.05830 Median :-0.005144 Median : 0.03919
Mean :-0.01360 Mean :-0.05465 Mean : 0.005328 Mean : 0.02382
3rd Qu.: 0.61589 3rd Qu.: 0.23145 3rd Qu.: 0.055129 3rd Qu.: 0.25916
Max. : 2.61097 Max. : 0.99939 Max. : 0.301327 Max. : 1.08140
NA's :276
rx1c ka cl v
Min. :0.00000 Min. :0.08407 Min. : 3.97 Min. : 9.342
1st Qu.:0.08453 1st Qu.:0.27204 1st Qu.:10.22 1st Qu.:11.254
Median :0.18924 Median :0.34766 Median :13.36 Median :11.749
Mean :0.52614 Mean :0.38069 Mean :14.66 Mean :11.917
3rd Qu.:0.57658 3rd Qu.:0.46451 3rd Qu.:16.64 3rd Qu.:12.479
Max. :5.27843 Max. :1.00116 Max. :37.87 Max. :15.963
q vp depot central
Min. :10.76 Min. :176.9 Min. : 0.00000 Min. : 0.000
1st Qu.:10.76 1st Qu.:176.9 1st Qu.: 0.07341 1st Qu.: 1.010
Median :10.76 Median :176.9 Median : 5.94848 Median : 2.244
Mean :10.76 Mean :176.9 Mean : 38.14703 Mean : 6.291
3rd Qu.:10.76 3rd Qu.:176.9 3rd Qu.: 30.75620 3rd Qu.: 6.920
Max. :10.76 Max. :176.9 Max. :299.20868 Max. :61.942
peripheral EPRED ERES NPDE
Min. : 0.000 Min. : 0.0000 Min. :-11.22258 Min. :-2.9383
1st Qu.: 3.271 1st Qu.: 0.0660 1st Qu.: -0.24053 1st Qu.:-1.0640
Median : 27.238 Median : 0.2248 Median : 0.01909 Median : 0.7676
Mean : 47.625 Mean : 0.6411 Mean : -0.03535 Mean : 0.3534
3rd Qu.: 65.516 3rd Qu.: 0.7465 3rd Qu.: 0.20877 3rd Qu.: 1.3411
Max. :508.961 Max. :11.6711 Max. : 5.26707 Max. : 3.6129
NA's :276 NA's :276
All shrinkage labels for ggPMX plots use shrinkage that is computed based on SD.
However, Novartis PMX Internal Guidance for model building, evaluation, and qualification recommended the use of shrinkage that is based on variance.
Monolix2018 with the following example:
mlxtran_file = "/USER_EXAMPLES/MLX/2018/8.PKPD/SIMULTANEOUS_USING_LIBRARIES/warfarin_PKPDlibrary_project.mlxtran"
ctr = pmx_mlxtran(file_name = mlxtran_file, endpoint = "2")
For example:
(Old Ticket #220)
pmx_report - Footnote=FALSE #278
Can we have an option like that?
ctr %>% pmx_filter(data_set = "prediction", SEX==1)
(Old Ticket #245)
The following code :
ctr <- pmx_nlmixr(fit_ka_focei)
fit_ka_focei runs successfully from:
fit_ka_focei <- nlmixr(one.cmt.ka, d3, est="focei", table = list(cwres=TRUE, npde=TRUE))
gave the following message:
Compiling model...done
Compiling VPC model...done
done (1.99 sec)
Error in pmx_nlmixr(fit_ka_focei) :
Cannot merge nlmixr fit with observation dataset
Any help will be appreciated
It would be good to have an option to plot decorrelated EBEs when the var-covar matrix is not diagonal.
(Old Ticket #243)
with simulx, ids are changed to a new ID, starting at 1.
one should modify the simulated file to revert the original IDs. example of code below:
mysim <- simulx(project=mlxpath,nrep=2)
simdata = mysim$y3
simdata <- simdata%>%
left_join(., mysim$originalId)%>%
mutate(id = oriId)%>%
select(-oriId, -newId)
Check that we have different color in all plots except those concerning EBEs (etas).
(Old Ticket #239)
A useful option for EBE-based plots for a faster interpretation would be to show standardized EBEs, with reference lines at 0, -1.96 and 1.96.
The standardized EBEs are available in Monolix 2018 outputs in the file RESULTS/ChartsData/DistributionOfTheRandomEffects/standardizedEta.txt
(Old Ticket #244)
ctr %>% pmx_plot_eta_qq
With the above, I get some horizontial line at 0. It it not necessary for this plot, please remove.
ctr %>% pmx_plot_eta_qq(reference_line=list(color="blue",linetype=4))
THis changes only the linetype, but not the color.
ctr %>% pmx_plot_eta_qq(reference_line=NULL)
This does not remove the reference line.
(Old Ticket #223)
Hi,
I was looking forward to testing out the package, but for some reason it's not available on CRAN
https://cran.r-project.org/web/packages/ggPMX/index.html
It says
Package ‘ggPMX’ was removed from the CRAN repository.
Formerly available versions can be obtained from the archive.
Archived on 2020-04-03 as check problems were not corrected in time.
Please use the canonical form https://CRAN.R-project.org/package=ggPMX to link to this page.`
Do you know what happened?
Do you plan to fix it?
Once pmx_report generates the listing of plots with footnote == TRUE, it seems that afterwards when user wants to generate individual GOF plots using pmx_plot_XXX, then all plots are generated subsequently with footnote.
I would expect footnote to be a local variable for pmx_report, NOT for the individual GOF plots (see enclosed). Please confirm and fix adequately the bug.
setwd('/home/biethbr1/SVN/ggPMX_doc/')
WORK_DIR = '/home/biethbr1/SVN/ggPMX_doc/USER_EXAMPLES/MLX/PK_WITH_COVARIATE/RESULTS'
input_file = '/home/biethbr1/SVN/ggPMX_doc/USER_EXAMPLES/MLX/PK_WITH_COVARIATE/warfarin_data3.csv'
ctr <- pmx(
sys="mlx",
config='standing',
directory = WORK_DIR,
input = input_file,
dv = "dv",
cats=c("AGECAT"),
dvid='dvid')
ctr %>% pmx_report(name='Diagnostics_Plots2',save_dir = '/home/biethbr1/SVN/ggPMX_doc/USER_EXAMPLES/MLX/PK_WITH_COVARIATE',output_type='plots',footnote=TRUE)
pdf('Test.pdf',10,6)
ctr %>% pmx_plot_ebe_box()
ctr %>% pmx_plot_individual(npage=NULL)
dev.off()
(Old Ticker #221)
pmx_nlmixr is not documented. You could probably inherit from some other documentation.
Need to use the same default as pmx_plot_eta_cats where:
Number of rows = number of parameters
Number of columns = number of continuous covariates
to allow for shared axes ranges and labels.
(Old Ticket #241)
zoom requires the use of "ranges" option. Can you confirm to us that you always use coord_cartesian
in the ggplot2 call for the plots? What is the exact syntax for ranges? Both codes below works
ctr %>% pmx_plot_npde_time(ranges=list(x=c(10,20))
ctr %>% pmx_plot_npde_time(ranges=list(xlimit=c(10,20))
A few bugs still left. X limit seems to work. Y limit does not work sometimes - see below
ctr <- theophylline()
ctr %>% pmx_plot_npde_time(ranges=list(x=c(10,20),y=c(-1,1)))
Bug below - Display is not correct. Is it because we ask for square shaped plots?
ctr <- theophylline()
ctr %>% pmx_plot_dv_pred(ranges = list(x=c(200,500), y=c(100,200)))
(Old ticket #304)
Possibility to customize folder output for pmx_report
instead of generic folder name "ggpmx_GOF".
I think you should indicate what type of shrinkage you are calculating in your plots; Otherwise there can be confusion since both variance and standard deviation shrinkages are used in pharmacometrics.
PRED-related plots were not produced with a moonolix 2018 and 2019 project
came out that PRED was the name of one column in the modeling dataset
when building the controller, this input PRED and the monolix predictions columns were renamed to PRED.x and PRED.y, leading to an impossibility for ggPMX to create PRED infos
conclusion: a list of all reserved terms may be useful
ctr %>% pmx_plot_eta_qq
With the above, I get some horizontial line at 0. It it not necessary for this plot, please remove.
ctr %>% pmx_plot_eta_qq(reference_line=list(color="blue",linetype=4))
THis changes only the linetype, but not the color.
ctr %>% pmx_plot_eta_qq(reference_line=NULL)
This does not remove the reference line.
(Old Ticket #223)
Question: How to change the x-axis label for VPC plot? Not always time for example! Could be "weight" instead for example
(Old Ticket # 217)
As we did for MONOLIX and nlmixr we would like to read NONMEM output to create ggPMX reports and plots.
This is an open issue any contribution is welcome.
[DEFAULT] QQ plot for ETAs is incorrect #223
Generation of pdf document on Windows environment #303
ctr <- theophylline()
max.iwres <- 3
ctr %>% pmx_plot_iwres_qq(
strat.color = "SEX",
cats.labels = list(SEX=c("0"="M","1"="F")), use.labels = TRUE,
ranges = list(x = c(-max.iwres*1.05, max.iwres*1.05), y = c(-max.iwres*1.05, max.iwres*1.05)) ,
hline = list(yintercept = 0, color = "black", size = 0.25),
vline = list(xintercept = 0, color = "black", size = 0.25),
use.identity_line = F,
identity_line = list (color = "red", linetype = 3))
Additional issues:
Response from Amine Gassem:
ctr <- theophylline(
pmx_settings(cats.labels = list(SEX=c("0"="M","1"="F")),
use.labels = TRUE)
)
ctr %>% pmx_plot_iwres_qq(
strat.facet = "SEX",
reference_line = list (color = "red", linetype = 3))
Further investigation:
(Old Ticket #237)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.