diff AccurateMassSearch.xml @ 12:40e0709178a5 draft

"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
author galaxyp
date Wed, 09 Sep 2020 20:06:37 +0000
parents 96acf893530c
children 2dea459da18e
line wrap: on
line diff
--- a/AccurateMassSearch.xml	Fri May 17 10:24:05 2019 -0400
+++ b/AccurateMassSearch.xml	Wed Sep 09 20:06:37 2020 +0000
@@ -1,117 +1,145 @@
 <?xml version='1.0' encoding='UTF-8'?>
 <!--This is a configuration file for the integration of a tools into Galaxy (https://galaxyproject.org/). This file was automatically generated using CTDConverter.-->
 <!--Proposed Tool Section: [Utilities]-->
-<tool id="AccurateMassSearch" name="AccurateMassSearch" version="2.3.0">
+<tool id="AccurateMassSearch" name="AccurateMassSearch" version="@TOOL_VERSION@+galaxy@GALAXY_VERSION@" profile="20.05">
   <description>Match MS signals to molecules from a database by mass.</description>
   <macros>
     <token name="@EXECUTABLE@">AccurateMassSearch</token>
     <import>macros.xml</import>
+    <import>macros_autotest.xml</import>
+    <import>macros_test.xml</import>
   </macros>
-  <expand macro="references"/>
-  <expand macro="stdio"/>
   <expand macro="requirements"/>
-  <command detect_errors="aggressive"><![CDATA[AccurateMassSearch
+  <expand macro="stdio"/>
+  <command detect_errors="exit_code"><![CDATA[@QUOTE_FOO@
+@EXT_FOO@
+#import re
 
-#if $param_in:
-  -in $param_in
+## Preprocessing
+mkdir in &&
+ln -s '$in' 'in/${re.sub("[^\w\-_]", "_", $in.element_identifier)}.$gxy2omsext($in.ext)' &&
+mkdir out &&
+#if "out_annotation_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
+  mkdir out_annotation &&
 #end if
-#if $param_out:
-  -out $param_out
-#end if
-#if $param_out_annotation:
-  -out_annotation $param_out_annotation
+#if $positive_adducts:
+  mkdir positive_adducts &&
+  ln -s '$positive_adducts' 'positive_adducts/${re.sub("[^\w\-_]", "_", $positive_adducts.element_identifier)}.$gxy2omsext($positive_adducts.ext)' &&
 #end if
-#if $param_positive_adducts:
-  -positive_adducts $param_positive_adducts
+#if $negative_adducts:
+  mkdir negative_adducts &&
+  ln -s '$negative_adducts' 'negative_adducts/${re.sub("[^\w\-_]", "_", $negative_adducts.element_identifier)}.$gxy2omsext($negative_adducts.ext)' &&
 #end if
-#if $param_negative_adducts:
-  -negative_adducts $param_negative_adducts
+#if $db.mapping:
+  mkdir db.mapping &&
+  ${ ' '.join(["ln -s '%s' 'db.mapping/%s.%s' &&" % (_, re.sub('[^\w\-_]', '_', _.element_identifier), $gxy2omsext(_.ext)) for _ in $db.mapping if _]) }
 #end if
--db:mapping
-  #for token in $param_db_mapping:
-    $token
-  #end for
--db:struct
-  #for token in $param_db_struct:
-    $token
-  #end for
-#if $param_algorithm_mass_error_value:
-  -algorithm:mass_error_value $param_algorithm_mass_error_value
+#if $db.struct:
+  mkdir db.struct &&
+  ${ ' '.join(["ln -s '%s' 'db.struct/%s.%s' &&" % (_, re.sub('[^\w\-_]', '_', _.element_identifier), $gxy2omsext(_.ext)) for _ in $db.struct if _]) }
 #end if
-#if $param_algorithm_mass_error_unit:
-  -algorithm:mass_error_unit
-  #if " " in str($param_algorithm_mass_error_unit):
-    "$param_algorithm_mass_error_unit"
-  #else
-    $param_algorithm_mass_error_unit
-  #end if
+
+## Main program call
+
+set -o pipefail &&
+@EXECUTABLE@ -write_ctd ./ &&
+python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hardcoded_json' &&
+@EXECUTABLE@ -ini @EXECUTABLE@.ctd
+-in
+'in/${re.sub("[^\w\-_]", "_", $in.element_identifier)}.$gxy2omsext($in.ext)'
+-out
+'out/output.${gxy2omsext("mztab")}'
+#if "out_annotation_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
+  -out_annotation
+  'out_annotation/output.${in.ext}'
 #end if
-#if $param_algorithm_ionization_mode:
-  -algorithm:ionization_mode
-  #if " " in str($param_algorithm_ionization_mode):
-    "$param_algorithm_ionization_mode"
-  #else
-    $param_algorithm_ionization_mode
-  #end if
+#if $positive_adducts:
+  -positive_adducts
+  'positive_adducts/${re.sub("[^\w\-_]", "_", $positive_adducts.element_identifier)}.$gxy2omsext($positive_adducts.ext)'
+#end if
+#if $negative_adducts:
+  -negative_adducts
+  'negative_adducts/${re.sub("[^\w\-_]", "_", $negative_adducts.element_identifier)}.$gxy2omsext($negative_adducts.ext)'
+#end if
+#if $db.mapping:
+  -db:mapping
+  ${' '.join(["'db.mapping/%s.%s'"%(re.sub('[^\w\-_]', '_', _.element_identifier), $gxy2omsext(_.ext)) for _ in $db.mapping if _])}
 #end if
-#if $param_algorithm_isotopic_similarity:
-  -algorithm:isotopic_similarity
+#if $db.struct:
+  -db:struct
+  ${' '.join(["'db.struct/%s.%s'"%(re.sub('[^\w\-_]', '_', _.element_identifier), $gxy2omsext(_.ext)) for _ in $db.struct if _])}
 #end if
-#if $param_algorithm_keep_unidentified_masses:
-  -algorithm:keep_unidentified_masses
+#if len(str($OPTIONAL_OUTPUTS).split(',')) == 0
+  | tee '$stdout'
 #end if
-#if $param_algorithm_mzTab_exportIsotopeIntensities:
-  -algorithm:mzTab:exportIsotopeIntensities $param_algorithm_mzTab_exportIsotopeIntensities
+
+## Postprocessing
+&& mv 'out/output.${gxy2omsext("mztab")}' '$out'
+#if "out_annotation_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
+  && mv 'out_annotation/output.${in.ext}' '$out_annotation'
 #end if
-#if $adv_opts.adv_opts_selector=='advanced':
-    #if $adv_opts.param_force:
-  -force
-#end if
-#end if
-]]></command>
+#if "ctd_out_FLAG" in $OPTIONAL_OUTPUTS
+  && mv '@EXECUTABLE@.ctd' '$ctd_out'
+#end if]]></command>
+  <configfiles>
+    <inputs name="args_json" data_style="paths"/>
+    <configfile name="hardcoded_json"><![CDATA[{"log": "log.txt", "threads": "\${GALAXY_SLOTS:-1}", "no_progress": true}]]></configfile>
+  </configfiles>
   <inputs>
-    <param name="param_in" type="data" format="featurexml,consensusxml" optional="False" label="featureXML or consensusXML file" help="(-in) "/>
-    <param name="param_positive_adducts" type="data" format="tabular" optional="False" value="CHEMISTRY/PositiveAdducts.tsv" label="This file contains the list of potential positive adducts that will be looked for in the database" help="(-positive_adducts) Edit the list if you wish to exclude/include adducts. By default CHEMISTRY/PositiveAdducts.tsv in OpenMS/share is used! If empty, the default will be used"/>
-    <param name="param_negative_adducts" type="data" format="tabular" optional="False" value="CHEMISTRY/NegativeAdducts.tsv" label="This file contains the list of potential negative adducts that will be looked for in the database" help="(-negative_adducts) Edit the list if you wish to exclude/include adducts. By default CHEMISTRY/NegativeAdducts.tsv in OpenMS/share is used! If empty, the default will be used"/>
-    <param name="param_db_mapping" type="data" format="tabular" multiple="true" optional="False" size="30" value="CHEMISTRY/HMDBMappingFile.tsv" label="Database input file(s), containing three tab-separated columns of mass, formula, identifie" help="(-mapping) If 'mass' is 0, it is re-computed from the molecular sum formula. By default CHEMISTRY/HMDBMappingFile.tsv in OpenMS/share is used! If empty, the default will be used">
-      <sanitizer>
-        <valid initial="string.printable">
-          <remove value="'"/>
-          <remove value="&quot;"/>
-        </valid>
-      </sanitizer>
+    <param name="in" argument="-in" type="data" format="consensusxml,featurexml" optional="false" label="featureXML or consensusXML file" help=" select consensusxml,featurexml data sets(s)"/>
+    <param name="positive_adducts" argument="-positive_adducts" type="data" format="tabular" optional="true" label="This file contains the list of potential positive adducts that will be looked for in the database" help="Edit the list if you wish to exclude/include adducts. By default CHEMISTRY/PositiveAdducts.tsv in OpenMS/share is used select tabular data sets(s)"/>
+    <param name="negative_adducts" argument="-negative_adducts" type="data" format="tabular" optional="true" label="This file contains the list of potential negative adducts that will be looked for in the database" help="Edit the list if you wish to exclude/include adducts. By default CHEMISTRY/NegativeAdducts.tsv in OpenMS/share is used select tabular data sets(s)"/>
+    <section name="db" title="Database files which contain the identifications" help="" expanded="false">
+      <param name="mapping" argument="-db:mapping" type="data" format="tabular" multiple="true" optional="true" label="Database input file(s), containing three tab-separated columns of mass, formula, identifie" help="If 'mass' is 0, it is re-computed from the molecular sum formula. By default CHEMISTRY/HMDBMappingFile.tsv in OpenMS/share is used! If empty, the default will be used select tabular data sets(s)"/>
+      <param name="struct" argument="-db:struct" type="data" format="tabular" multiple="true" optional="true" label="Database input file(s), containing four tab-separated columns of identifier, name, SMILES, INCHI.The identifier should match with mapping file" help="SMILES and INCHI are reported in the output, but not used otherwise. By default CHEMISTRY/HMDB2StructMapping.tsv in OpenMS/share is used! If empty, the default will be used select tabular data sets(s)"/>
+    </section>
+    <section name="algorithm" title="Algorithm parameters section" help="" expanded="false">
+      <param name="mass_error_value" argument="-algorithm:mass_error_value" type="float" optional="true" value="5.0" label="Tolerance allowed for accurate mass search" help=""/>
+      <param name="mass_error_unit" argument="-algorithm:mass_error_unit" display="radio" type="select" optional="false" label="Unit of mass error (ppm or Da)" help="">
+        <option value="ppm" selected="true">ppm</option>
+        <option value="Da">Da</option>
+        <expand macro="list_string_san"/>
+      </param>
+      <param name="ionization_mode" argument="-algorithm:ionization_mode" display="radio" type="select" optional="false" label="Positive or negative ionization mode" help="If 'auto' is used, the first feature of the input map must contain the meta-value 'scan_polarity'. If its missing, the tool will exit with error">
+        <option value="positive" selected="true">positive</option>
+        <option value="negative">negative</option>
+        <option value="auto">auto</option>
+        <expand macro="list_string_san"/>
+      </param>
+      <param name="isotopic_similarity" argument="-algorithm:isotopic_similarity" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Computes a similarity score for each hit (only if the feature exhibits at least two isotopic mass traces)" help=""/>
+      <param name="use_feature_adducts" argument="-algorithm:use_feature_adducts" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Whether to filter AMS candidates mismatching available feature adduct annotation" help=""/>
+      <param name="keep_unidentified_masses" argument="-algorithm:keep_unidentified_masses" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Keep features that did not yield any DB hit" help=""/>
+      <section name="mzTab" title="" help="" expanded="false">
+        <param name="exportIsotopeIntensities" argument="-algorithm:mzTab:exportIsotopeIntensities" type="boolean" truevalue="true" falsevalue="false" checked="false" label="[featureXML input only] Export column with available isotope trace intensities (opt_global_MTint)" help=""/>
+      </section>
+    </section>
+    <expand macro="adv_opts_macro">
+      <param name="force" argument="-force" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Overwrite tool specific checks" help=""/>
+      <param name="test" argument="-test" type="hidden" optional="true" value="False" label="Enables the test mode (needed for internal use only)" help="">
+        <expand macro="list_string_san"/>
+      </param>
+    </expand>
+    <param name="OPTIONAL_OUTPUTS" type="select" multiple="true" label="Optional outputs" optional="true">
+      <option value="out_annotation_FLAG">out_annotation ([featureXML input only] Export column with available isotope trace intensities (opt_global_MTint))</option>
+      <option value="ctd_out_FLAG">Output used ctd (ini) configuration file</option>
     </param>
-    <param name="param_db_struct" type="data" format="tabular" multiple="true" optional="False" size="30" value="CHEMISTRY/HMDB2StructMapping.tsv" label="Database input file(s), containing four tab-separated columns of identifier, name, SMILES, INCHI.The identifier should match with mapping file" help="(-struct) SMILES and INCHI are reported in the output, but not used otherwise. By default CHEMISTRY/HMDB2StructMapping.tsv in OpenMS/share is used! If empty, the default will be used">
-      <sanitizer>
-        <valid initial="string.printable">
-          <remove value="'"/>
-          <remove value="&quot;"/>
-        </valid>
-      </sanitizer>
-    </param>
-    <param name="param_algorithm_mass_error_value" type="float" value="5.0" label="Tolerance allowed for accurate mass search" help="(-mass_error_value) "/>
-    <param name="param_algorithm_mass_error_unit" display="radio" type="select" optional="False" value="ppm" label="Unit of mass error (ppm or Da)" help="(-mass_error_unit) ">
-      <option value="ppm" selected="true">ppm</option>
-      <option value="Da">Da</option>
-    </param>
-    <param name="param_algorithm_ionization_mode" display="radio" type="select" optional="False" value="positive" label="Positive or negative ionization mode?" help="(-ionization_mode) If 'auto' is used, the first feature of the input map must contain the meta-value 'scan_polarity'. If its missing, the tool will exit with error">
-      <option value="positive" selected="true">positive</option>
-      <option value="negative">negative</option>
-      <option value="auto">auto</option>
-    </param>
-    <param name="param_algorithm_isotopic_similarity" display="radio" type="boolean" truevalue="-algorithm:isotopic_similarity" falsevalue="" checked="false" optional="True" label="Computes a similarity score for each hit (only if the feature exhibits at least two isotopic mass traces)" help="(-isotopic_similarity) "/>
-    <param name="param_algorithm_keep_unidentified_masses" display="radio" type="boolean" truevalue="-algorithm:keep_unidentified_masses" falsevalue="" checked="false" optional="True" label="Keep features that did not yield any DB hit" help="(-keep_unidentified_masses) "/>
-    <param name="param_algorithm_mzTab_exportIsotopeIntensities" type="integer" min="0" optional="True" value="0" label="[featureXML input only] Number of extra columns in mzTab output, which provide intensities up to the x'th isotope" help="(-exportIsotopeIntensities) '0' to deactivate, '1' for monoisotopic peak, etc. If a feature does not have a certain isotope, 'null' will be reported"/>
-    <expand macro="advanced_options">
-      <param name="param_force" display="radio" type="boolean" truevalue="-force" falsevalue="" checked="false" optional="True" label="Overwrite tool specific checks" help="(-force) "/>
-    </expand>
   </inputs>
   <outputs>
-    <data name="param_out" format="tabular"/>
-    <data name="param_out_annotation" metadata_source="param_in" format="input"/>
+    <data name="out" label="${tool.name} on ${on_string}: out" format="mztab"/>
+    <data name="out_annotation" label="${tool.name} on ${on_string}: out_annotation" format_source="in" metadata_source="in">
+      <filter>OPTIONAL_OUTPUTS is not None and "out_annotation_FLAG" in OPTIONAL_OUTPUTS</filter>
+    </data>
+    <data name="ctd_out" format="xml" label="${tool.name} on ${on_string}: ctd">
+      <filter>OPTIONAL_OUTPUTS is not None and "ctd_out_FLAG" in OPTIONAL_OUTPUTS</filter>
+    </data>
   </outputs>
-  <help>Match MS signals to molecules from a database by mass.
+  <tests>
+    <expand macro="autotest_AccurateMassSearch"/>
+    <expand macro="manutest_AccurateMassSearch"/>
+  </tests>
+  <help><![CDATA[Match MS signals to molecules from a database by mass.
 
 
-For more information, visit https://abibuilder.informatik.uni-tuebingen.de/archive/openms/Documentation/release/2.3.0/html/UTILS_AccurateMassSearch.html</help>
+For more information, visit http://www.openms.de/documentation/UTILS_AccurateMassSearch.html]]></help>
+  <expand macro="references"/>
 </tool>