view IDMassAccuracy.xml @ 15:585f8235da7e draft

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3
author galaxyp
date Thu, 01 Dec 2022 18:58:59 +0000
parents 31bc4129f589
children 0819fd9da302
line wrap: on
line source

<?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="IDMassAccuracy" name="IDMassAccuracy" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="21.05">
  <description>Calculates a distribution of the mass error from given mass spectra and IDs.</description>
  <macros>
    <token name="@EXECUTABLE@">IDMassAccuracy</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_cond.in &&
#if $in_cond.in_select == "no"
mkdir ${' '.join(["'in_cond.in/%s'" % (i) for i, f in enumerate($in_cond.in) if f])} && 
${' '.join(["ln -s '%s' 'in_cond.in/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($in_cond.in) if f])}
#else
ln -s '$in_cond.in' 'in_cond.in/${re.sub("[^\w\-_]", "_", $in_cond.in.element_identifier)}.$gxy2omsext($in_cond.in.ext)' &&
#end if
mkdir id_in_cond.id_in &&
#if $id_in_cond.id_in_select == "no"
mkdir ${' '.join(["'id_in_cond.id_in/%s'" % (i) for i, f in enumerate($id_in_cond.id_in) if f])} && 
${' '.join(["ln -s '%s' 'id_in_cond.id_in/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($id_in_cond.id_in) if f])}
#else
ln -s '$id_in_cond.id_in' 'id_in_cond.id_in/${re.sub("[^\w\-_]", "_", $id_in_cond.id_in.element_identifier)}.$gxy2omsext($id_in_cond.id_in.ext)' &&
#end if
#if "out_precursor_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
  mkdir out_precursor &&
#end if
#if "out_fragment_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
  mkdir out_fragment &&
#end if
#if "out_precursor_fit_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
  mkdir out_precursor_fit &&
#end if
#if "out_fragment_fit_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
  mkdir out_fragment_fit &&
#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
#if $in_cond.in_select == "no"
${' '.join(["'in_cond.in/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($in_cond.in) if f])}
#else
'in_cond.in/${re.sub("[^\w\-_]", "_", $in_cond.in.element_identifier)}.$gxy2omsext($in_cond.in.ext)'
#end if
-id_in
#if $id_in_cond.id_in_select == "no"
${' '.join(["'id_in_cond.id_in/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($id_in_cond.id_in) if f])}
#else
'id_in_cond.id_in/${re.sub("[^\w\-_]", "_", $id_in_cond.id_in.element_identifier)}.$gxy2omsext($id_in_cond.id_in.ext)'
#end if
#if "out_precursor_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
  -out_precursor
  'out_precursor/output.${gxy2omsext("tabular")}'
#end if
#if "out_fragment_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
  -out_fragment
  'out_fragment/output.${gxy2omsext("tabular")}'
#end if
#if "out_precursor_fit_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
  -out_precursor_fit
  'out_precursor_fit/output.${gxy2omsext("tabular")}'
#end if
#if "out_fragment_fit_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
  -out_fragment_fit
  'out_fragment_fit/output.${gxy2omsext("tabular")}'
#end if
#if len(str($OPTIONAL_OUTPUTS).split(',')) == 0
  | tee '$stdout'
#end if

## Postprocessing
#if "out_precursor_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
  && mv 'out_precursor/output.${gxy2omsext("tabular")}' '$out_precursor'
#end if
#if "out_fragment_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
  && mv 'out_fragment/output.${gxy2omsext("tabular")}' '$out_fragment'
#end if
#if "out_precursor_fit_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
  && mv 'out_precursor_fit/output.${gxy2omsext("tabular")}' '$out_precursor_fit'
#end if
#if "out_fragment_fit_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
  && mv 'out_fragment_fit/output.${gxy2omsext("tabular")}' '$out_fragment_fit'
#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>
    <conditional name="in_cond">
      <param name="in_select" type="select" label="Run tool in batch mode for -in">
        <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 argument="-in" type="data" format="mzml" multiple="true" optional="false" label="Input mzML file list, containing the spectra" help=" select mzml data sets(s)"/>
      </when>
      <when value="yes">
        <param argument="-in" type="data" format="mzml" multiple="false" optional="false" label="Input mzML file list, containing the spectra" help=" select mzml data sets(s)"/>
      </when>
    </conditional>
    <conditional name="id_in_cond">
      <param name="id_in_select" type="select" label="Run tool in batch mode for -id_in">
        <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 argument="-id_in" type="data" format="idxml" multiple="true" optional="false" label="Input idXML file list, containing the identifications" help=" select idxml data sets(s)"/>
      </when>
      <when value="yes">
        <param argument="-id_in" type="data" format="idxml" multiple="false" optional="false" label="Input idXML file list, containing the identifications" help=" select idxml data sets(s)"/>
      </when>
    </conditional>
    <param argument="-precursor_error_ppm" type="boolean" truevalue="true" falsevalue="false" checked="false" label="If this flag is used, the precursor mass tolerances are estimated in ppm instead of Da" help=""/>
    <param argument="-fragment_error_ppm" type="boolean" truevalue="true" falsevalue="false" checked="false" label="If this flag is used, the fragment mass tolerances are estimated in ppm instead of Da" help=""/>
    <param argument="-fragment_mass_tolerance" type="float" optional="true" value="0.5" label="Maximal fragment mass tolerance which is allowed for MS/MS spectra, used for the calculation of matching ions" help=""/>
    <expand macro="adv_opts_macro">
      <param argument="-number_of_bins" type="integer" optional="true" min="10" value="100" label="Number of bins that should be used to calculate the histograms for the fitting" help=""/>
      <param argument="-force" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Overrides tool-specific checks" help=""/>
      <param argument="-test" type="hidden" optional="true" value="False" label="Enables the test mode (needed for internal use only)" help="">
        <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_precursor_FLAG">out_precursor (Output file which contains the deviations from the precursors)</option>
      <option value="out_fragment_FLAG">out_fragment (Output file which contains the fragment ion m/z deviations)</option>
      <option value="out_precursor_fit_FLAG">out_precursor_fit (Gaussian fit to the histogram of mass deviations from the precursors)</option>
      <option value="out_fragment_fit_FLAG">out_fragment_fit (Gaussian fit to the histogram of mass deviations from the fragments)</option>
      <option value="ctd_out_FLAG">Output used ctd (ini) configuration file</option>
    </param>
  </inputs>
  <outputs>
    <data name="out_precursor" label="${tool.name} on ${on_string}: out_precursor" format="tabular">
      <filter>OPTIONAL_OUTPUTS is not None and "out_precursor_FLAG" in OPTIONAL_OUTPUTS</filter>
    </data>
    <data name="out_fragment" label="${tool.name} on ${on_string}: out_fragment" format="tabular">
      <filter>OPTIONAL_OUTPUTS is not None and "out_fragment_FLAG" in OPTIONAL_OUTPUTS</filter>
    </data>
    <data name="out_precursor_fit" label="${tool.name} on ${on_string}: out_precursor_fit" format="tabular">
      <filter>OPTIONAL_OUTPUTS is not None and "out_precursor_fit_FLAG" in OPTIONAL_OUTPUTS</filter>
    </data>
    <data name="out_fragment_fit" label="${tool.name} on ${on_string}: out_fragment_fit" format="tabular">
      <filter>OPTIONAL_OUTPUTS is not None and "out_fragment_fit_FLAG" in OPTIONAL_OUTPUTS</filter>
    </data>
    <data name="stdout" format="txt" label="${tool.name} on ${on_string}: stdout">
      <filter>OPTIONAL_OUTPUTS is None</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_IDMassAccuracy_1 -->
    <test expect_num_outputs="5">
      <section name="adv_opts">
        <param name="number_of_bins" value="10"/>
        <param name="force" value="false"/>
        <param name="test" value="true"/>
      </section>
      <conditional name="in_cond">
        <param name="in" value="spectra.mzML"/>
      </conditional>
      <conditional name="id_in_cond">
        <param name="id_in" value="MSGFPlusAdapter_1_out.idXML"/>
      </conditional>
      <output name="out_precursor" file="IDMassAccuracy_1_out_precursor.tsv" compare="sim_size" delta_frac="0.7" ftype="tabular"/>
      <param name="precursor_error_ppm" value="false"/>
      <output name="out_fragment" file="IDMassAccuracy_1_out_fragment.tsv" compare="sim_size" delta_frac="0.7" ftype="tabular"/>
      <param name="fragment_error_ppm" value="false"/>
      <param name="fragment_mass_tolerance" value="0.5"/>
      <output name="out_precursor_fit" file="IDMassAccuracy_1_out_precursor_fit.tsv" compare="sim_size" delta_frac="0.7" ftype="tabular"/>
      <output name="out_fragment_fit" file="IDMassAccuracy_1_out_fragment_fit.tsv" compare="sim_size" delta_frac="0.7" ftype="tabular"/>
      <param name="OPTIONAL_OUTPUTS" value="ctd_out_FLAG,out_precursor_FLAG,out_fragment_FLAG,out_precursor_fit_FLAG,out_fragment_fit_FLAG"/>
      <output name="ctd_out" ftype="xml">
        <assert_contents>
          <is_valid_xml/>
        </assert_contents>
      </output>
    </test>
  </tests>
  <help><![CDATA[Calculates a distribution of the mass error from given mass spectra and IDs.


For more information, visit http://www.openms.de/doxygen/release/2.8.0/html/UTILS_IDMassAccuracy.html]]></help>
  <expand macro="references"/>
</tool>