This section contains step-by-step instructions for creating and executing a variety of third party tool projects.
Completed projects for these examples are available for reference in …\Examples\PsN. You can save a copy of the Examples directory (installed with Phoenix) to your Phoenix project directory via the Project Settings in the Phoenix Preferences dialog.
Note:All of these examples assume that the path to the psn.conf file has already been specified in Phoenix. (Select Edit > Preferences > PsN and enter/browse to the psn.conf file.)
If all of the appropriate paths are set in this file (perl.exe, PsN utilities, R), Phoenix will populate the appropriate paths in this dialog. The available NONMEM configurations from psn.conf will be displayed for selection in the Options tab in the -nm_version pull-down.
PsN Shell object setup and execution example
Note:The completed project (Ex01_PsN_Execute.phxproj) is available for reference in …\Examples\PsN.
Set up the project and data
Create a new project named Ex01_PsN_Execute.
Import THEOPP.dat from …\Examples\PsN\Example1.
In the File Import Wizard dialog, click Finish.
Import the PsN control file psn.ctl from …\Examples\PsN\Example1.
The file is added to the project’s Code folder.
Set up the PsN Shell object
Select a workflow in the Object Browser and then select Insert > PsN > PsN Shell.
In the Options tab, click the Select Sources from Phoenix Project button.
In the Select Sources dialog, expand the Code folder, check the box for psn, and then click OK to specify the input model.
In the Options tab, click Select Sources (just below Additional Inputs).
In the Select Sources dialog, expand the Data folder, check the box for theopp, and then click OK
A new item appears in the Object list: theopp.
Specify the root working directory by typing the path to the desired folder in the Root Working Directory field or use the Browse button to locate the folder on the file system for which you have write permissions.
This is where PsN will create run directories for each command executed (i.e., execute, bootstrap, etc.).
PsN Options tab with root directory defined
Execute the PsN Shell object
Click the Execute tab and build a command with the available command line options.
Make sure the psn checkbox is checked in the model list.
Check the -verbose checkbox.
Click Add to Commands List when finished building the command.
PsN Execute tab with command line entered
Click . The results are displayed on the Results tab.
This concludes the PsN Shell object setup and execution example. You may save the project, if you wish, or simply close it.
Using shortcuts with the PsN Shell object
Note:The completed project (Ex02_PsN_ExecuteWithShortcut.phxproj) is available for reference in …\Examples\PsN.
The example control file is set up to look for the dataset source in C:\temp, so do either of the following:
Copy the THEOPP file from the …\Examples\PsN\ExampleWithShortcut folder to C:\temp.
Or
Edit the model_file_with_shortcut.ctl file if another location is desired.
Set up the project and data
Create a new project named Ex02_PsN_ExecuteWithShortcut.
Select a workflow in the Object Browser and then select Insert > PsN > PsN Shell.
In the Options tab, click the Bring Model Files in as Shortcuts button.
Click the Browse to Directory Containing Model Files button and navigate to and select the C:\temp, then click OK.
A link to the model_file_with_shortcut.ctl control file is added to the Shortcuts folder in the Phoenix project. A new item also appears in the Object list: model_file_with_shortcut.
Specify the root working directory, if one has not been specified already via the Preferences dialog, by typing in the path to the desired folder in the Root Working Directory field or use the Browse button to locate the folder on the file system for which you have write permissions.
PsN Options tab with root working directory defined
Execute the PsN Shell object
Click the Execute tab and build a command with the available command line options.
Make sure the psn checkbox is checked in the model list.
Check the -verbose checkbox.
Click Add to Commands List when finished building the command.
PsN Execute tab with command line entered
Click . The results are displayed on the Results tab.
This concludes the “Using shortcuts with the PsN Shell object” example. You may save the project, if you wish, or simply close it.
Using PsN Shell and R Script objects to generate GOF and individual plots
This example involves the Xpose package for R. Make sure that this package is installed for R (http://xpose.sourceforge.net/docs_install.php).
The Xpose package uses the following tables (* is the run number):
sdtab* file (i.e., standard table file): This file contains columns such as ID, DV, PRED, IPRED, WRES, IWRES, RES, IRES, etc.
patab* file: This is a parameter table containing model parameters: THETAs, ETAs and EPSes. The correspondences between ETA and THETA can be defined within Xpose. EPS is optional in this table, it is mainly used to generate the parameter vs parameter plots and parameters vs covariates plots.
catab* Categorical covariates, e.g. SEX, RACE
cotab* Continuous covariates, e.g. WT, AGE
extra*, mutab*, mytab*, xptab*: Other variables that might be needed by Xpose (Xpose 4 and above can postulate all the other values from one table (mytab1), but it is always safer to have these plots).
cwtab*: The cwtab file is generated by Xpose. In NONMEM 7, the calculation of CWRES is built in.
run*.mod: Model specification file
run*.lst: NONMEM output
Note:The completed project (EX03_PsN_Xpose_GOF.phxproj) is available for reference in …\Examples\PsN.
Set up the project and data
Create a new project named Ex03_PsN_Xpose_GOF.
Import the PsN control file nm_final.ctl from …\Examples\PsN\Xpose_GOF_IND.
The file is added to the project’s Code folder.
Import the dataset file example.csv from …\Examples\PsN\Xpose_GOF_IND.
In the File Import Wizard dialog, click Finish.
Set up the PsN Shell object
Select a workflow in the Object Browser and then select Insert > PsN > PsN Shell.
In the Options tab, click the Select Sources from Phoenix Project button.
In the Select Sources dialog, expand the Code folder, check the box for nm_final, and then click OK.
A new item appears in the Object list, nm_final, and a dataset input is now available to the PsN shell, based on the dataset name in the control file (“example.csv”).
In the Object list in the Setup tab, click EXAMPLE.CSV.
Drag the example worksheet from the Data folder to the Main Mappings.
Click and drag the data source to the Mappings panel
Specify the root working directory by typing the path to the desired folder in the Root Working Directory field or use the Browse button to locate the folder on the file system for which you have write permissions.
PsN Options tab with root working directory defined
Go to the Execute tab and build a command with the available command line options.
Make sure the psn checkbox is checked in the model list.
Check the -verbose checkbox.
Click Add to Commands List when finished building the command.
PsN Execute tab with command line entered
Click . The results are displayed on the Results tab.
Setting up the R Script object
Import the R command file Xpose_GOF_IND.R from …\Examples\PsN\Xpose_GOF_IND.
Right-click Xpose_GOF_IND in the Code folder and select Send To > R > R Script.
An R Script object is now in the workflow and has focus.
Click the Select Sources button on the Options and navigate to Workflow > PsN Shell > Text Output.
Check the boxes for catab1, cotab1, patab1, and sdtab1, then click OK.
Click to execute the R Script and observe the goodness-of-fit and individual plots generated by Xpose.
This concludes the “Using PsN Shell and R Script objects to generate GOF and individual plots” example. You may save the project, if you wish, or simply close it.
Using PsN Shell and R Script objects to generate VPC plots
This example involves the Xpose package for R. Make sure that this package is installed for R (http://xpose.sourceforge.net/docs_install.php).
See the beginning of “Using PsN Shell and R Script objects to generate VPC plots” for a list of supported Xpose files.
Note:The completed project (EX04_PsN_Xpose_VPC.phxproj) is available for reference in …\Examples\PsN.
Set up the project and data
Create a new project named Ex04_PsN_Xpose_VPC.
Import the PsN control file nm_final.ctl from …\Examples\PsN\Xpose_VPC.
Import the dataset file nonmem.csv from …\Examples\PsN\Xpose_VPC.
In the File Import Wizard dialog, click Finish.
Set up the PsN Shell object
Select a workflow in the Object Browser and then select Insert > PsN > PsN Shell.
In the Options tab, click Select Sources from Phoenix Project.
In the Select Sources dialog, expand the Code folder, check the box for nm_final, and then click OK.
In the Object list in the Setup tab, click NONMEM.CSV.
Use the mouse pointer to drag the nonmem worksheet from the Data folder to the Main Mappings.
Click and drag the data source to the mappings panel
Specify the root working directory by typing the path to the desired folder in the Root Working Directory field or use the Browse button to locate the folder on the file system for which you have write permissions.
PsN Options tab with root working directory defined
Go to the VPC tab and build a command with the available command line options.
Make sure the nm_final checkbox is checked in the model list.
Keep the -samples option set to 20.
Click Add to Commands List when finished building the command.
VPC tab with command line entered
Go to the Result Filters tab.
Type vpc_results.csv in the field and click Add.
Set the Import Format pull-down to Import as Binary.
Result Filters tab with format set to binary
Click . The results are displayed on the Results tab.
Set up the R Script object
Import the R command file Xpose_VPC.R from …\Examples\PsN\Xpose_VPC.
Right-click Xpose_VPC in the Code folder and select Send To > R > R Script.
Click the Select Sources button on the Options and navigate to Workflow > PsN Shell.
In the Text Output folder, check the box for vpctab.
In the Other folder, check the box for vpc_results, then click OK.
Click to execute the R Script object and observe the VPC plots generated by Xpose.
This concludes the “Using PsN Shell and R Script objects to generate VPC plots” example. You may save the project, if you wish, or simply close it.
Last modified date:6/26/19
Legal Notice | Contact Certara
© 2019 Certara USA, Inc. All rights reserved.