comparison ramclustr_wrapper.R @ 0:43b60b28ccf7 draft

"planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 12025c9247a7bd1afc327134623c6ae3e048fca8"
author recetox
date Mon, 07 Dec 2020 22:14:48 +0000
parents
children d9c9ec0e2bd8
comparison
equal deleted inserted replaced
-1:000000000000 0:43b60b28ccf7
1 store_output <- function(
2 ramclustr_obj,
3 output_filename,
4 output_method_metadata,
5 output_merge_msp,
6 output_spec_abundance) {
7 save(ramclustr_obj, file = output_filename)
8 RAMClustR::write.methods(ramclustr_obj, output_method_metadata)
9 RAMClustR::write.msp(ramclustr_obj, one.file = output_merge_msp)
10 write.csv(ramclustr_obj$SpecAbund, file = output_spec_abundance, row.names = TRUE)
11 }
12
13 ramclustr_xcms <- function(
14 input_xcms,
15 sr,
16 deep_split,
17 block_size,
18 mult,
19 hmax,
20 collapse,
21 use_pheno,
22 qc_inj_range,
23 normalize,
24 min_module_size,
25 linkage,
26 mzdec,
27 cor_method,
28 rt_only_low_n,
29 replace_zeros,
30 st = NULL,
31 maxt = NULL,
32 fftempdir = NULL
33 ) {
34 obj <- load(input_xcms)
35
36 x <- RAMClustR::ramclustR(
37 xcmsObj = xdata,
38 st = st,
39 maxt = maxt,
40 sr = sr,
41 deepSplit = deep_split,
42 blocksize = block_size,
43 mult = mult,
44 hmax = hmax,
45 collapse = collapse,
46 usePheno = use_pheno,
47 mspout = FALSE,
48 qc.inj.range = qc_inj_range,
49 normalize = normalize,
50 minModuleSize = min_module_size,
51 linkage = linkage,
52 mzdec = mzdec,
53 cor.method = cor_method,
54 rt.only.low.n = rt_only_low_n,
55 fftempdir = fftempdir,
56 replace.zeros = replace_zeros
57 )
58 return(x)
59 }
60
61 ramclustr_csv <- function(
62 ms,
63 idmsms,
64 sample_name_column,
65 feature_delimiter,
66 retention_time_column,
67 sr,
68 deep_split,
69 block_size,
70 mult,
71 hmax,
72 collapse,
73 use_pheno,
74 qc_inj_range,
75 normalize,
76 min_module_size,
77 linkage,
78 mzdec,
79 cor_method,
80 rt_only_low_n,
81 replace_zeros,
82 st = NULL,
83 maxt = NULL,
84 fftempdir = NULL
85 ) {
86 x <- RAMClustR::ramclustR(
87 ms = ms,
88 idmsms = idmsms,
89 featdelim = feature_delimiter,
90 timepos = retention_time_column,
91 sampNameCol = sample_name_column,
92 st = st,
93 maxt = maxt,
94 sr = sr,
95 deepSplit = deep_split,
96 blocksize = block_size,
97 mult = mult,
98 hmax = hmax,
99 collapse = collapse,
100 usePheno = use_pheno,
101 mspout = FALSE,
102 qc.inj.range = qc_inj_range,
103 normalize = normalize,
104 minModuleSize = min_module_size,
105 linkage = linkage,
106 mzdec = mzdec,
107 cor.method = cor_method,
108 rt.only.low.n = rt_only_low_n,
109 fftempdir = fftempdir,
110 replace.zeros = replace_zeros
111 )
112 return(x)
113 }