annotate ramclustr_wrapper.R @ 4:69e0da4703b5 draft

"planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
author recetox
date Fri, 04 Feb 2022 08:31:26 +0000
parents cb0b83b330fd
children 10ded21d47c0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
1 store_output <- function(
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
2 ramclustr_obj,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
3 output_filename,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
4 output_method_metadata,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
5 output_merge_msp,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
6 output_spec_abundance) {
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
7 save(ramclustr_obj, file = output_filename)
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
8 RAMClustR::write.methods(ramclustr_obj, output_method_metadata)
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
9 RAMClustR::write.msp(ramclustr_obj, one.file = output_merge_msp)
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
10 write.csv(ramclustr_obj$SpecAbund, file = output_spec_abundance, row.names = TRUE)
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
11 }
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
12
4
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
13 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
14 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
15 return(experiment)
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
16 }
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
17
0
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
18 read_metadata <- function(filename) {
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
19 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
20
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
21 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
22 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
23 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
24 }
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
25 }
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 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
28 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
29 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
30 }
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
31 }
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 return(data)
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
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
36 ramclustr_xcms <- function(
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
37 input_xcms,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
38 sr,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
39 deep_split,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
40 block_size,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
41 mult,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
42 hmax,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
43 collapse,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
44 use_pheno,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
45 qc_inj_range,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
46 normalize,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
47 min_module_size,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
48 linkage,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
49 mzdec,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
50 cor_method,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
51 rt_only_low_n,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
52 replace_zeros,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
53 st = NULL,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
54 maxt = NULL,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
55 fftempdir = NULL,
4
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
56 metadata_file = NULL,
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
57 exp_design = NULL
0
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 obj <- load(input_xcms)
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
60
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
61 batch <- NULL
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
62 order <- NULL
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
63 qc <- NULL
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
64
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
65 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
66 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
67 batch <- metadata$batch
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
68 order <- metadata$order
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
69 qc <- metadata$qc
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
70 }
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
71
4
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
72 experiment <- NULL
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
73
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
74 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
75 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
76 }
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
77
0
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
78 x <- RAMClustR::ramclustR(
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
79 xcmsObj = xdata,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
80 st = st,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
81 maxt = maxt,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
82 sr = sr,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
83 deepSplit = deep_split,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
84 blocksize = block_size,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
85 mult = mult,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
86 hmax = hmax,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
87 collapse = collapse,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
88 usePheno = use_pheno,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
89 mspout = FALSE,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
90 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
91 normalize = normalize,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
92 minModuleSize = min_module_size,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
93 linkage = linkage,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
94 mzdec = mzdec,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
95 cor.method = cor_method,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
96 rt.only.low.n = rt_only_low_n,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
97 fftempdir = fftempdir,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
98 replace.zeros = replace_zeros,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
99 batch = batch,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
100 order = order,
4
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
101 qc = qc,
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
102 ExpDes = experiment
0
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
103 )
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
104 return(x)
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
105 }
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
106
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
107 ramclustr_csv <- function(
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
108 ms,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
109 idmsms,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
110 sample_name_column,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
111 feature_delimiter,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
112 retention_time_column,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
113 sr,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
114 deep_split,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
115 block_size,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
116 mult,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
117 hmax,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
118 collapse,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
119 use_pheno,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
120 qc_inj_range,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
121 normalize,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
122 min_module_size,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
123 linkage,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
124 mzdec,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
125 cor_method,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
126 rt_only_low_n,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
127 replace_zeros,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
128 st = NULL,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
129 maxt = NULL,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
130 fftempdir = NULL,
4
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
131 metadata_file = NULL,
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
132 exp_design = NULL
0
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
133 ) {
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
134 if (!file.exists(idmsms))
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
135 idmsms <- NULL
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 batch <- NULL
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
138 order <- NULL
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
139 qc <- NULL
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
140
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
141 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
142 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
143 batch <- metadata$batch
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
144 order <- metadata$order
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
145 qc <- metadata$qc
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
146 }
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
147
4
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
148 experiment <- NULL
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
149
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
150 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
151 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
152 }
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
153
0
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
154 x <- RAMClustR::ramclustR(
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
155 ms = ms,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
156 idmsms = idmsms,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
157 featdelim = feature_delimiter,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
158 timepos = retention_time_column,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
159 sampNameCol = sample_name_column,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
160 st = st,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
161 maxt = maxt,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
162 sr = sr,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
163 deepSplit = deep_split,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
164 blocksize = block_size,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
165 mult = mult,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
166 hmax = hmax,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
167 collapse = collapse,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
168 usePheno = use_pheno,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
169 mspout = FALSE,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
170 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
171 normalize = normalize,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
172 minModuleSize = min_module_size,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
173 linkage = linkage,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
174 mzdec = mzdec,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
175 cor.method = cor_method,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
176 rt.only.low.n = rt_only_low_n,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
177 fftempdir = fftempdir,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
178 replace.zeros = replace_zeros,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
179 batch = batch,
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
180 order = order,
4
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
181 qc = qc,
69e0da4703b5 "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit b514d9bf91b62bb06d39e6ceee21d8f18876e12b"
recetox
parents: 0
diff changeset
182 ExpDes = experiment
0
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
183 )
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
184 return(x)
cb0b83b330fd "planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit c69f8d9772bdb9fb3cc9473651397cd6bb877020"
recetox
parents:
diff changeset
185 }