annotate ramclustr_wrapper.R @ 3:2ec9253a647e draft

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