annotate track_rt_raw.R @ 22:c8b34df46dae draft

planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 04023134d8f28e85927ca293373c506484149ead-dirty
author tomnl
date Fri, 01 Jun 2018 13:41:15 -0400
parents fd6f8eecdec9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
1 library(optparse)
5
fd6f8eecdec9 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 9ea2ca0892fa55c21491c93afba790e8d9427e01-dirty
tomnl
parents: 2
diff changeset
2
2
b83bcc259b76 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2e847122cf605951c334858455fc1d3ebdb189e9-dirty
tomnl
parents: 1
diff changeset
3 print(sessionInfo())
b83bcc259b76 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2e847122cf605951c334858455fc1d3ebdb189e9-dirty
tomnl
parents: 1
diff changeset
4
0
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
5 option_list <- list(
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
6 make_option(c("--xset_path"), type="character"),
5
fd6f8eecdec9 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 9ea2ca0892fa55c21491c93afba790e8d9427e01-dirty
tomnl
parents: 2
diff changeset
7 make_option(c("-o", "--out_dir"), type="character"),
fd6f8eecdec9 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 9ea2ca0892fa55c21491c93afba790e8d9427e01-dirty
tomnl
parents: 2
diff changeset
8 make_option(c("--extract_peaks"), action="store_true")
0
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
9 )
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
10
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
11 # store options
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
12 opt<- parse_args(OptionParser(option_list=option_list))
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
13
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
14 load(opt$xset_path)
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
15
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
16 print(xset)
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
17
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
18 rtraw <- xset@peaks[,c('rt', 'rtmin', 'rtmax')]
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
19 colnames(rtraw) <- c('rt_raw','rtmin_raw','rtmax_raw')
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
20 xset@peaks <- cbind(xset@peaks, rtraw)
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
21
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
22
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
23 print('saving RData')
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
24 save.image(file.path(opt$out_dir, 'xset_rt_raw_tracked.RData'))
5
fd6f8eecdec9 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 9ea2ca0892fa55c21491c93afba790e8d9427e01-dirty
tomnl
parents: 2
diff changeset
25
fd6f8eecdec9 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 9ea2ca0892fa55c21491c93afba790e8d9427e01-dirty
tomnl
parents: 2
diff changeset
26 if(!is.null(opt$extract_peaks)){
fd6f8eecdec9 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 9ea2ca0892fa55c21491c93afba790e8d9427e01-dirty
tomnl
parents: 2
diff changeset
27 write.table(xset@peaks, file.path(opt$out_dir, 'xset_peaks.tsv'), row.names=FALSE, sep='\t')
fd6f8eecdec9 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 9ea2ca0892fa55c21491c93afba790e8d9427e01-dirty
tomnl
parents: 2
diff changeset
28 }