Giter Site home page Giter Site logo

ggpmx's People

Contributors

agstudy avatar baltcir1 avatar bartech3 avatar biethbr1 avatar gasseam1 avatar ggpmxdevelopment avatar guilouf avatar ludwiin1 avatar mattfidler avatar sehamsick avatar tynesjo avatar tynsci avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ggpmx's Issues

No VPC graph with Monolix project

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.

Color in legend of individual plots

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)

vpc enhancment

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

change labels

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

Review Bruno: pmx_settings not effective for many aspects

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)

dv_pred , dv_ipred

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)

question on update() example found on the website

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.

Review Irina: Spline in plots with BLOQ data

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)

Spline color in a stratified plot

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)

Eta_Cats

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)

Incorrect help description for pmx_gpar

"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)

nomenclature eta-ebe

Hi guys

I would recommend a few changes concerning random effects (RE, or eta).

Scope

following plots I have been using

Distribution of RE:

ctr %>% pmx_plot_eta_box

Distrib and correlation of EBE
ctr %>% pmx_plot_eta_matrix
ctr %>% pmx_plot_eta_cats

Problem

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?
image

Eta_conts

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"))
)

image

(Old Ticket #236)

The default controller doesn't show many of the default plots.

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      

Test Irina: Set default computation for shrinkage by using variance (not sd)

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.

Test case:

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:

  • shrinkage of ka = 50% in ggPMX
  • shrinkage of ka = 74.9% in Monolix

(Old Ticket #220)

Error message with pmx_nlmixr

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

VPC not plotting after simulx simulation without error message

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)

Standardized EBEs

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)

QQ plot

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)

What happened to the CRAN version?

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?

footnote option

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)

ideas of improvement after 15 min meeting

  • add figure numbers, this way the main popPK report can directly refer to the ggPMX report, + uploaded in CREDI?
  • add table of pop parameters estimates + SE, RSE, CI # # @

Review Bruno: Range Option

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)

indicate what type of shrinkage you are calculating

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.

push cats vs EBE on different pages

Hi folks

very nice package . I really like what we can do there.
small question. I have a pretty ugly EBE vs covariates plot, due to a large labels for RACE and Ethnicity.
would you have an advice to modify this?

Annotation 2020-03-27 175121

reserved names

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

QQ plot

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)

NONMEM/ggPMX interface

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.

shrinkage

Shrinakge should be computed based on the variance computation

image

"We favor the empirical variance-based definition as it matches the theoretically-based definition of shrinkage in empirical Bayes statistics."

IWRES Quantile plot

  • Use.labels = T and cats.labels do not work.
  • Does not work properly to change axes ranges.
  • When using strat.color, some extra points in black appear.
  • strat.facet is not effective;
  • BLOQ points not shown in a different color.
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:

  • strat.facet is not effective;
  • identity line not shown by default;
  • BLOQ points not shown in a different color.

Response from Amine Gassem:

  • atrat facetting is working and
  • should set labelling in pmx_settings level
  • there is no identity_line but ``reference_line`
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:

  • strat.facet is still not effective in my testing.
  • When using strat.color, some extra points still appear in black.
  • The "reference" line is not relevant and actually misleading for a QQ plot.
  • Identity line not shown by default.
  • The issues with BLQ points and ranges still remain (as well as hline, vline).

(Old Ticket #237)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.