Mercurial > repos > tomnl > flag_remove_peaks
diff track_rt_raw.R @ 12:cb8dce9812ff draft
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f79fa34772bbab836d89cf8bad52d49285409a98
| author | tomnl |
|---|---|
| date | Thu, 14 Jun 2018 09:19:47 -0400 |
| parents | |
| children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/track_rt_raw.R Thu Jun 14 09:19:47 2018 -0400 @@ -0,0 +1,28 @@ +library(optparse) + +print(sessionInfo()) + +option_list <- list( + make_option(c("--xset_path"), type="character"), + make_option(c("-o", "--out_dir"), type="character"), + make_option(c("--extract_peaks"), action="store_true") +) + +# store options +opt<- parse_args(OptionParser(option_list=option_list)) + +load(opt$xset_path) + +print(xset) + +rtraw <- xset@peaks[,c('rt', 'rtmin', 'rtmax')] +colnames(rtraw) <- c('rt_raw','rtmin_raw','rtmax_raw') +xset@peaks <- cbind(xset@peaks, rtraw) + + +print('saving RData') +save.image(file.path(opt$out_dir, 'xset_rt_raw_tracked.RData')) + +if(!is.null(opt$extract_peaks)){ + write.table(xset@peaks, file.path(opt$out_dir, 'xset_peaks.tsv'), row.names=FALSE, sep='\t') +}
