Mercurial > repos > recetox > ramclustr_csv
diff ramclustr_wrapper.R @ 0:43b60b28ccf7 draft
"planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 12025c9247a7bd1afc327134623c6ae3e048fca8"
author | recetox |
---|---|
date | Mon, 07 Dec 2020 22:14:48 +0000 |
parents | |
children | d9c9ec0e2bd8 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ramclustr_wrapper.R Mon Dec 07 22:14:48 2020 +0000 @@ -0,0 +1,113 @@ +store_output <- function( + ramclustr_obj, + output_filename, + output_method_metadata, + output_merge_msp, + output_spec_abundance) { + save(ramclustr_obj, file = output_filename) + RAMClustR::write.methods(ramclustr_obj, output_method_metadata) + RAMClustR::write.msp(ramclustr_obj, one.file = output_merge_msp) + write.csv(ramclustr_obj$SpecAbund, file = output_spec_abundance, row.names = TRUE) +} + +ramclustr_xcms <- function( + input_xcms, + sr, + deep_split, + block_size, + mult, + hmax, + collapse, + use_pheno, + qc_inj_range, + normalize, + min_module_size, + linkage, + mzdec, + cor_method, + rt_only_low_n, + replace_zeros, + st = NULL, + maxt = NULL, + fftempdir = NULL +) { + obj <- load(input_xcms) + + x <- RAMClustR::ramclustR( + xcmsObj = xdata, + st = st, + maxt = maxt, + sr = sr, + deepSplit = deep_split, + blocksize = block_size, + mult = mult, + hmax = hmax, + collapse = collapse, + usePheno = use_pheno, + mspout = FALSE, + qc.inj.range = qc_inj_range, + normalize = normalize, + minModuleSize = min_module_size, + linkage = linkage, + mzdec = mzdec, + cor.method = cor_method, + rt.only.low.n = rt_only_low_n, + fftempdir = fftempdir, + replace.zeros = replace_zeros + ) + return(x) +} + +ramclustr_csv <- function( + ms, + idmsms, + sample_name_column, + feature_delimiter, + retention_time_column, + sr, + deep_split, + block_size, + mult, + hmax, + collapse, + use_pheno, + qc_inj_range, + normalize, + min_module_size, + linkage, + mzdec, + cor_method, + rt_only_low_n, + replace_zeros, + st = NULL, + maxt = NULL, + fftempdir = NULL +) { + x <- RAMClustR::ramclustR( + ms = ms, + idmsms = idmsms, + featdelim = feature_delimiter, + timepos = retention_time_column, + sampNameCol = sample_name_column, + st = st, + maxt = maxt, + sr = sr, + deepSplit = deep_split, + blocksize = block_size, + mult = mult, + hmax = hmax, + collapse = collapse, + usePheno = use_pheno, + mspout = FALSE, + qc.inj.range = qc_inj_range, + normalize = normalize, + minModuleSize = min_module_size, + linkage = linkage, + mzdec = mzdec, + cor.method = cor_method, + rt.only.low.n = rt_only_low_n, + fftempdir = fftempdir, + replace.zeros = replace_zeros + ) + return(x) +}