Mercurial > repos > recetox > recetox_xmsannotator_advanced
comparison recetox_xmsannotator_advanced.xml @ 5:a393c4383436 draft
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/recetox-xmsannotator commit 1ab1a1dabfcebe11720de1411927a7438c1b64c1
author | recetox |
---|---|
date | Mon, 26 Jun 2023 13:55:44 +0000 |
parents | 464c1e80a01f |
children |
comparison
equal
deleted
inserted
replaced
4:464c1e80a01f | 5:a393c4383436 |
---|---|
1 <tool id="recetox_xmsannotator_advanced" name="RECETOX xMSannotator advanced" version="@TOOL_VERSION@+galaxy0"> | 1 <tool id="recetox_xmsannotator_advanced" name="recetox-xMSannotator" version="@TOOL_VERSION@+galaxy0"> |
2 | |
2 <description>annotate peak intensity table including scores and confidence levels</description> | 3 <description>annotate peak intensity table including scores and confidence levels</description> |
3 <macros> | 4 <macros> |
4 <import>macros.xml</import> | 5 <import>macros.xml</import> |
5 </macros> | 6 </macros> |
6 <expand macro="creator"/> | 7 <expand macro="creator"/> |
8 <xrefs> | |
9 <xref type="bio.tools">recetox-xmsannotator</xref> | |
10 </xrefs> | |
7 <expand macro="requirements" /> | 11 <expand macro="requirements" /> |
8 <command detect_errors="aggressive"><![CDATA[ | 12 <command detect_errors="aggressive"><![CDATA[ |
9 Rscript -e "n_workers <- \${GALAXY_SLOTS:-1}" -e "source('${wrapper}')" | 13 Rscript -e 'source("${__tool_directory__}/utils.R")' -e "n_workers <- \${GALAXY_SLOTS:-1}" -e "source('${wrapper}')" |
10 ]]></command> | 14 ]]></command> |
11 | 15 |
12 <configfiles> | 16 <configfiles> |
13 <configfile name="wrapper"><![CDATA[ | 17 <configfile name="wrapper"><![CDATA[ |
14 library(xmsannotator) | 18 metadata_table <- load_table("$metadata_table", "$metadata_table.ext") |
19 intensity_table <- load_table("$intensity_table", "$intensity_table.ext") | |
20 peak_table <- create_peak_table(metadata_table, intensity_table) | |
21 | |
22 filter_by <- create_filter_by_adducts("$filter_by") | |
15 | 23 |
16 annotation <- advanced_annotation( | 24 annotation <- advanced_annotation( |
17 #if $peak_table.is_of_type("h5") | 25 peak_table = peak_table, |
18 peak_table = load_peak_table_hdf("${peak_table}"), | 26 adduct_table = load_table("$adduct_table", "$adduct_table.ext"), |
19 #elif $peak_table.is_of_type("parquet") | 27 adduct_weights = load_table("$adduct_weights", "$adduct_weights.ext"), |
20 peak_table = load_peak_table_parquet("${peak_table}"), | 28 compound_table = load_table("$compound_table", "$compound_table.ext"), |
21 #end if | |
22 adduct_table = load_adduct_table_parquet("${adduct_table}"), | |
23 compound_table = load_compound_table_parquet("${compound_table}"), | |
24 mass_tolerance = 1e-6 * ${mass_tolerance_ppm}, | 29 mass_tolerance = 1e-6 * ${mass_tolerance_ppm}, |
25 time_tolerance = $time_tolerance, | 30 time_tolerance = $time_tolerance, |
26 correlation_threshold = as.double($clustering.correlation_threshold), | 31 correlation_threshold = as.double($clustering.correlation_threshold), |
27 min_cluster_size = as.integer($clustering.min_cluster_size), | 32 min_cluster_size = as.integer($clustering.min_cluster_size), |
28 deep_split = as.integer($clustering.deep_split), | 33 deep_split = as.integer($clustering.deep_split), |
29 network_type = "$clustering.network_type", | 34 network_type = "$clustering.network_type", |
30 #if $scoring.expected_adducts | |
31 expected_adducts = load_expected_adducts_csv("${scoring.expected_adducts}"), | |
32 #end if | |
33 #if $scoring.boost_compounds | |
34 boost_compounds = load_boost_compounds_csv("${scoring.boost_compounds}"), | |
35 #end if | |
36 redundancy_filtering = $scoring.redundancy_filtering, | 35 redundancy_filtering = $scoring.redundancy_filtering, |
37 n_workers = n_workers | 36 n_workers = n_workers, |
37 intensity_deviation_tolerance = as.double($intensity_deviation_tolerance), | |
38 mass_defect_tolerance = as.double($mass_defect_tolerance), | |
39 mass_defect_precision = as.double($mass_defect_precision), | |
40 peak_rt_width = as.integer($peak_rt_width), | |
41 maximum_isotopes = as.integer($maximum_isotopes), | |
42 min_ions_per_chemical = as.integer($min_ions_per_chemical), | |
43 filter_by = filter_by | |
38 ) | 44 ) |
39 | 45 |
40 save_parquet(data = annotation, file = "${annotation_parquet}") | 46 save_table(annotation, "$output_file", "$output_file.ext") |
41 ]]></configfile> | 47 ]]></configfile> |
42 </configfiles> | 48 </configfiles> |
43 | 49 |
44 <inputs> | 50 <inputs> |
45 <expand macro="inputs"/> | 51 <expand macro="inputs"/> |
46 <expand macro="tolerance"> | 52 <expand macro="tolerance"> |
47 <param name="time_tolerance" type="float" value="10" min="0"> | 53 <param name="time_tolerance" type="float" value="10" min="0"> |
48 <label>Retention time tolerance [s]</label> | 54 <label>Retention time tolerance [s]</label> |
49 <help> | 55 <help> |
50 Retention time tolerance in seconds for finding peaks derived from the same parent metabolite. | 56 Retention time tolerance in seconds for finding peaks derived from the same parent compound. |
51 </help> | 57 </help> |
52 </param> | 58 </param> |
53 </expand> | 59 </expand> |
54 <section name="clustering" title="Clustering"> | 60 <section name="clustering" title="Clustering"> |
55 <param name="correlation_method" type="select" display="radio" label="Correlation method"> | |
56 <option value="pearson" selected="true">pearson</option> | |
57 <option value="spearman">spearman</option> | |
58 </param> | |
59 <param name="correlation_threshold" type="float" value="0.7"> | 61 <param name="correlation_threshold" type="float" value="0.7"> |
60 <label>Correlation threshold</label> | 62 <label>Correlation threshold</label> |
61 <help>Correlation threshold between peaks to qualify as adducts/isotopes of the same metabolite.</help> | 63 <help>Correlation threshold between peaks to qualify as adducts/isotopes of the same metabolite.</help> |
62 </param> | 64 </param> |
63 <param name="min_cluster_size" type="integer" value="10" min="1"> | 65 <param name="min_cluster_size" type="integer" value="10" min="1"> |
75 <label>Network type</label> | 77 <label>Network type</label> |
76 <help> | 78 <help> |
77 Network type parameter affects how the network's adjacency matrix is created from the correlation | 79 Network type parameter affects how the network's adjacency matrix is created from the correlation |
78 matrix (see WGCNA package documentation). | 80 matrix (see WGCNA package documentation). |
79 </help> | 81 </help> |
80 <option value="signed">signed</option> | 82 <option value="signed">Signed</option> |
81 <option value="unsigned" selected="true">unsigned</option> | 83 <option value="unsigned" selected="true">Unsigned</option> |
82 </param> | 84 </param> |
83 </section> | 85 </section> |
84 <section name="scoring" title="Scoring" expanded="true"> | 86 <section name="scoring" title="Scoring" expanded="true"> |
85 <param name="strict_boosting" type="boolean" checked="true" truevalue="TRUE" falsevalue="FALSE"> | 87 <param name="strict_boosting" type="boolean" checked="true" truevalue="TRUE" falsevalue="FALSE"> |
86 <label>Strict boosting</label> | 88 <label>Strict boosting</label> |
87 <help> | 89 <help> |
88 Boost the scores of metabolites that not only belongs to the same pathway but also to the same | 90 Boost the scores of metabolites that not only belongs to the same pathway but also to the same |
89 cluster. Otherwise, do not account for cluster membership. | 91 cluster. Otherwise, do not account for cluster membership. |
90 </help> | |
91 </param> | |
92 <param name="expected_adducts" type="data" format="csv" optional="true"> | |
93 <label>Expected adducts</label> | |
94 <help> | |
95 Require the presence of certain adducts for a high confidence match. By default, at least the | |
96 presence of an M+H adduct is required for a high confidence match. | |
97 </help> | |
98 </param> | |
99 <param name="boost_compounds" type="data" format="csv" optional="true"> | |
100 <label>Validated compounds score boosting (optional)</label> | |
101 <help> | |
102 Table of previously validated compounds to boost their scores and confidence levels. | |
103 The 1st column of the table must contain IDs of compounds. | |
104 The optional 2nd and 3rd columns may contain mz values and retention times. | |
105 </help> | 92 </help> |
106 </param> | 93 </param> |
107 <param name="min_isp" type="integer" min="0" value="1"> | 94 <param name="min_isp" type="integer" min="0" value="1"> |
108 <label>Minimum number of expected isotopes</label> | 95 <label>Minimum number of expected isotopes</label> |
109 <help> | 96 <help> |
119 <param name="redundancy_filtering" type="boolean" checked="true" truevalue="TRUE" falsevalue="FALSE"> | 106 <param name="redundancy_filtering" type="boolean" checked="true" truevalue="TRUE" falsevalue="FALSE"> |
120 <label>Redundancy filtering</label> | 107 <label>Redundancy filtering</label> |
121 <help>Whether to filter out low-scored multiple matcher or not.</help> | 108 <help>Whether to filter out low-scored multiple matcher or not.</help> |
122 </param> | 109 </param> |
123 </section> | 110 </section> |
111 <param name="intensity_deviation_tolerance" type="float" value="0.1"> | |
112 <label>Tolerance of intensity deviation</label> | |
113 <help>A numeric threshold by which an intensity ratio of two isotopic peaks may differ from their actual abundance ratio.</help> | |
114 </param> | |
115 <param name="mass_defect_tolerance" type="float" value="0.1"> | |
116 <label>Tolerance of mass defect</label> | |
117 <help>Maximum difference in mass defect between two peaks of the same compound.</help> | |
118 </param> | |
119 <param name="mass_defect_precision" type="float" value="0.01"> | |
120 <label>Precision for computing mass defect</label> | |
121 </param> | |
122 <param name="peak_rt_width" type="integer" value="1"> | |
123 <label>Estimated chromatographic peak width</label> | |
124 </param> | |
125 <param name="maximum_isotopes" type="integer" value="10"> | |
126 <label>Maximum isotopes</label> | |
127 </param> | |
128 <param name="min_ions_per_chemical" type="integer" value="2"> | |
129 <label>Minimum ions per chemical</label> | |
130 </param> | |
131 <param name="filter_by" type="select" label="Adducts to filter by" multiple="true" optional="true"> | |
132 <option value="M-H" selected="true">M-H</option> | |
133 <option value="M+H" selected="true">M+H</option> | |
134 <option value="2M-H">2M-H</option> | |
135 <option value="M-2H">M-2H</option> | |
136 </param> | |
124 </inputs> | 137 </inputs> |
125 | 138 |
126 <outputs> | 139 <outputs> |
127 <expand macro="outputs"/> | 140 <expand macro="outputs"/> |
128 </outputs> | 141 </outputs> |
129 | 142 |
143 <tests> | |
144 <test> | |
145 <param name="metadata_table" value="metadata_table.parquet" ftype="parquet" /> | |
146 <param name="intensity_table" value="intensity_table.parquet" ftype="parquet" /> | |
147 <param name="compound_table" value="database.parquet" ftype="parquet" /> | |
148 <param name="adduct_table" value="adduct_table.parquet" ftype="parquet" /> | |
149 <output name="output_file" file="expected_output.parquet" ftype="parquet"/> | |
150 </test> | |
151 <test> | |
152 <param name="metadata_table" value="metadata_table.csv" ftype="csv" /> | |
153 <param name="intensity_table" value="intensity_table.csv" ftype="csv" /> | |
154 <param name="compound_table" value="database.csv" ftype="csv" /> | |
155 <param name="adduct_table" value="adduct_table.csv" ftype="csv" /> | |
156 <output name="output_file" file="expected_output.csv" ftype="csv"/> | |
157 </test> | |
158 </tests> | |
159 | |
130 <help> | 160 <help> |
131 <![CDATA[ | 161 <![CDATA[ |
132 @HELP@ | 162 @HELP@ |
133 Then, a score and a confidence level is assigned to each match based on peak correlation | |
134 clustering, metabolite pathway associations, adducts expectations, and isotope conformations. | |
135 ]]> | 163 ]]> |
136 </help> | 164 </help> |
137 | 165 |
138 <citations> | 166 <citations> |
139 <expand macro="citations"/> | 167 <expand macro="citations"/> |