Mercurial > repos > tomnl > flag_remove_peaks
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 11:e00a33906b3e | 12:cb8dce9812ff |
|---|---|
| 1 library(optparse) | |
| 2 | |
| 3 print(sessionInfo()) | |
| 4 | |
| 5 option_list <- list( | |
| 6 make_option(c("--xset_path"), type="character"), | |
| 7 make_option(c("-o", "--out_dir"), type="character"), | |
| 8 make_option(c("--extract_peaks"), action="store_true") | |
| 9 ) | |
| 10 | |
| 11 # store options | |
| 12 opt<- parse_args(OptionParser(option_list=option_list)) | |
| 13 | |
| 14 load(opt$xset_path) | |
| 15 | |
| 16 print(xset) | |
| 17 | |
| 18 rtraw <- xset@peaks[,c('rt', 'rtmin', 'rtmax')] | |
| 19 colnames(rtraw) <- c('rt_raw','rtmin_raw','rtmax_raw') | |
| 20 xset@peaks <- cbind(xset@peaks, rtraw) | |
| 21 | |
| 22 | |
| 23 print('saving RData') | |
| 24 save.image(file.path(opt$out_dir, 'xset_rt_raw_tracked.RData')) | |
| 25 | |
| 26 if(!is.null(opt$extract_peaks)){ | |
| 27 write.table(xset@peaks, file.path(opt$out_dir, 'xset_peaks.tsv'), row.names=FALSE, sep='\t') | |
| 28 } |
