Mercurial > repos > tomnl > create_msp
diff track_rt_raw.R @ 0:4b417094bf71 draft
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 0aa10df0ec1ed71601f932cfb11d7d4d4f620d80-dirty
author | tomnl |
---|---|
date | Wed, 02 May 2018 13:09:23 -0400 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/track_rt_raw.R Wed May 02 13:09:23 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') +}