view AccurateMassSearch.xml @ 17:31e674c86840 draft default tip

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 5c080b1e2b99f1c88f4557e9fec8c45c9d23b906
author galaxyp
date Fri, 14 Jun 2024 21:41:27 +0000
parents 532cf3ddcc91
children
line wrap: on
line source

<!--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: [Metabolite Identification]-->
<tool id="AccurateMassSearch" name="AccurateMassSearch" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="21.05">
  <description>Match MS signals to molecules from a database by mass</description>
  <macros>
    <token name="@EXECUTABLE@">AccurateMassSearch</token>
    <import>macros.xml</import>
  </macros>
  <expand macro="requirements"/>
  <expand macro="stdio"/>
  <command detect_errors="exit_code"><![CDATA[@QUOTE_FOO@
@EXT_FOO@
#import re

## Preprocessing
mkdir in &&
cp '$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 $positive_adducts:
  mkdir positive_adducts &&
  cp '$positive_adducts' 'positive_adducts/${re.sub("[^\w\-_]", "_", $positive_adducts.element_identifier)}.$gxy2omsext($positive_adducts.ext)' &&
#end if
#if $negative_adducts:
  mkdir negative_adducts &&
  cp '$negative_adducts' 'negative_adducts/${re.sub("[^\w\-_]", "_", $negative_adducts.element_identifier)}.$gxy2omsext($negative_adducts.ext)' &&
#end if
#if $db.mapping_cond.mapping:
  mkdir db.mapping_cond.mapping &&
  #if $db.mapping_cond.mapping_select == "no"
  mkdir ${' '.join(["'db.mapping_cond.mapping/%s'" % (i) for i, f in enumerate($db.mapping_cond.mapping) if f])} && 
  ${' '.join(["cp '%s' 'db.mapping_cond.mapping/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($db.mapping_cond.mapping) if f])}
  #else
  cp '$db.mapping_cond.mapping' 'db.mapping_cond.mapping/${re.sub("[^\w\-_]", "_", $db.mapping_cond.mapping.element_identifier)}.$gxy2omsext($db.mapping_cond.mapping.ext)' &&
  #end if
#end if
#if $db.struct_cond.struct:
  mkdir db.struct_cond.struct &&
  #if $db.struct_cond.struct_select == "no"
  mkdir ${' '.join(["'db.struct_cond.struct/%s'" % (i) for i, f in enumerate($db.struct_cond.struct) if f])} && 
  ${' '.join(["cp '%s' 'db.struct_cond.struct/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($db.struct_cond.struct) if f])}
  #else
  cp '$db.struct_cond.struct' 'db.struct_cond.struct/${re.sub("[^\w\-_]", "_", $db.struct_cond.struct.element_identifier)}.$gxy2omsext($db.struct_cond.struct.ext)' &&
  #end if
#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.${out_annotation_type}'
#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_cond.mapping:
  -db:mapping
  #if $db.mapping_cond.mapping_select == "no"
  ${' '.join(["'db.mapping_cond.mapping/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($db.mapping_cond.mapping) if f])}
  #else
  'db.mapping_cond.mapping/${re.sub("[^\w\-_]", "_", $db.mapping_cond.mapping.element_identifier)}.$gxy2omsext($db.mapping_cond.mapping.ext)'
  #end if
#end if
#if $db.struct_cond.struct:
  -db:struct
  #if $db.struct_cond.struct_select == "no"
  ${' '.join(["'db.struct_cond.struct/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($db.struct_cond.struct) if f])}
  #else
  'db.struct_cond.struct/${re.sub("[^\w\-_]", "_", $db.struct_cond.struct.element_identifier)}.$gxy2omsext($db.struct_cond.struct.ext)'
  #end if
#end if
#if len(str($OPTIONAL_OUTPUTS).split(',')) == 0
  | tee '$stdout'
#end if

## Postprocessing
&& mv 'out/output.${gxy2omsext("mztab")}' '$out'
#if "out_annotation_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
  && mv 'out_annotation/output.${out_annotation_type}' '$out_annotation'
#end if
#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 argument="-in" type="data" format="consensusxml,featurexml" label="featureXML or consensusXML file" help=" select consensusxml,featurexml data sets(s)"/>
    <param name="out_annotation_type" type="select" label="File type of output out_annotation (A copy of the input file, annotated with matching hits from the database.)">
      <option value="featureXML">featurexml</option>
      <option value="consensusXML">consensusxml</option>
      <option value="oms">sqlite (oms)</option>
    </param>
    <param 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 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">
      <conditional name="mapping_cond">
        <param name="mapping_select" type="select" label="Run tool in batch mode for -mapping">
          <option value="no">No: process all datasets jointly</option>
          <option value="yes">Yes: process each dataset in an independent job</option>
        </param>
        <when value="no">
          <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)"/>
        </when>
        <when value="yes">
          <param name="mapping" argument="-db:mapping" type="data" format="tabular" 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)"/>
        </when>
      </conditional>
      <conditional name="struct_cond">
        <param name="struct_select" type="select" label="Run tool in batch mode for -struct">
          <option value="no">No: process all datasets jointly</option>
          <option value="yes">Yes: process each dataset in an independent job</option>
        </param>
        <when value="no">
          <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)"/>
        </when>
        <when value="yes">
          <param name="struct" argument="-db:struct" type="data" format="tabular" 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)"/>
        </when>
      </conditional>
    </section>
    <section name="algorithm" title="Algorithm parameters section" help="" expanded="false">
      <param name="mass_error_value" argument="-algorithm:mass_error_value" type="float" value="5.0" label="Tolerance allowed for accurate mass search" help=""/>
      <param name="mass_error_unit" argument="-algorithm:mass_error_unit" type="select" 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" name="mass_error_unit"/>
      </param>
      <param name="ionization_mode" argument="-algorithm:ionization_mode" type="select" 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" name="ionization_mode"/>
      </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="true" label="Keep features that did not yield any DB hit" help=""/>
      <param name="id_format" argument="-algorithm:id_format" type="select" label="Use legacy (ProteinID/PeptideID based storage of metabolomics data) with mzTab-v1.0.0 as output format or novel Identification Data (ID) with mzTab-v2.0.0-M as output format (ID and its MzTab-M output is currently only support for featureXML files)" help="">
        <option value="legacy" selected="true">legacy</option>
        <option value="ID">ID</option>
        <expand macro="list_string_san" name="id_format"/>
      </param>
      <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 argument="-force" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Overrides tool-specific checks" help=""/>
      <param argument="-test" type="hidden" value="False" label="Enables the test mode (needed for internal use only)" help="" optional="true">
        <expand macro="list_string_san" name="test"/>
      </param>
    </expand>
    <param name="OPTIONAL_OUTPUTS" type="select" optional="true" multiple="true" label="Optional outputs">
      <option value="out_annotation_FLAG">out_annotation (A copy of the input file, annotated with matching hits from the database)</option>
      <option value="ctd_out_FLAG">Output used ctd (ini) configuration file</option>
    </param>
  </inputs>
  <outputs>
    <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="consensusxml">
      <change_format>
        <when input="out_annotation_type" value="featureXML" format="featurexml"/>
        <when input="out_annotation_type" value="oms" format="sqlite"/>
      </change_format>
      <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>
  <tests>
    <!-- TOPP_AccurateMassSearch_1 -->
    <test expect_num_outputs="2">
      <section name="adv_opts">
        <param name="force" value="false"/>
        <param name="test" value="true"/>
      </section>
      <param name="in" value="ConsensusMapNormalizer_input.consensusXML"/>
      <output name="out" value="AccurateMassSearch_1_output.csv" compare="sim_size" delta_frac="0.7" ftype="mztab"/>
      <param name="positive_adducts" value="CHEMISTRY/PositiveAdducts.tsv" ftype="tabular"/>
      <param name="negative_adducts" value="CHEMISTRY/NegativeAdducts.tsv" ftype="tabular"/>
      <section name="db">
        <conditional name="mapping_cond">
          <param name="mapping" value="CHEMISTRY/HMDBMappingFile.tsv" ftype="tabular"/>
        </conditional>
        <conditional name="struct_cond">
          <param name="struct" value="CHEMISTRY/HMDB2StructMapping.tsv" ftype="tabular"/>
        </conditional>
      </section>
      <section name="algorithm">
        <param name="mass_error_value" value="5.0"/>
        <param name="mass_error_unit" value="ppm"/>
        <param name="ionization_mode" value="positive"/>
        <param name="isotopic_similarity" value="false"/>
        <param name="use_feature_adducts" value="false"/>
        <param name="keep_unidentified_masses" value="true"/>
        <param name="id_format" value="legacy"/>
        <section name="mzTab">
          <param name="exportIsotopeIntensities" value="false"/>
        </section>
      </section>
      <param name="OPTIONAL_OUTPUTS" value="ctd_out_FLAG"/>
      <output name="ctd_out" ftype="xml">
        <assert_contents>
          <is_valid_xml/>
        </assert_contents>
      </output>
      <assert_stdout>
        <has_text_matching expression="@EXECUTABLE@ took .* \(wall\), .* \(CPU\), .* \(system\), .* \(user\)(; Peak Memory Usage: 32 MB)?."/>
      </assert_stdout>
    </test>
    <!-- TOPP_AccurateMassSearch_2 -->
    <test expect_num_outputs="3">
      <section name="adv_opts">
        <param name="force" value="false"/>
        <param name="test" value="true"/>
      </section>
      <param name="in" value="AccurateMassSearch_2_input.featureXML"/>
      <output name="out" value="AccurateMassSearch_2_output.mzTab" compare="sim_size" delta_frac="0.7" ftype="mztab"/>
      <param name="out_annotation_type" value="featureXML"/>
      <output name="out_annotation" value="AccurateMassSearch_2_output.featureXML" compare="sim_size" delta_frac="0.7" ftype="featurexml"/>
      <param name="positive_adducts" value="AMS_PositiveAdducts.tsv" ftype="tabular"/>
      <param name="negative_adducts" value="AMS_NegativeAdducts.tsv" ftype="tabular"/>
      <section name="db">
        <conditional name="mapping_cond">
          <param name="mapping" value="AMS_test_Mapping.tsv" ftype="tabular"/>
        </conditional>
        <conditional name="struct_cond">
          <param name="struct" value="AMS_test_Struct.tsv" ftype="tabular"/>
        </conditional>
      </section>
      <section name="algorithm">
        <param name="mass_error_value" value="5.0"/>
        <param name="mass_error_unit" value="ppm"/>
        <param name="ionization_mode" value="positive"/>
        <param name="isotopic_similarity" value="false"/>
        <param name="use_feature_adducts" value="false"/>
        <param name="keep_unidentified_masses" value="false"/>
        <param name="id_format" value="legacy"/>
        <section name="mzTab">
          <param name="exportIsotopeIntensities" value="true"/>
        </section>
      </section>
      <param name="OPTIONAL_OUTPUTS" value="ctd_out_FLAG,out_annotation_FLAG"/>
      <output name="ctd_out" ftype="xml">
        <assert_contents>
          <is_valid_xml/>
        </assert_contents>
      </output>
      <assert_stdout>
        <has_text_matching expression="@EXECUTABLE@ took .* \(wall\), .* \(CPU\), .* \(system\), .* \(user\)(; Peak Memory Usage: 32 MB)?."/>
      </assert_stdout>
    </test>
    <!-- TOPP_AccurateMassSearch_3 -->
    <test expect_num_outputs="3">
      <section name="adv_opts">
        <param name="force" value="false"/>
        <param name="test" value="true"/>
      </section>
      <param name="in" value="AccurateMassSearch_2_input.featureXML"/>
      <output name="out" value="AccurateMassSearch_3_output.mzTab" compare="sim_size" delta_frac="0.7" ftype="mztab"/>
      <param name="out_annotation_type" value="featureXML"/>
      <output name="out_annotation" value="AccurateMassSearch_2_output.featureXML" compare="sim_size" delta_frac="0.7" ftype="featurexml"/>
      <param name="positive_adducts" value="AMS_PositiveAdducts.tsv" ftype="tabular"/>
      <param name="negative_adducts" value="AMS_NegativeAdducts.tsv" ftype="tabular"/>
      <section name="db">
        <conditional name="mapping_cond">
          <param name="mapping" value="AMS_test_Mapping.tsv" ftype="tabular"/>
        </conditional>
        <conditional name="struct_cond">
          <param name="struct" value="AMS_test_Struct.tsv" ftype="tabular"/>
        </conditional>
      </section>
      <section name="algorithm">
        <param name="mass_error_value" value="5.0"/>
        <param name="mass_error_unit" value="ppm"/>
        <param name="ionization_mode" value="positive"/>
        <param name="isotopic_similarity" value="false"/>
        <param name="use_feature_adducts" value="false"/>
        <param name="keep_unidentified_masses" value="true"/>
        <param name="id_format" value="legacy"/>
        <section name="mzTab">
          <param name="exportIsotopeIntensities" value="false"/>
        </section>
      </section>
      <param name="OPTIONAL_OUTPUTS" value="ctd_out_FLAG,out_annotation_FLAG"/>
      <output name="ctd_out" ftype="xml">
        <assert_contents>
          <is_valid_xml/>
        </assert_contents>
      </output>
      <assert_stdout>
        <has_text_matching expression="@EXECUTABLE@ took .* \(wall\), .* \(CPU\), .* \(system\), .* \(user\)(; Peak Memory Usage: 32 MB)?."/>
      </assert_stdout>
    </test>
    <!-- TOPP_AccurateMassSearch_5 -->
    <test expect_num_outputs="3">
      <section name="adv_opts">
        <param name="force" value="false"/>
        <param name="test" value="true"/>
      </section>
      <param name="in" value="AccurateMassSearch_2_input.featureXML"/>
      <output name="out" value="AccurateMassSearch_5_output.mzTab" compare="sim_size" delta_frac="0.7" ftype="mztab"/>
      <param name="out_annotation_type" value="oms"/>
      <output name="out_annotation" value="AccurateMassSearch_5_output.tmp.oms" compare="sim_size" delta_frac="0.7" ftype="sqlite"/>
      <param name="positive_adducts" value="AMS_PositiveAdducts.tsv" ftype="tabular"/>
      <param name="negative_adducts" value="AMS_NegativeAdducts.tsv" ftype="tabular"/>
      <section name="db">
        <conditional name="mapping_cond">
          <param name="mapping" value="AMS_test_Mapping.tsv" ftype="tabular"/>
        </conditional>
        <conditional name="struct_cond">
          <param name="struct" value="AMS_test_Struct.tsv" ftype="tabular"/>
        </conditional>
      </section>
      <section name="algorithm">
        <param name="mass_error_value" value="5.0"/>
        <param name="mass_error_unit" value="ppm"/>
        <param name="ionization_mode" value="positive"/>
        <param name="isotopic_similarity" value="false"/>
        <param name="use_feature_adducts" value="false"/>
        <param name="keep_unidentified_masses" value="true"/>
        <param name="id_format" value="ID"/>
        <section name="mzTab">
          <param name="exportIsotopeIntensities" value="false"/>
        </section>
      </section>
      <param name="OPTIONAL_OUTPUTS" value="ctd_out_FLAG,out_annotation_FLAG"/>
      <output name="ctd_out" ftype="xml">
        <assert_contents>
          <is_valid_xml/>
        </assert_contents>
      </output>
      <assert_stdout>
        <has_text_matching expression="@EXECUTABLE@ took .* \(wall\), .* \(CPU\), .* \(system\), .* \(user\)(; Peak Memory Usage: 32 MB)?."/>
      </assert_stdout>
    </test>
    <!-- TOPP_AccurateMassSearch_6 -->
    <test expect_num_outputs="3">
      <section name="adv_opts">
        <param name="force" value="false"/>
        <param name="test" value="true"/>
      </section>
      <param name="in" value="AccurateMassSearch_2_input.featureXML"/>
      <output name="out" value="AccurateMassSearch_6_output.mzTab" compare="sim_size" delta_frac="0.7" ftype="mztab"/>
      <param name="out_annotation_type" value="featureXML"/>
      <output name="out_annotation" value="AccurateMassSearch_6_output.featureXML" compare="sim_size" delta_frac="0.7" ftype="featurexml"/>
      <param name="positive_adducts" value="AMS_PositiveAdducts.tsv" ftype="tabular"/>
      <param name="negative_adducts" value="AMS_NegativeAdducts.tsv" ftype="tabular"/>
      <section name="db">
        <conditional name="mapping_cond">
          <param name="mapping" value="AMS_test_Mapping.tsv" ftype="tabular"/>
        </conditional>
        <conditional name="struct_cond">
          <param name="struct" value="AMS_test_Struct.tsv" ftype="tabular"/>
        </conditional>
      </section>
      <section name="algorithm">
        <param name="mass_error_value" value="5.0"/>
        <param name="mass_error_unit" value="ppm"/>
        <param name="ionization_mode" value="positive"/>
        <param name="isotopic_similarity" value="false"/>
        <param name="use_feature_adducts" value="false"/>
        <param name="keep_unidentified_masses" value="true"/>
        <param name="id_format" value="ID"/>
        <section name="mzTab">
          <param name="exportIsotopeIntensities" value="false"/>
        </section>
      </section>
      <param name="OPTIONAL_OUTPUTS" value="ctd_out_FLAG,out_annotation_FLAG"/>
      <output name="ctd_out" ftype="xml">
        <assert_contents>
          <is_valid_xml/>
        </assert_contents>
      </output>
      <assert_stdout>
        <has_text_matching expression="@EXECUTABLE@ took .* \(wall\), .* \(CPU\), .* \(system\), .* \(user\)(; Peak Memory Usage: 32 MB)?."/>
      </assert_stdout>
    </test>
  </tests>
  <help><![CDATA[Match MS signals to molecules from a database by mass.


For more information, visit https://openms.de/doxygen/release/3.1.0/html/TOPP_AccurateMassSearch.html]]></help>
  <expand macro="references"/>
</tool>