comparison recetox_aplcms_merge_known_table.xml @ 0:211f85249b1c 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:28:16 +0000
parents
children f2490df187db
comparison
equal deleted inserted replaced
-1:000000000000 0:211f85249b1c
1 <tool id="recetox_aplcms_merge_known_table" name="recetox-aplcms - merge known table" version="@TOOL_VERSION@+galaxy0">
2 <description>join knowledge from aligned features and known table.</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 metadata <- load_data_from_parquet_file('$metadata_file')
16 rt_table <- load_data_from_parquet_file('$rt_file')
17 intensity_table <- load_data_from_parquet_file('$intensity_file')
18 tolerances <- load_data_from_parquet_file('$tolerances')
19 known_table <- read_known_table('$known_table')
20
21 feature_tables <- join_tables_to_list(metadata, rt_table, intensity_table)
22
23 merged <- merge_features_and_known_table(
24 features = feature_tables,
25 known_table = known_table,
26 #if $match_tol_ppm:
27 match_tol_ppm = $match_tol_ppm,
28 #else:
29 match_tol_ppm = NA,
30 #end if
31 mz_tol_relative = get_mz_tol(tolerances),
32 rt_tol_relative = get_rt_tol(tolerances),
33 #if $direction.selection == "TRUE":
34 new_feature_min_count = $direction.new_feature_min_count,
35 #end if
36 from_features_to_known_table = $direction.selection
37 )
38
39 #if $direction.selection == "TRUE":
40 save_known_table(merged, '$output_known_table')
41 save_pairing(merged, '$output_pairing')
42 #else:
43 save_aligned_features(merged, '$output_metadata_file', '$output_rt_file', '$output_intensity_file')
44 #end if
45 ]]></configfile>
46 </configfiles>
47
48 <inputs>
49 <param name="metadata_file" type="data" format="parquet" label="Metadata table"
50 help="Peak metadata table from the align features step" />
51 <param name="rt_file" type="data" format="parquet" label="RT table"
52 help="Table with retention times for features (rows) across samples (columns)." />
53 <param name="intensity_file" type="data" format="parquet" label="Intensity table"
54 help="Table with intensities for features (rows) across samples (columns)." />
55 <param label="Table of known features" name="known_table" type="data" format="parquet"
56 help="A data table containing the known metabolite ions and previously found features. The table must
57 contain these 18 columns: chemical_formula (optional), HMDB_ID (optional), KEGG_compound_ID (optional),
58 neutral.mass (optional), ion.type (the ion form - optional), m.z (either theoretical or mean observed
59 m/z value of previously found features), Number_profiles_processed (the total number of processed
60 samples to build this database), Percent_found (the percentage of historically processed samples in
61 which the feature appeared), mz_min (minimum observed m/z value), mz_max (maximum observed m/z value),
62 RT_mean (mean observed retention time), RT_sd (standard deviation of observed retention time),
63 RT_min (minimum observed retention time), RT_max (maximum observed retention time),
64 int_mean.log. (mean observed log intensity), int_sd.log. (standard deviation of observed log intensity),
65 int_min.log. (minimum observed log intensity), int_max.log. (maximum observed log intensity)." />
66 <param label="Input tolerances values" name="tolerances" type="data" format="parquet"
67 help="Table containing tolerance values." />
68
69 <conditional name="direction">
70 <param label="Tables merge direction" name="selection" type="select"
71 help="Choose between merging feature to known_table and known_table to features.">
72 <option value="TRUE">Merge features to known table</option>
73 <option value="FALSE">Merge known table to features</option>
74 </param>
75 <when value="TRUE">
76 <param name="new_feature_min_count" type="integer" value="2" min="1" label="new_feature_min_count"
77 help="The minimum number of occurrences of a historically unseen (unknown) feature to add
78 this feature into the database of known features." />
79 </when>
80 </conditional>
81
82 <param name="match_tol_ppm" type="integer" optional="true" min="0" label="match_tol_ppm"
83 help="The ppm tolerance to match identified features to known metabolites/features." />
84 </inputs>
85
86 <outputs>
87 <data name="output_metadata_file" format="parquet" label="${tool.name} on ${on_string} (metadata table)">
88 <filter>direction['selection'] == 'FALSE'</filter>
89 </data>
90 <data name="output_rt_file" format="parquet" label="${tool.name} on ${on_string} (rt table)">
91 <filter>direction['selection'] == 'FALSE'</filter>
92 </data>
93 <data name="output_intensity_file" format="parquet" label="${tool.name} on ${on_string} (intensity table)">
94 <filter>direction['selection'] == 'FALSE'</filter>
95 </data>
96
97 <data label="${tool.name} on ${on_string} (known table)" name="output_known_table" format="parquet" >
98 <filter>direction['selection'] == 'TRUE'</filter>
99 </data>
100 <data label="${tool.name} on ${on_string} (pairing)" name="output_pairing" format="parquet" >
101 <filter>direction['selection'] == 'TRUE'</filter>
102 </data>
103 </outputs>
104
105 <tests>
106
107 </tests>
108
109 <help>
110 <![CDATA[
111 @MERGE_KNOWN_TABLES_HELP@
112
113 @GENERAL_HELP@
114 ]]>
115 </help>
116
117 <expand macro="citations"/>
118 </tool>