Welcome Bienvenue Bienvenidos - LAPK · © Laboratory of Applied Pharmacokinetics and...
Transcript of Welcome Bienvenue Bienvenidos - LAPK · © Laboratory of Applied Pharmacokinetics and...
© Laboratory of Applied Pharmacokinetics and Bioinformatics
ITAG 4Individualized Therapeutic Approach Group
Welcome Bienvenue
Bienvenidos
Review of Pre-Workshop Exercise
© Laboratory of Applied Pharmacokinetics and Bioinformatics
Key concepts
• library() loads installed R packages into memory so that the commands are available for use in the current session, e.g. library(Pmetrics)
• setwd() changes the working directory, so that R knows where your files are, e.g. setwd(“C:/Pmetrics”). Note that forward slashes “/“ separate folders, even in Windows.
© Laboratory of Applied Pharmacokinetics and Bioinformatics
Default Rstudio WD
Windows: Tools -> Options Mac: Rstudio -> Preferences
© Laboratory of Applied Pharmacokinetics and Bioinformatics
Key concepts
• getwd() returns the current working directory, e.g.
getwd() [1] "/Users/Neely/Pmetrics"
© Laboratory of Applied Pharmacokinetics and Bioinformatics
PMtree
• PMtree() sets up a new Pmetrics project in the current working directory
• The name of the project will be the same as the argument to PMtree(), e.g. PMtree(“Cefepime”)
© Laboratory of Applied Pharmacokinetics and Bioinformatics
PMtree
• PMtree() creates 4 sub-folders
• /Rscript contains a skeleton script
• /Runs is the folder for all Pmetrics runs
• /Sim is a folder for simulations
• /src is a folder to contain source data documents
© Laboratory of Applied Pharmacokinetics and Bioinformatics
ITAG project
© Laboratory of Applied Pharmacokinetics and Bioinformatics
Copy files to /Runs
© Laboratory of Applied Pharmacokinetics and Bioinformatics
Open ITAG4.R
or use File -> New in Rstudio to make a new script.
© Laboratory of Applied Pharmacokinetics and Bioinformatics
R Script
© Laboratory of Applied Pharmacokinetics and Bioinformatics
The Rstudio IDE
© Laboratory of Applied Pharmacokinetics and Bioinformatics
The Rstudio IDE
Scripting
Console
Files Plots
Packages Help
Environment History
© Laboratory of Applied Pharmacokinetics and Bioinformatics
Updated Script
© Laboratory of Applied Pharmacokinetics and Bioinformatics
Executing scripts
Keyboard shortcuts equivalent to clicking “Run” Windows: CTRL-Return Mac: Command-Return
Also see http://www.lapk.org/Video_tutorials/R_console_script.php.
© Laboratory of Applied Pharmacokinetics and Bioinformatics
NPrun
• NPrun() executes a Non-Parametric (NPAG) run
• At minimum, you must supply the model and data file names
• There are other arguments which modify the run behavior; use ?NPrun in R to get help
© Laboratory of Applied Pharmacokinetics and Bioinformatics
Pre-flight check
Model file and data file are copied to /Runs folder
Working directory in R is set to /Runs folder with setwd()
NPrun() command properly entered
© Laboratory of Applied Pharmacokinetics and Bioinformatics
Lift off!
© Laboratory of Applied Pharmacokinetics and Bioinformatics
Mac
© Laboratory of Applied Pharmacokinetics and Bioinformatics
Windows
© Laboratory of Applied Pharmacokinetics and Bioinformatics
After a run
© Laboratory of Applied Pharmacokinetics and Bioinformatics
Obs-Pred
© Laboratory of Applied Pharmacokinetics and Bioinformatics
Convergence
© Laboratory of Applied Pharmacokinetics and Bioinformatics
Marginals
© Laboratory of Applied Pharmacokinetics and Bioinformatics
Parameter values
© Laboratory of Applied Pharmacokinetics and Bioinformatics
Run summary
Hint: The red asterisk tells you the run did not converge.