annotate ramclustr_wrapper.R @ 9:308bd645da47 draft

planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
author recetox
date Tue, 20 Sep 2022 14:42:29 +0000
parents d9bcc43023c5
children 62bf6ef633d0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
1 store_output <- function(ramclustr_obj,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
2 output_merge_msp,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
3 output_spec_abundance,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
4 msp_file) {
0
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
5 RAMClustR::write.msp(ramclustr_obj, one.file = output_merge_msp)
9
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
6 write.csv(ramclustr_obj$SpecAbund, file = output_spec_abundance, row.names = TRUE, quote = FALSE)
5
10ded21d47c0 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 3d2821ffc97cc4f9287ee83bbddb306a8034daa0"
recetox
parents: 4
diff changeset
7
10ded21d47c0 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 3d2821ffc97cc4f9287ee83bbddb306a8034daa0"
recetox
parents: 4
diff changeset
8 if (!is.null(msp_file)) {
8
d9bcc43023c5 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c321421a07bfdcc9ed423e9ed2ee794157984ba1
recetox
parents: 5
diff changeset
9 exp_name <- ramclustr_obj$ExpDes[[1]][which(row.names(ramclustr_obj$ExpDes[[1]]) == "Experiment"), 1]
d9bcc43023c5 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c321421a07bfdcc9ed423e9ed2ee794157984ba1
recetox
parents: 5
diff changeset
10 filename <- paste("spectra/", exp_name, ".msp", sep = "")
5
10ded21d47c0 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 3d2821ffc97cc4f9287ee83bbddb306a8034daa0"
recetox
parents: 4
diff changeset
11 file.copy(from = filename, to = msp_file, overwrite = TRUE)
10ded21d47c0 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 3d2821ffc97cc4f9287ee83bbddb306a8034daa0"
recetox
parents: 4
diff changeset
12 }
0
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
13 }
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
14
4
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
15 load_experiment_definition <- function(filename) {
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
16 experiment <- RAMClustR::defineExperiment(csv = filename)
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
17 return(experiment)
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
18 }
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
19
0
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
20 read_metadata <- function(filename) {
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
21 data <- read.csv(filename, header = TRUE, stringsAsFactors = FALSE)
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
22
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
23 if (!"qc" %in% colnames(data)) {
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
24 if ("sampleType" %in% colnames(data)) {
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
25 data$qc <- ifelse(data$sampleType == "qc", TRUE, FALSE)
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
26 }
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
27 }
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
28
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
29 if (!"order" %in% colnames(data)) {
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
30 if ("injectionOrder" %in% colnames(data)) {
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
31 names(data)[names(data) == "injectionOrder"] <- "order"
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
32 }
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
33 }
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
34
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
35 return(data)
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
36 }
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
37
9
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
38 ramclustr_xcms <- function(input_xcms,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
39 use_pheno,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
40 sr,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
41 st = NULL,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
42 cor_method,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
43 maxt,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
44 linkage,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
45 min_module_size,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
46 hmax,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
47 deep_split,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
48 normalize,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
49 metadata_file = NULL,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
50 qc_inj_range,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
51 block_size,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
52 mult,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
53 mzdec,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
54 rt_only_low_n,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
55 replace_zeros,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
56 exp_design = NULL) {
0
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
57 obj <- load(input_xcms)
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
58
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
59 batch <- NULL
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
60 order <- NULL
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
61 qc <- NULL
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
62
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
63 if (!is.null(metadata_file)) {
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
64 metadata <- read_metadata(metadata_file)
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
65 batch <- metadata$batch
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
66 order <- metadata$order
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
67 qc <- metadata$qc
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
68 }
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
69
4
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
70 experiment <- NULL
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
71
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
72 if (!is.null(exp_design)) {
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
73 experiment <- load_experiment_definition(exp_design)
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
74 }
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
75
0
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
76 x <- RAMClustR::ramclustR(
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
77 xcmsObj = xdata,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
78 st = st,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
79 maxt = maxt,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
80 sr = sr,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
81 deepSplit = deep_split,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
82 blocksize = block_size,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
83 mult = mult,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
84 hmax = hmax,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
85 usePheno = use_pheno,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
86 mspout = FALSE,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
87 qc.inj.range = qc_inj_range,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
88 normalize = normalize,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
89 minModuleSize = min_module_size,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
90 linkage = linkage,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
91 mzdec = mzdec,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
92 cor.method = cor_method,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
93 rt.only.low.n = rt_only_low_n,
5
10ded21d47c0 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 3d2821ffc97cc4f9287ee83bbddb306a8034daa0"
recetox
parents: 4
diff changeset
94 fftempdir = NULL,
0
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
95 replace.zeros = replace_zeros,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
96 batch = batch,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
97 order = order,
4
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
98 qc = qc,
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
99 ExpDes = experiment
9
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
100 )
0
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
101 return(x)
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
102 }
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
103
9
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
104 ramclustr_csv <- function(ms,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
105 idmsms,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
106 sr,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
107 st,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
108 cor_method,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
109 maxt,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
110 linkage,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
111 min_module_size,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
112 hmax,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
113 deep_split,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
114 normalize,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
115 metadata_file = NULL,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
116 qc_inj_range,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
117 block_size,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
118 mult,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
119 mzdec,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
120 rt_only_low_n,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
121 replace_zeros,
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
122 exp_design = NULL) {
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
123 if (!file.exists(idmsms)) {
0
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
124 idmsms <- NULL
9
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
125 }
0
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
126
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
127 batch <- NULL
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
128 order <- NULL
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
129 qc <- NULL
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
130
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
131 if (!is.null(metadata_file)) {
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
132 metadata <- read_metadata(metadata_file)
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
133 batch <- metadata$batch
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
134 order <- metadata$order
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
135 qc <- metadata$qc
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
136 }
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
137
4
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
138 experiment <- NULL
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
139
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
140 if (!is.null(exp_design)) {
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
141 experiment <- load_experiment_definition(exp_design)
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
142 }
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
143
0
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
144 x <- RAMClustR::ramclustR(
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
145 ms = ms,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
146 idmsms = idmsms,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
147 st = st,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
148 maxt = maxt,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
149 sr = sr,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
150 deepSplit = deep_split,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
151 blocksize = block_size,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
152 mult = mult,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
153 hmax = hmax,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
154 mspout = FALSE,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
155 qc.inj.range = qc_inj_range,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
156 normalize = normalize,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
157 minModuleSize = min_module_size,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
158 linkage = linkage,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
159 mzdec = mzdec,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
160 cor.method = cor_method,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
161 rt.only.low.n = rt_only_low_n,
5
10ded21d47c0 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 3d2821ffc97cc4f9287ee83bbddb306a8034daa0"
recetox
parents: 4
diff changeset
162 fftempdir = NULL,
0
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
163 replace.zeros = replace_zeros,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
164 batch = batch,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
165 order = order,
4
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
166 qc = qc,
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
167 ExpDes = experiment
9
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
168 )
308bd645da47 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
recetox
parents: 8
diff changeset
169 return(x)
0
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
170 }