annotate flagRemove.R @ 8:a46824d13914 draft

planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
author computational-metabolomics
date Wed, 12 Jun 2024 16:09:13 +0000
parents cc0f8ddad4a8
children a8842e5e75a7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
1 library(msPurity)
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
2 library(optparse)
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
3 print(sessionInfo())
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
4 option_list <- list(
8
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
5 make_option(c("-o", "--out_dir"),
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
6 type = "character", default = getwd(),
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
7 help = "Output folder for resulting files [default = %default]"
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
8 ),
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
9 make_option(c("-x", "--xset_path"),
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
10 type = "character", default = file.path(getwd(), "xset.rds"),
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
11 help = "The path to the xcmsSet object [default = %default]"
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
12 ),
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
13 make_option("--polarity",
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
14 default = NA,
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
15 help = "polarity (just used for naming purpose for files being saved) [positive, negative, NA] [default %default]"
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
16 ),
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
17 make_option("--rsd_i_blank",
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
18 default = 100,
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
19 help = "RSD threshold for the blank [default = %default]"
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
20 ),
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
21 make_option("--minfrac_blank",
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
22 default = 0.5,
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
23 help = "minimum fraction of files for features needed for the blank [default = %default]"
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
24 ),
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
25 make_option("--rsd_rt_blank",
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
26 default = 100,
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
27 help = "RSD threshold for the RT of the blank [default = %default]"
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
28 ),
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
29 make_option("--ithres_blank",
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
30 default = 0,
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
31 help = "Intensity threshold for the blank [default = %default]"
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
32 ),
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
33 make_option("--s2b",
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
34 default = 10,
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
35 help = "fold change (sample/blank) needed for sample peak to be allowed. e.g.
0
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
36 if s2b set to 10 and the recorded sample 'intensity' value was 100 and blank was 10.
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
37 1000/10 = 100, so sample has fold change higher than the threshold and the peak
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
38 is not considered a blank [default = %default]"
8
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
39 ),
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
40 make_option("--blank_class",
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
41 default = "blank", type = "character",
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
42 help = "A string representing the class that will be used for the blank.[default = %default]"
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
43 ),
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
44 make_option("--egauss_thr",
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
45 default = NA,
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
46 help = "Threshold for filtering out non gaussian shaped peaks. Note this only works
0
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
47 if the 'verbose columns' and 'fit gauss' was used with xcms
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
48 [default = %default]"
8
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
49 ),
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
50 make_option("--rsd_i_sample",
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
51 default = 100,
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
52 help = "RSD threshold for the samples [default = %default]"
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
53 ),
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
54 make_option("--minfrac_sample",
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
55 default = 0.8,
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
56 help = "minimum fraction of files for features needed for the samples [default = %default]"
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
57 ),
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
58 make_option("--rsd_rt_sample",
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
59 default = 100,
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
60 help = "RSD threshold for the RT of the samples [default = %default]"
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
61 ),
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
62 make_option("--ithres_sample",
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
63 default = 5000,
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
64 help = "Intensity threshold for the sample [default = %default]"
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
65 ),
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
66 make_option("--grp_rm_ids",
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
67 default = NA,
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
68 help = "vector of grouped_xcms peaks to remove (corresponds to the row from xcms::group output)
0
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
69 [default = %default]"
8
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
70 ),
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
71 make_option("--remove_spectra",
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
72 action = "store_true",
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
73 help = "TRUE if flagged spectra is to be removed [default = %default]"
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
74 ),
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
75 make_option("--minfrac_xcms",
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
76 default = 0.5,
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
77 help = "minfrac for xcms grouping [default = %default]"
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
78 ),
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
79 make_option("--mzwid",
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
80 default = 0.001,
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
81 help = "mzwid for xcms grouping [default = %default]"
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
82 ),
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
83 make_option("--bw",
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
84 default = 5,
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
85 help = "bw for xcms grouping [default = %default]"
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
86 ),
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
87 make_option("--temp_save",
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
88 action = "store_true",
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
89 help = "Assign True if files for each step saved (for testing purposes) [default = %default]"
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
90 ),
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
91 make_option("--samplelist", type = "character", help = "Sample list to determine the blank class")
0
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
92 )
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
93
6
cc0f8ddad4a8 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 1
diff changeset
94 # nolint start
cc0f8ddad4a8 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 1
diff changeset
95 # make_option("--multilist", action="store_true"
cc0f8ddad4a8 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 1
diff changeset
96 # help="NOT CURRENTLY IMPLEMENTED: If paired blank removal is to be performed a - multilist - sample list file has to be provided"
cc0f8ddad4a8 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 1
diff changeset
97 # ),
cc0f8ddad4a8 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 1
diff changeset
98 # nolint end
0
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
99
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
100 # store options
6
cc0f8ddad4a8 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 1
diff changeset
101 opt <- parse_args(OptionParser(option_list = option_list))
0
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
102
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
103 opt <- replace(opt, opt == "NA", NA)
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
104
6
cc0f8ddad4a8 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 1
diff changeset
105 if (is.null(opt$temp_save)) {
cc0f8ddad4a8 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 1
diff changeset
106 temp_save <- FALSE
8
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
107 } else {
6
cc0f8ddad4a8 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 1
diff changeset
108 temp_save <- TRUE
0
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
109 }
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
110
6
cc0f8ddad4a8 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 1
diff changeset
111 if (is.null(opt$remove_spectra)) {
cc0f8ddad4a8 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 1
diff changeset
112 remove_spectra <- FALSE
8
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
113 } else {
6
cc0f8ddad4a8 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 1
diff changeset
114 remove_spectra <- TRUE
0
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
115 }
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
116
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
117
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
118 print(opt)
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
119
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
120 getxcmsSetObject <- function(xobject) {
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
121 # XCMS 1.x
8
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
122 if (class(xobject) == "xcmsSet") {
6
cc0f8ddad4a8 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 1
diff changeset
123 return(xobject)
8
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
124 }
0
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
125 # XCMS 3.x
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
126 if (class(xobject) == "XCMSnExp") {
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
127 # Get the legacy xcmsSet object
6
cc0f8ddad4a8 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 1
diff changeset
128 suppressWarnings(xset <- as(xobject, "xcmsSet"))
cc0f8ddad4a8 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 1
diff changeset
129 xcms::sampclass(xset) <- xset@phenoData$sample_group
cc0f8ddad4a8 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 1
diff changeset
130 return(xset)
0
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
131 }
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
132 }
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
133
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
134
6
cc0f8ddad4a8 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 1
diff changeset
135 loadRData <- function(rdata_path, name) {
8
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
136 # loads an RData file, and returns the named xset object if it is there
0
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
137 load(rdata_path)
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
138 return(get(ls()[ls() %in% name]))
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
139 }
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
140
6
cc0f8ddad4a8 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 1
diff changeset
141 xset <- getxcmsSetObject(loadRData(opt$xset_path, c("xset", "xdata")))
0
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
142
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
143 print(xset)
6
cc0f8ddad4a8 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 1
diff changeset
144 if (is.null(opt$samplelist)) {
0
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
145 blank_class <- opt$blank_class
8
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
146 } else {
6
cc0f8ddad4a8 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 1
diff changeset
147 samplelist <- read.table(opt$samplelist, sep = "\t", header = TRUE)
cc0f8ddad4a8 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 1
diff changeset
148 samplelist_blank <- unique(samplelist$sample_class[samplelist$blank == "yes"])
0
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
149
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
150 chosen_blank <- samplelist_blank[samplelist_blank %in% xset@phenoData$class]
6
cc0f8ddad4a8 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 1
diff changeset
151 if (length(chosen_blank) > 1) {
cc0f8ddad4a8 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 1
diff changeset
152 print("ERROR: only 1 blank is currently allowed to be used with this tool")
1
1e6b7c4d99cd "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 20d432cdc6326114d05c26fd51889b872513b57d"
computational-metabolomics
parents: 0
diff changeset
153 quit()
0
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
154 }
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
155 blank_class <- as.character(chosen_blank)
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
156 print(blank_class)
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
157 }
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
158
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
159
6
cc0f8ddad4a8 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 1
diff changeset
160 if (is.null(opt$multilist)) {
0
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
161 ffrm_out <- flag_remove(xset,
8
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
162 pol = opt$polarity,
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
163 rsd_i_blank = opt$rsd_i_blank,
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
164 minfrac_blank = opt$minfrac_blank,
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
165 rsd_rt_blank = opt$rsd_rt_blank,
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
166 ithres_blank = opt$ithres_blank,
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
167 s2b = opt$s2b,
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
168 ref.class = blank_class,
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
169 egauss_thr = opt$egauss_thr,
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
170 rsd_i_sample = opt$rsd_i_sample,
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
171 minfrac_sample = opt$minfrac_sample,
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
172 rsd_rt_sample = opt$rsd_rt_sample,
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
173 ithres_sample = opt$ithres_sample,
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
174 minfrac_xcms = opt$minfrac_xcms,
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
175 mzwid = opt$mzwid,
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
176 bw = opt$bw,
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
177 out_dir = opt$out_dir,
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
178 temp_save = temp_save,
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
179 remove_spectra = remove_spectra,
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
180 grp_rm_ids = unlist(strsplit(as.character(opt$grp_rm_ids), split = ", "))[[1]]
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
181 )
6
cc0f8ddad4a8 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 1
diff changeset
182 print("flag remove finished")
0
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
183 xset <- ffrm_out[[1]]
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
184 grp_peaklist <- ffrm_out[[2]]
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
185 removed_peaks <- ffrm_out[[3]]
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
186
6
cc0f8ddad4a8 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 1
diff changeset
187 save.image(file = file.path(opt$out_dir, "xset_filtered.RData"), version = 2)
0
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
188
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
189 # grpid needed for mspurity ID needed for deconrank... (will clean up at some up)
6
cc0f8ddad4a8 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 1
diff changeset
190 peak_pth <- file.path(opt$out_dir, "peaklist_filtered.tsv")
0
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
191 print(peak_pth)
6
cc0f8ddad4a8 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 1
diff changeset
192 write.table(data.frame("grpid" = rownames(grp_peaklist), "ID" = rownames(grp_peaklist), grp_peaklist),
8
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
193 peak_pth,
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
194 row.names = FALSE, sep = "\t"
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
195 )
0
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
196
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
197 removed_peaks <- data.frame(removed_peaks)
6
cc0f8ddad4a8 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 1
diff changeset
198 write.table(data.frame("ID" = rownames(removed_peaks), removed_peaks),
8
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
199 file.path(opt$out_dir, "removed_peaks.tsv"),
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
200 row.names = FALSE, sep = "\t"
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
201 )
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
202 } else {
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
203 # nolint start
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
204 # TODO
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
205 # xsets <- split(xset, multilist_df$multlist)
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
206 #
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
207 # mult_grps <- unique(multilist_df$multlist)
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
208 #
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
209 # for (mgrp in mult_grps){
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
210 # xset_i <- xsets[mgrp]
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
211 # xcms::group(xset_i,
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
212 #
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
213 # }
a46824d13914 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
computational-metabolomics
parents: 6
diff changeset
214 # nolint end
0
96af79da0cc6 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
215 }