Updating xpose4 stratification headers in VPCs

4 messages 4 people Latest: Sep 24, 2020

Updating xpose4 stratification headers in VPCs

From: Rik Schoemaker Date: September 24, 2020 technical
Dear all, I realise that xpose4 is perceived as getting a bit old, but as far as I can tell it is still very widely used in the community, and auto-generated R-code from PsN still uses xpose4. My own hesitation has always been in the perceived lack of options to customise the output, but it has so many handy features 😊. Currently I'm running VPCs with multi-level stratification implemented using the STRT variable in NONMEM code, and my resulting VPCs have 4 graphs. However, the headings of these graphs are the pretty ugly "STRT==0.5", "STRT==101" etc. Is there a way to change this to a nice factor with customisable layout? And while we're at it: is there a way to access/extract the individual graphs so these can be formatted and/or printed separately? Thanks very much in advance! Kind regards, Rik xpose4::xpose.VPC(pc.info='vpc_results.csv', vpctab='vpctab008',#xlim=c(0,42), PI='lines',type='n',PI.identify.outliers=FALSE,#by='STRT', PI.x.median=TRUE, PI.ci.area.smooth=TRUE, PI.rug=FALSE, PI.ci.up.arcol="dodgerblue", PI.ci.down.arcol="dodgerblue", PI.real.med.col="brown", PI.real.up.col="brown", PI.real.down.col="brown",col="brown", main="VPC final model",ylb="Drug X (ng/mL)",xlb="Time (h)",ylim=c(0.01,120),logy=TRUE, scales = list(x = list(at = seq(0,36,3)))) Rik Schoemaker, PhD Occams Coöperatie U.A. Malandolaan 10 1187 HE Amstelveen The Netherlands http://www.occams.com +31 20 441 6410 [email protected]<mailto:[email protected]> [cid:[email protected]]

Re: Updating xpose4 stratification headers in VPCs

From: Jakob Ribbing Date: September 24, 2020 technical
Hi Rik, Indeed, you can make it prettier, more informative and more ggplot-like (but it is still a lattice plot). You can change the xposeVPC object (vpcPlot, in my example), e.g. setting size of strip labels, y-label, etc, by updating the plot list. vpcPlot@plotList[[1]] <- update(vpcPlot@plotList[[1]],[here you enter arguments, like ylab=list(“Your y-label",cex=2)]) Then, you can select what panels you want to include, and give them the appropriate strip-label text: PrettierPlot <- c(“Dose A"=vpcPlot@plotList[[1]], “Dose B"=vpcPlot@plotList[[3]], “Dose C"=vpcPlot@plotList[[5]],layout = c(3,1)) That last step one has to be careful, as it is a bit error prone: you manually set the labels and if you get it wrong it will be mislabelled. Best regards Jakob Jakob Ribbing, Ph.D. Senior Consultant, Pharmetheus AB Cell/Mobile: +46 (0)70 514 33 77 [email protected] www.pharmetheus.com Phone, Office: +46 (0)18 513 328 Uppsala Science Park, Dag Hammarskjölds väg 36B SE-752 37 Uppsala, Sweden This communication is confidential and is only intended for the use of the individual or entity to which it is directed. It may contain information that is privileged and exempt from disclosure under applicable law. If you are not the intended recipient please notify us immediately. Please do not copy it or disclose its contents to any other person.
Quoted reply history
> On 24 Sep 2020, at 08:34, Rik Schoemaker <[email protected]> wrote: > > Dear all, > > I realise that xpose4 is perceived as getting a bit old, but as far as I can > tell it is still very widely used in the community, and auto-generated R-code > from PsN still uses xpose4. My own hesitation has always been in the > perceived lack of options to customise the output, but it has so many handy > features 😊. Currently I'm running VPCs with multi-level stratification > implemented using the STRT variable in NONMEM code, and my resulting VPCs > have 4 graphs. However, the headings of these graphs are the pretty ugly > "STRT==0.5", "STRT==101" etc. Is there a way to change this to a nice factor > with customisable layout? And while we're at it: is there a way to > access/extract the individual graphs so these can be formatted and/or printed > separately? > > Thanks very much in advance! > > Kind regards, > > Rik > > > xpose4::xpose.VPC(pc.info http://pc.info/='vpc_results.csv', > vpctab='vpctab008',#xlim=c(0,42), > > PI='lines',type='n',PI.identify.outliers=FALSE,#by='STRT', > PI.x.median=TRUE, > PI.ci.area.smooth=TRUE, > PI.rug=FALSE, > PI.ci.up.arcol="dodgerblue", > PI.ci.down.arcol="dodgerblue", > PI.real.med.col="brown", > PI.real.up.col="brown", > PI.real.down.col="brown",col="brown", > main="VPC final model",ylb="Drug X > (ng/mL)",xlb="Time (h)",ylim=c(0.01,120),logy=TRUE, > scales = list(x = list(at = seq(0,36,3)))) > > > Rik Schoemaker, PhD > Occams Coöperatie U.A. > Malandolaan 10 > 1187 HE Amstelveen > The Netherlands > www.occams.com http://www.occams.com/ > +31 20 441 6410 > [email protected] <mailto:[email protected]> > > <image001.png>
Dear Rik, You can alter the sub headings with 'main.sub=c("Plot 1 name","Plot 2 name", ...)' It is also worth knowing that you can select plots for specific strata this way: VPCS <- xpose4::xpose.VPC(pc.info='vpc_results.csv', vpctab='vpctab008') listVPCS <- VPCS@plotList # List of VPC plots for all strata VPC1 <- listVPCS[[1]] # VPC for first strata VPC2 <- listVPCS[[2]] # VPC for second strata Kind regards, Martin Bergstrand, Ph.D. Principal Consultant Pharmetheus AB +46(0)709 994 396 [email protected] www.pharmetheus.com *This communication is confidential and is only intended for the use of the individual or entity to which it is directed. It may contain information that is privileged and exempt from disclosure under applicable law. If you are not the intended recipient please notify us immediately. Please do not copy it or disclose its contents to any other person.*
Quoted reply history
On Thu, Sep 24, 2020 at 8:43 AM Rik Schoemaker <[email protected]> wrote: > Dear all, > > > > I realise that xpose4 is perceived as getting a bit old, but as far as I > can tell it is still very widely used in the community, and auto-generated > R-code from PsN still uses xpose4. My own hesitation has always been in the > perceived lack of options to customise the output, but it has so many handy > features 😊. Currently I'm running VPCs with multi-level stratification > implemented using the STRT variable in NONMEM code, and my resulting VPCs > have 4 graphs. However, the headings of these graphs are the pretty ugly > "STRT==0.5", "STRT==101" etc. Is there a way to change this to a nice > factor with customisable layout? And while we're at it: is there a way to > access/extract the individual graphs so these can be formatted and/or > printed separately? > > > > Thanks very much in advance! > > > > Kind regards, > > > > Rik > > > > > > xpose4::xpose.VPC(pc.info='vpc_results.csv', > > vpctab='vpctab008',#xlim=c(0,42), > > > PI='lines',type='n',PI.identify.outliers=FALSE,#by='STRT', > > PI.x.median=TRUE, > > PI.ci.area.smooth=TRUE, > > PI.rug=FALSE, > > PI.ci.up.arcol="dodgerblue", > > PI.ci.down.arcol="dodgerblue", > > PI.real.med.col="brown", > > PI.real.up.col="brown", > > PI.real.down.col="brown",col="brown", > > main="VPC final model",ylb="Drug X > (ng/mL)",xlb="Time (h)",ylim=c(0.01,120),logy=TRUE, > > scales = list(x = list(at = seq(0,36,3)))) > > > > > > *Rik Schoemaker, PhD* > > *Occams *Coöperatie U.A. > Malandolaan 10 > 1187 HE Amstelveen > The Netherlands > > www.occams.com > > +31 20 441 6410 > [email protected] > > > > > -- Martin Bergstrand, Ph.D. Principal Consultant Pharmetheus AB +46(0)709 994 396 [email protected] www.pharmetheus.com +46(0)18 513 328 U-A Science Park, Dag Hammarskjölds v. 36b 752 37 Uppsala, Sweden *This communication is confidential and is only intended for the use of the individual or entity to which it is directed. It may contain information that is privileged and exempt from disclosure under applicable law. If you are not the intended recipient please notify us immediately. Please do not copy it or disclose its contents to any other person.*
Hello Rik, xpose4 is based on lattice package, most of lattice arguments/options can be passed to xpose4. To change the label of each stratum you can use this option; *strip=strip.custom(factor.levels=myStrataLabel) *; myStrataLabel is character vectors containing label for each of your stratum to access or change the order of each stratification, you can use this option *index.cond = list(c(1,2,3,4...n))*, # Set order of sub-plots Mahmoud
Quoted reply history
On Thu, Sep 24, 2020 at 8:50 AM Rik Schoemaker <[email protected]> wrote: > Dear all, > > > > I realise that xpose4 is perceived as getting a bit old, but as far as I > can tell it is still very widely used in the community, and auto-generated > R-code from PsN still uses xpose4. My own hesitation has always been in the > perceived lack of options to customise the output, but it has so many handy > features 😊. Currently I'm running VPCs with multi-level stratification > implemented using the STRT variable in NONMEM code, and my resulting VPCs > have 4 graphs. However, the headings of these graphs are the pretty ugly > "STRT==0.5", "STRT==101" etc. Is there a way to change this to a nice > factor with customisable layout? And while we're at it: is there a way to > access/extract the individual graphs so these can be formatted and/or > printed separately? > > > > Thanks very much in advance! > > > > Kind regards, > > > > Rik > > > > > > xpose4::xpose.VPC(pc.info='vpc_results.csv', > > vpctab='vpctab008',#xlim=c(0,42), > > > PI='lines',type='n',PI.identify.outliers=FALSE,#by='STRT', > > PI.x.median=TRUE, > > PI.ci.area.smooth=TRUE, > > PI.rug=FALSE, > > PI.ci.up.arcol="dodgerblue", > > PI.ci.down.arcol="dodgerblue", > > PI.real.med.col="brown", > > PI.real.up.col="brown", > > PI.real.down.col="brown",col="brown", > > main="VPC final model",ylb="Drug X > (ng/mL)",xlb="Time (h)",ylim=c(0.01,120),logy=TRUE, > > scales = list(x = list(at = seq(0,36,3)))) > > > > > > *Rik Schoemaker, PhD* > > *Occams *Coöperatie U.A. > Malandolaan 10 > 1187 HE Amstelveen > The Netherlands > > www.occams.com > > +31 20 441 6410 > [email protected] > > > > > -- *Mahmoud Tareq AbdelwahabPhD StudentPharmacometrics Research GroupDivision of Clinical PharmacologyDepartment of MedicineUniversity of Cape TownK45 Old Main BuildingGroote Schuur HospitalObservatory, Cape Town 7925, South Africa.* *Tel: +27 21 650 4861Email: [email protected] <[email protected]>*