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