Mercurial > repos > tomnl > track_rt_raw
annotate track_rt_raw.R @ 27:682f25e2341a draft default tip
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 1800a3818988f21ef129e500818c9a087fce5875
| author | tomnl |
|---|---|
| date | Wed, 18 Jul 2018 06:11:13 -0400 |
| parents | a8d243fcf676 |
| children |
| rev | line source |
|---|---|
|
0
b96fc0da0a32
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff
changeset
|
1 library(optparse) |
|
4
a8d243fcf676
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 9ea2ca0892fa55c21491c93afba790e8d9427e01-dirty
tomnl
parents:
2
diff
changeset
|
2 |
|
2
26fd52ed6d21
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2e847122cf605951c334858455fc1d3ebdb189e9-dirty
tomnl
parents:
1
diff
changeset
|
3 print(sessionInfo()) |
|
26fd52ed6d21
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2e847122cf605951c334858455fc1d3ebdb189e9-dirty
tomnl
parents:
1
diff
changeset
|
4 |
|
0
b96fc0da0a32
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff
changeset
|
5 option_list <- list( |
|
b96fc0da0a32
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"), |
|
4
a8d243fcf676
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"), |
|
a8d243fcf676
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
b96fc0da0a32
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff
changeset
|
9 ) |
|
b96fc0da0a32
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff
changeset
|
10 |
|
b96fc0da0a32
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff
changeset
|
11 # store options |
|
b96fc0da0a32
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)) |
|
b96fc0da0a32
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff
changeset
|
13 |
|
b96fc0da0a32
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff
changeset
|
14 load(opt$xset_path) |
|
b96fc0da0a32
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff
changeset
|
15 |
|
b96fc0da0a32
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff
changeset
|
16 print(xset) |
|
b96fc0da0a32
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff
changeset
|
17 |
|
b96fc0da0a32
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')] |
|
b96fc0da0a32
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') |
|
b96fc0da0a32
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff
changeset
|
20 xset@peaks <- cbind(xset@peaks, rtraw) |
|
b96fc0da0a32
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff
changeset
|
21 |
|
b96fc0da0a32
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff
changeset
|
22 |
|
b96fc0da0a32
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff
changeset
|
23 print('saving RData') |
|
b96fc0da0a32
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')) |
|
4
a8d243fcf676
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 9ea2ca0892fa55c21491c93afba790e8d9427e01-dirty
tomnl
parents:
2
diff
changeset
|
25 |
|
a8d243fcf676
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)){ |
|
a8d243fcf676
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') |
|
a8d243fcf676
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 9ea2ca0892fa55c21491c93afba790e8d9427e01-dirty
tomnl
parents:
2
diff
changeset
|
28 } |
