Back to the Top
The following message was posted to: PharmPK
Hi,
Is there a script/code that i can run will do a diagnostic plot or open R and Xpose after nonmem run?
Thank you in advance
Kind Regards
Mouli
Back to the Top
The following message was posted to: PharmPK
Mouli,
Yes. Depends in the system that you are running. In Windows a batch script would be:
Rem Begin Batch script
.aaa.echo off
C:\nm7\util\nmfe7.bat run%1.mod run%1.lst
"c:\Program Files\R\R-2.11.0\bin\R.exe" CMD BATCH c:\script.R
Rem end batch script
%1 would be the run number.
C:\script.R is an R script that looks out output files and dates and then generates output for the run that has not been updated.
Matt.
Back to the Top
Hi Mouli,
One option you may want to investigate is using Phoenix's Connect module (free upgrade to WNL enterprise users) to initialise your NONMEM runs. If you do this then you will automatically get a whole raft of diagnostic plots generated after the run completes and you will also be able to easily compare runs with the "NONMEM comparer" object.
If you prefer to use R scripts for your post-processing that is also supported as are SAS, S-plus and sigmaplot. This webinar will explain a little more
http://pharsight.com/events/eventsonline_archive.php#replay_032
Best regards,
Simon.
--
Simon.Davis.at.certara.com
Senior Scientific Consultant
Pharsight- A Certara(TM) Company
Back to the Top
The following message was posted to: PharmPK
Dear Matt,
thanks for your mail i am running a batch script now, i am running this after i finish a run using nonmem, i would like to know if i can write a code to initiate this batch scrip on the ctl file?
Also could you please tell me where i should call the script from (the one you provided).
I have mine in my desktop once the run is completed ill call this scrip.
Thanks in advance
Back to the Top
if you are using Windows try the following Visual Basic Script:
'basic.gof.vbs
'create and init an instance of R on the local machine
' needs R/Scilab (D)COM Server V2.50 to be installed
' http://cran.r-project.org/contrib/extra/dcom/00ReadMe.html
set lServer = CreateObject("StatConnectorSrv.StatConnector")
lServer.Init "R"
'get path
path=left(wscript.scriptfullname,InstrRev(wscript.scriptfullname,"\")-1)
' load the xpose4 library
lServer.EvaluateNoReturn "library(xpose4)"
'get a path to the NONMEM run
path=replace(path,"\","/")
command="setwd(""" & path & """)"
lServer.EvaluateNoReturn command
lServer.EvaluateNoReturn "xpdb1<-xpose.data(1)"
lServer.EvaluateNoReturn "basic.gof(xpdb1)"
result=MsgBox("Weiter?",vbOKCancel)
If result<>vbOK Then
WScript.Quit
End If
lServer.EvaluateNoReturn "windows()"
lServer.EvaluateNoReturn "addit.gof(xpdb1)"
result=MsgBox("Weiter?",vbOKCancel)
If result<>vbOK Then
WScript.Quit
End If
lServer.EvaluateNoReturn "param.vs.cov(xpdb1)"
Good luck
Ingolf.
Dr. Ingolf Meineke
Dept. Clinical Pharmacology
University of Goettingen
Robert-Koch-Str. 40
D-37075 Goettingen
Back to the Top
The following message was posted to: PharmPK
Mouli,
I would call the script from the command line, like you call NONMEM. By starting the batch process, I believe R's working directory is the directory you call R from. Therefore
R CMD BATCH c:\tmp\script.R
In working directory c:\nmruns1\
Would give a working directory of c:\nmruns1.
With this R-script, you can get a list of all control streams with Sys.glob or Path.expand. From this you can test if a certain file was created, and then pass the control stream on from there, or check date/times for the files with file.info, and if there was a new run completed, attempt to run the diagnostic plots.
If you do not wish to code this yourself, other methods include:
- Using PLT tools - http://www.pltsoft.com/
-- Automatically runs a suite of diagnostic plots (not Xpose) and custom diagnostic plots from R.
- Using Emacs Speaks NONMEM - http://esnm.sourceforge.net
-- After submitting the job from emacs, runs a suite of diagnostic plots using Xpose. This list is customizable, and can be generated from pseudo-code in the control stream.
I believe that Pirana, Census, and PDX Pop also is capable of running R scripts on a run by a case-by-case basis. However, I'm not entirely familiar with all these pieces of software.
Matt.
Back to the Top
Mouli,
I personally use both census and pirana.
Census,- You can make your diagnostics plots run by run basis.
http://census.sourceforge.net/
Pirana can be used to start your nonmem executions and eventually make most of the plots requried for model diagnostics.
It is worth to note that both census and pirana are free.
http://pirana.sourceforge.net/faq.php
You may try PLT tools as well....Evaluation version is a good option, if you do not want to use multiple runs at a time (in different cores). However, i am not very familiar with its features.
Good Luck
Regards,
Martin
-- Regards,
J.Martin Gnanamuthu
Back to the Top
The following message was posted to: PharmPK
I recently saw a webinar presentation from someone at Accelrys on how
they used their Pipeline Pilot tool to automate the scanning of output
folders from NonMem runs and then running R scripts to generate plots
and tables all through a web portal. It seemed very slick.
http://accelrys.com/events/webinars/european-webinar-series/pkpd-request.php
Regards,
Paul.
--
Paul Hurley
Want to post a follow-up message on this topic?
If this link does not work with your browser send a follow-up message to PharmPK@boomer.org with "Running R after a Nonmem run" as the subject | Support PharmPK by using the |
Copyright 1995-2011 David W. A. Bourne (david@boomer.org)