comparison w4mkmeans_wrapper.R @ 1:02cafb660b72 draft

planemo upload for repository https://github.com/HegemanLab/w4mkmeans_galaxy_wrapper/tree/master commit f600ce8a783df16e49272341dce0fc6bbc299b0a
author eschen42
date Wed, 09 Aug 2017 18:06:55 -0400
parents 6ccbe18131a6
children c415b7dc6f37
comparison
equal deleted inserted replaced
0:6ccbe18131a6 1:02cafb660b72
6 # - [stats::p.adjust](https://stat.ethz.ch/R-manual/R-devel/library/stats/html/p.adjust.html) 6 # - [stats::p.adjust](https://stat.ethz.ch/R-manual/R-devel/library/stats/html/p.adjust.html)
7 # how this does what it does: 7 # how this does what it does:
8 # - [parallel::clusterApply](https://stat.ethz.ch/R-manual/R-devel/library/parallel/html/clusterApply.html) 8 # - [parallel::clusterApply](https://stat.ethz.ch/R-manual/R-devel/library/parallel/html/clusterApply.html)
9 9
10 # invocation: 10 # invocation:
11 # Rscript $__tool_directory__/w4mkmeans_wrapper.R \ 11 # Rscript w4mkmeans_wrapper.R \
12 # tool_directory $__tool_directory__ 12 # algorithm "$algorithm" \
13 # data_matrix_path '$dataMatrix_in' \ 13 # categorical_prefix "$categorical_prefix" \
14 # variable_metadata_path '$variableMetadata_in' \ 14 # data_matrix_path "$dataMatrix_in" \
15 # sample_metadata_path '$sampleMetadata_in' \ 15 # iter_max "$iter_max" \
16 # kfeatures '$kfeatures' \ 16 # kfeatures "$kfeatures" \
17 # ksamples '$ksamples' \ 17 # ksamples "$ksamples" \
18 # iter_max '$iter_max' \ 18 # nstart "$nstart" \
19 # nstart '$nstart' \ 19 # sampleMetadata_out "$sampleMetadata_out" \
20 # algorithm '$algorithm' \ 20 # sample_metadata_path "$sampleMetadata_in" \
21 # scores '$scores' \ 21 # scores_out "$scores_out" \
22 # sampleMetadata_out '$sampleMetadata_out' \ 22 # slots "${GALAXY_SLOTS:-1}" \
23 # variableMetadata_out '$variableMetadata_out' \ 23 # variableMetadata_out "$variableMetadata_out" \
24 # slots "\${GALAXY_SLOTS:-1}" \ 24 # variable_metadata_path "$variableMetadata_in"
25 # 25 #
26 # <inputs> 26 # <inputs>
27 # <param name="dataMatrix_in" label="Data matrix file" type="data" format="tabular" help="variable x sample, decimal: '.', missing: NA, mode: numerical, separator: tab" /> 27 # <param name="dataMatrix_in" label="Data matrix file" type="data" format="tabular" help="variable x sample, decimal: '.', missing: NA, mode: numerical, separator: tab" />
28 # <param name="sampleMetadata_in" label="Sample metadata file" type="data" format="tabular" help="sample x metadata columns, separator: tab" /> 28 # <param name="sampleMetadata_in" label="Sample metadata file" type="data" format="tabular" help="sample x metadata columns, separator: tab" />
29 # <param name="variableMetadata_in" label="Variable metadata file" type="data" format="tabular" help="variable x metadata columns, separator: tab" /> 29 # <param name="variableMetadata_in" label="Variable metadata file" type="data" format="tabular" help="variable x metadata columns, separator: tab" />
30 # <param name="categoricalPrefix" label="prefix for cluster names " type="text" value="k" help="Some tools require non-numeric values to discern categorical; e.g., enter 'k' here to prepend 'k' to cluster numbers in the output; default 'k'." />
30 # <param name="kfeatures" label="K value(s) for features" type="text" value="0" help="Single or min,max value(s) for K for features (variables), or 0 for none." /> 31 # <param name="kfeatures" label="K value(s) for features" type="text" value="0" help="Single or min,max value(s) for K for features (variables), or 0 for none." />
31 # <param name="ksamples" label="K value(s) for samples" type="text" value="0" help="Single or min,max value(s) for K for samples, or 0 for none." /> 32 # <param name="ksamples" label="K value(s) for samples" type="text" value="0" help="Single or min,max value(s) for K for samples, or 0 for none." />
32 # <param name="iter_max" label="Max number of iterations" type="text" value="10" help="The maximum number of iterations allowed; default 10." /> 33 # <param name="iter_max" label="Max number of iterations" type="text" value="10" help="The maximum number of iterations allowed; default 10." />
33 # <param name="nstart" label="Number of random sets" type="text" value="1" help="How many random sets should be chosen; default 1." /> 34 # <param name="nstart" label="Number of random sets" type="text" value="1" help="How many random sets should be chosen; default 1." />
34 # <param name="algorithm" label="Algorithm for clustering" type="select" value = "Hartigan-Wong" help="K-means clustering algorithm, default 'Hartigan-Wong'; alternatives 'Lloyd', 'MacQueen'; 'Forgy' is a synonym for 'Lloyd', see stats::kmeans reference for further info and references."> 35 # <param name="algorithm" label="Algorithm for clustering" type="select" value = "Hartigan-Wong" help="K-means clustering algorithm, default 'Hartigan-Wong'; alternatives 'Lloyd', 'MacQueen'; 'Forgy' is a synonym for 'Lloyd', see stats::kmeans reference for further info and references.">
292 args_env$iter_max <- as.numeric( argVc['iter_max' ]) 293 args_env$iter_max <- as.numeric( argVc['iter_max' ])
293 args_env$nstart <- as.numeric( argVc['nstart' ]) 294 args_env$nstart <- as.numeric( argVc['nstart' ])
294 args_env$slots <- as.numeric( argVc['slots' ]) 295 args_env$slots <- as.numeric( argVc['slots' ])
295 # string args 296 # string args
296 args_env$algorithm <- as.character( argVc['algorithm']) 297 args_env$algorithm <- as.character( argVc['algorithm'])
298 args_env$categorical_prefix <- as.character( argVc['categorical_prefix'])
299
300
301 # make local 'log_print' function available through 'env'
297 args_env$log_print <- log_print 302 args_env$log_print <- log_print
298 303
299 log_print("PARAMETERS (parsed):") 304 log_print("PARAMETERS (parsed):")
300 for (member in ls(args_env)) { 305 for (member in ls(args_env)) {
301 value <- get(member, args_env) 306 value <- get(member, args_env)