comparison recetox_aplcms_compute_clusters.xml @ 0:82737757f3d5 draft

planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/recetox_aplcms commit 506df2aef355b3791567283e1a175914f06b405a
author recetox
date Mon, 13 Feb 2023 10:27:56 +0000
parents
children 092bbb03a217
comparison
equal deleted inserted replaced
-1:000000000000 0:82737757f3d5
1 <tool id="recetox_aplcms_compute_clusters" name="recetox-aplcms - compute clusters" version="@TOOL_VERSION@+galaxy0">
2 <description>compute clusters of mz and rt across samples and assign cluster IDs to individual features</description>
3 <macros>
4 <import>macros.xml</import>
5 <import>help.xml</import>
6 </macros>
7 <expand macro="creator"/>
8 <expand macro="requirements"/>
9
10 <command detect_errors="aggressive"><![CDATA[
11 Rscript -e 'source("${__tool_directory__}/utils.R")' -e 'source("${run_script}")'
12 ]]></command>
13 <configfiles>
14 <configfile name="run_script"><![CDATA[
15 #set filenames = str("', '").join([str($f) for $f in $files])
16 feature_tables <- load_parquet_collection(c('$filenames'))
17 sample_names <- unlist(lapply(feature_tables, load_sample_name))
18
19 validate_sample_names(sample_names)
20
21 ordering <- order(sample_names)
22 feature_tables <- feature_tables[ordering]
23 sample_names <- sample_names[ordering]
24
25 #if $tolerances_input_method.input_method == "file"
26 tolerances <- load_data_from_parquet_file('$input_tolerances')
27 #end if
28
29 clusters <- compute_clusters(
30 feature_tables = feature_tables,
31 #if $tolerances_input_method.input_method == "file"
32 mz_tol_relative = get_mz_tol(tolerances),
33 rt_tol_relative = get_rt_tol(tolerances),
34 #else
35 #if $tolerances_input_method.mz_tol_relative:
36 mz_tol_relative = $tolerances_input_method.mz_tol_relative,
37 #else:
38 mz_tol_relative = NA,
39 #end if
40 #if $tolerances_input_method.rt_tol_relative:
41 rt_tol_relative = $tolerances_input_method.rt_tol_relative,
42 #else:
43 rt_tol_relative = NA,
44 #end if
45 #end if
46 mz_max_diff = 10 * $mz_max_diff,
47 mz_tol_absolute = $mz_tol_absolute,
48 sample_names = sample_names,
49 do.plot = FALSE
50 )
51
52 save_parquet_collection(clusters, sample_names, "clustered")
53 save_tolerances(clusters, '$tolerances')
54 ]]></configfile>
55 </configfiles>
56
57 <inputs>
58 <param name="files" type="data_collection" collection_type="list" format="parquet" label="Input data"
59 help="List of tables containing features." />
60 <expand macro="compute_clusters_params"/>
61 </inputs>
62
63 <outputs>
64 <collection name="clustered_feature_tables" type="list"
65 label="${tool.name} feature_tables on ${on_string}">
66 <discover_datasets pattern="__designation__" directory="clustered" format="parquet" />
67 </collection>
68 <data name="tolerances" format="parquet" label="${tool.name} on ${on_string} (updated tolerances)" />
69 </outputs>
70
71 <tests>
72
73 </tests>
74
75 <help>
76 <![CDATA[
77 @COMPUTE_CLUSTERS_HELP@
78
79 @GENERAL_HELP@
80
81 @EXAMPLE_OUTPUT@
82 ]]>
83 </help>
84
85 <expand macro="citations"/>
86 </tool>