# HG changeset patch # User cs76 # Date 1449486353 18000 # Node ID c403de9adce740b22ef2ead08ea7ce900f5995a9 # Parent 5cd5308cc3981eae2aa17d4cc60a322f6b6438f8 Uploaded diff -r 5cd5308cc398 -r c403de9adce7 ipo.R --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ipo.R Mon Dec 07 06:05:53 2015 -0500 @@ -0,0 +1,53 @@ +args<-commandArgs(TRUE) + +workingDirectory<-args[3] +logFile<-paste(workingDirectory,'/run.log', sep='') +graphsDirectory<-paste(workingDirectory,'/graphs', sep='') +outputCSV<-paste(workingDirectory,'/IPO_PP.csv', sep='') + +dir.create(workingDirectory) +zz <- file(logFile, open="wt") +sink(zz) +sink(zz, type="message") + +library("xtable") +library(IPO) +#print(args) + +peakpickingParameters <- getDefaultXcmsSetStartingParams('centWave') +#setting levels for min_peakwidth to 10 and 20 (hence 15 is the center point) +peakpickingParameters$min_peakwidth <- c(10,20) +peakpickingParameters$max_peakwidth <- c(26,42) +#setting only one value for ppm therefore this parameter is not optimized +peakpickingParameters$ppm <- 20 +peakpickingParameters$nSlaves <- 4 # as.numeric(args[3]) +type <- "centWave" + +resultPP <- optimizeXcmsSet(files=args[1], params=peakpickingParameters, nSlaves=4, subdir=graphsDirectory) + +print (resultPP) + +graphs<-"" +for(i in 1:(length(resultPP)-1)) +{ + graphs<-paste(graphs,"
",sep='') +} + +list <- c(resultPP$best_settings$parameters, as.list(resultPP$best_settings$result), list(type=type)) +table <- print(xtable(t(data.frame(list))), type = "html") +write.csv(c(resultPP$best_settings$parameters, as.list(resultPP$best_settings$result), list(type=type)),file=outputCSV) + +html<-paste(' + + + + + +

IPO optimization - Output


',table,'
Output
Job log
',graphs,'
', sep='') + +fileConn<-file(args[2]) +writeLines(html, fileConn) +close(fileConn) + +sink(type = "message") +sink() \ No newline at end of file