view FileMerger.xml @ 15:b2fc8da99bcc draft default tip

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3
author galaxyp
date Thu, 01 Dec 2022 19:10:42 +0000
parents 8b871a67ba56
children
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: [File Handling]-->
<tool id="FileMerger" name="FileMerger" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="21.05">
  <description>Merges several MS files into one file.</description>
  <macros>
    <token name="@EXECUTABLE@">FileMerger</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 out &&
#if "trafo_out_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
  mkdir rt_concat_trafo_out &&
  mkdir ${' '.join(["'rt_concat_trafo_out/%s'" % (i) for i, f in enumerate($in_cond.in) if f])} && 
#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
-out
'out/output.${out_type}'
#if "trafo_out_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
  -rt_concat:trafo_out
  ${' '.join(["'rt_concat_trafo_out/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext("trafoxml")) for i, f in enumerate($in_cond.in) if f])}
#end if
#if len(str($OPTIONAL_OUTPUTS).split(',')) == 0
  | tee '$stdout'
#end if

## Postprocessing
&& mv 'out/output.${out_type}' '$out'
#if "trafo_out_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
  ${' '.join(["&& mv -n 'rt_concat_trafo_out/%(bn)s/%(id)s.%(gext)s' 'rt_concat_trafo_out/%(bn)s/%(id)s'"%{"bn": i, "id": re.sub('[^\w\-_]', '_', f.element_identifier), "gext": $gxy2omsext("trafoxml")} for i, f in enumerate($in_cond.in) if f])}
#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="consensusxml,dta,dta2d,fasta,featurexml,mgf,mzdata,mzml,mzxml,traml" multiple="true" optional="false" label="Input files separated by blank" help=" select consensusxml,dta,dta2d,fasta,featurexml,mgf,mzdata,mzml,mzxml,traml data sets(s)"/>
      </when>
      <when value="yes">
        <param argument="-in" type="data" format="consensusxml,dta,dta2d,fasta,featurexml,mgf,mzdata,mzml,mzxml,traml" multiple="false" optional="false" label="Input files separated by blank" help=" select consensusxml,dta,dta2d,fasta,featurexml,mgf,mzdata,mzml,mzxml,traml data sets(s)"/>
      </when>
    </conditional>
    <param name="out_type" type="select" optional="false" label="File type of output out (Output file)">
      <option value="mzML">mzml</option>
      <option value="featureXML">featurexml</option>
      <option value="consensusXML">consensusxml</option>
      <option value="traML">traml</option>
      <option value="fasta">fasta</option>
    </param>
    <param argument="-annotate_file_origin" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Store the original filename in each feature using meta value &quot;file_origin&quot; (for featureXML and consensusXML only)" help=""/>
    <param argument="-append_method" type="select" optional="true" label="(ConsensusXML-only) Append quantitative information about features row-wise or column-wise" help="- 'append_rows' is usually used when the inputs come from the same MS run (e.g. caused by manual splitting or multiple algorithms on the same file). - 'append_cols' when you want to combine consensusXMLs from e.g. different fractions to be summarized in ProteinQuantifier or jointly exported with MzTabExporter">
      <option value="append_rows" selected="true">append_rows</option>
      <option value="append_cols">append_cols</option>
      <expand macro="list_string_san" name="append_method"/>
    </param>
    <section name="rt_concat" title="Options for concatenating files in the retention time (RT) dimension" help="The RT ranges of inputs are adjusted so they don't overlap in the merged file (traML input not supported)" expanded="false">
      <param name="gap" argument="-rt_concat:gap" type="float" optional="true" value="0.0" label="The amount of gap (in seconds) to insert between the RT ranges of different input files" help="RT concatenation is enabled if a value &gt; 0 is set"/>
    </section>
    <section name="raw" title="Options for raw data input/output (primarily for DTA files)" help="" expanded="false">
      <param name="rt_auto" argument="-raw:rt_auto" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Assign retention times automatically (integers starting at 1)" help=""/>
      <param name="rt_custom" argument="-raw:rt_custom" type="text" optional="true" value="" label="List of custom retention times that are assigned to the files" help="The number of given retention times must be equal to the number of input files (space separated list, in order to allow for spaces in list items surround them by single quotes)">
        <expand macro="list_float_valsan" name="rt_custom"/>
      </param>
      <param name="rt_filename" argument="-raw:rt_filename" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Try to guess the retention time of a file based on the filename" help="This option is useful for merging DTA files, where filenames should contain the string 'rt' directly followed by a floating point number, e.g. 'my_spectrum_rt2795.15.dta'"/>
      <param name="ms_level" argument="-raw:ms_level" type="integer" optional="true" value="0" label="If 1 or higher, this number is assigned to spectra as the MS level" help="This option is useful for DTA files which do not contain MS level information"/>
    </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" 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="trafo_out_FLAG">trafo_out (Output of retention time transformations that were applied to the input files to produce non-overlapping RT ranges)</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="consensusxml">
      <change_format>
        <when input="out_type" value="fasta" format="fasta"/>
        <when input="out_type" value="featureXML" format="featurexml"/>
        <when input="out_type" value="mzML" format="mzml"/>
        <when input="out_type" value="traML" format="traml"/>
      </change_format>
    </data>
    <collection type="list" name="rt_concat_trafo_out" label="${tool.name} on ${on_string}: rt_concat:trafo_out">
      <discover_datasets directory="rt_concat_trafo_out" recurse="true" format="trafoxml" pattern="__name__"/>
      <filter>OPTIONAL_OUTPUTS is not None and "trafo_out_FLAG" in OPTIONAL_OUTPUTS</filter>
    </collection>
    <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_FileMerger_2 -->
    <test expect_num_outputs="2">
      <section name="adv_opts">
        <param name="force" value="false"/>
        <param name="test" value="true"/>
      </section>
      <conditional name="in_cond">
        <param name="in" value="FileMerger_2_input1.dta,FileMerger_2_input2.dta" ftype="dta"/>
      </conditional>
      <param name="out_type" value="mzML"/>
      <output name="out" file="FileMerger_2_output.mzML" compare="sim_size" delta_frac="0.7" ftype="mzml"/>
      <param name="annotate_file_origin" value="false"/>
      <param name="append_method" value="append_rows"/>
      <section name="rt_concat">
        <param name="gap" value="0.0"/>
      </section>
      <section name="raw">
        <param name="rt_auto" value="false"/>
        <param name="rt_custom" value="5.0 10.0"/>
        <param name="rt_filename" value="false"/>
        <param name="ms_level" value="0"/>
      </section>
      <param name="OPTIONAL_OUTPUTS" value="ctd_out_FLAG"/>
      <output name="ctd_out" ftype="xml">
        <assert_contents>
          <is_valid_xml/>
        </assert_contents>
      </output>
    </test>
    <!-- TOPP_FileMerger_3 -->
    <test expect_num_outputs="2">
      <section name="adv_opts">
        <param name="force" value="false"/>
        <param name="test" value="true"/>
      </section>
      <conditional name="in_cond">
        <param name="in" value="FileMerger_3_input1.dta,FileMerger_3_input2.dta" ftype="dta"/>
      </conditional>
      <param name="out_type" value="mzML"/>
      <output name="out" file="FileMerger_3_output.mzML" compare="sim_size" delta_frac="0.7" ftype="mzml"/>
      <param name="annotate_file_origin" value="false"/>
      <param name="append_method" value="append_rows"/>
      <section name="rt_concat">
        <param name="gap" value="0.0"/>
      </section>
      <section name="raw">
        <param name="rt_auto" value="true"/>
        <param name="rt_custom" value=""/>
        <param name="rt_filename" value="false"/>
        <param name="ms_level" value="0"/>
      </section>
      <param name="OPTIONAL_OUTPUTS" value="ctd_out_FLAG"/>
      <output name="ctd_out" ftype="xml">
        <assert_contents>
          <is_valid_xml/>
        </assert_contents>
      </output>
    </test>
    <!-- TOPP_FileMerger_4 -->
    <test expect_num_outputs="2">
      <section name="adv_opts">
        <param name="force" value="false"/>
        <param name="test" value="true"/>
      </section>
      <conditional name="in_cond">
        <param name="in" value="FileMerger_4_input1.dta2d,FileMerger_4_input2.dta2d" ftype="dta2d"/>
      </conditional>
      <param name="out_type" value="mzML"/>
      <output name="out" file="FileMerger_4_output.mzML" compare="sim_size" delta_frac="0.7" ftype="mzml"/>
      <param name="annotate_file_origin" value="false"/>
      <param name="append_method" value="append_rows"/>
      <section name="rt_concat">
        <param name="gap" value="0.0"/>
      </section>
      <section name="raw">
        <param name="rt_auto" value="false"/>
        <param name="rt_custom" value=""/>
        <param name="rt_filename" value="false"/>
        <param name="ms_level" value="0"/>
      </section>
      <param name="OPTIONAL_OUTPUTS" value="ctd_out_FLAG"/>
      <output name="ctd_out" ftype="xml">
        <assert_contents>
          <is_valid_xml/>
        </assert_contents>
      </output>
    </test>
    <!-- TOPP_FileMerger_5 -->
    <test expect_num_outputs="2">
      <section name="adv_opts">
        <param name="force" value="false"/>
        <param name="test" value="true"/>
      </section>
      <conditional name="in_cond">
        <param name="in" value="FileMerger_5_input_rt1023.331.dta,FileMerger_5_input_rt2044.334.dta,FileMerger_5_input_rt889.32.dta" ftype="dta"/>
      </conditional>
      <param name="out_type" value="mzML"/>
      <output name="out" file="FileMerger_5_output.mzML" compare="sim_size" delta_frac="0.7" ftype="mzml"/>
      <param name="annotate_file_origin" value="false"/>
      <param name="append_method" value="append_rows"/>
      <section name="rt_concat">
        <param name="gap" value="0.0"/>
      </section>
      <section name="raw">
        <param name="rt_auto" value="false"/>
        <param name="rt_custom" value=""/>
        <param name="rt_filename" value="true"/>
        <param name="ms_level" value="2"/>
      </section>
      <param name="OPTIONAL_OUTPUTS" value="ctd_out_FLAG"/>
      <output name="ctd_out" ftype="xml">
        <assert_contents>
          <is_valid_xml/>
        </assert_contents>
      </output>
    </test>
    <!-- TOPP_FileMerger_6 -->
    <test expect_num_outputs="2">
      <section name="adv_opts">
        <param name="force" value="false"/>
        <param name="test" value="true"/>
      </section>
      <conditional name="in_cond">
        <param name="in" value="FileMerger_6_input1.mzML,FileMerger_6_input2.mzML"/>
      </conditional>
      <param name="out_type" value="mzML"/>
      <output name="out" file="FileMerger_6_output.mzML" compare="sim_size" delta_frac="0.7" ftype="mzml"/>
      <param name="annotate_file_origin" value="false"/>
      <param name="append_method" value="append_rows"/>
      <section name="rt_concat">
        <param name="gap" value="0.0"/>
      </section>
      <section name="raw">
        <param name="rt_auto" value="false"/>
        <param name="rt_custom" value=""/>
        <param name="rt_filename" value="false"/>
        <param name="ms_level" value="0"/>
      </section>
      <param name="OPTIONAL_OUTPUTS" value="ctd_out_FLAG"/>
      <output name="ctd_out" ftype="xml">
        <assert_contents>
          <is_valid_xml/>
        </assert_contents>
      </output>
    </test>
    <!-- TOPP_FileMerger_7 -->
    <test expect_num_outputs="2">
      <section name="adv_opts">
        <param name="force" value="false"/>
        <param name="test" value="true"/>
      </section>
      <conditional name="in_cond">
        <param name="in" value="FileMerger_7_input1.featureXML,FileMerger_7_input2.featureXML"/>
      </conditional>
      <param name="out_type" value="featureXML"/>
      <output name="out" file="FileMerger_7_output.featureXML" compare="sim_size" delta_frac="0.7" ftype="featurexml"/>
      <param name="annotate_file_origin" value="false"/>
      <param name="append_method" value="append_rows"/>
      <section name="rt_concat">
        <param name="gap" value="0.0"/>
      </section>
      <section name="raw">
        <param name="rt_auto" value="false"/>
        <param name="rt_custom" value=""/>
        <param name="rt_filename" value="false"/>
        <param name="ms_level" value="0"/>
      </section>
      <param name="OPTIONAL_OUTPUTS" value="ctd_out_FLAG"/>
      <output name="ctd_out" ftype="xml">
        <assert_contents>
          <is_valid_xml/>
        </assert_contents>
      </output>
    </test>
    <!-- TOPP_FileMerger_8 -->
    <test expect_num_outputs="2">
      <section name="adv_opts">
        <param name="force" value="false"/>
        <param name="test" value="true"/>
      </section>
      <conditional name="in_cond">
        <param name="in" value="FileMerger_8_input1.consensusXML,FileMerger_8_input2.consensusXML"/>
      </conditional>
      <param name="out_type" value="consensusXML"/>
      <output name="out" file="FileMerger_8_output.consensusXML" compare="sim_size" delta_frac="0.7" ftype="consensusxml"/>
      <param name="annotate_file_origin" value="false"/>
      <param name="append_method" value="append_rows"/>
      <section name="rt_concat">
        <param name="gap" value="0.0"/>
      </section>
      <section name="raw">
        <param name="rt_auto" value="false"/>
        <param name="rt_custom" value=""/>
        <param name="rt_filename" value="false"/>
        <param name="ms_level" value="0"/>
      </section>
      <param name="OPTIONAL_OUTPUTS" value="ctd_out_FLAG"/>
      <output name="ctd_out" ftype="xml">
        <assert_contents>
          <is_valid_xml/>
        </assert_contents>
      </output>
    </test>
    <!-- TOPP_FileMerger_9 -->
    <test expect_num_outputs="2">
      <section name="adv_opts">
        <param name="force" value="false"/>
        <param name="test" value="true"/>
      </section>
      <conditional name="in_cond">
        <param name="in" value="FileMerger_9_input1.traML,FileMerger_9_input2.traML"/>
      </conditional>
      <param name="out_type" value="traML"/>
      <output name="out" file="FileMerger_9_output.traML" compare="sim_size" delta_frac="0.7" ftype="traml"/>
      <param name="annotate_file_origin" value="false"/>
      <param name="append_method" value="append_rows"/>
      <section name="rt_concat">
        <param name="gap" value="0.0"/>
      </section>
      <section name="raw">
        <param name="rt_auto" value="false"/>
        <param name="rt_custom" value=""/>
        <param name="rt_filename" value="false"/>
        <param name="ms_level" value="0"/>
      </section>
      <param name="OPTIONAL_OUTPUTS" value="ctd_out_FLAG"/>
      <output name="ctd_out" ftype="xml">
        <assert_contents>
          <is_valid_xml/>
        </assert_contents>
      </output>
    </test>
    <!-- TOPP_FileMerger_10 -->
    <test expect_num_outputs="3">
      <section name="adv_opts">
        <param name="force" value="false"/>
        <param name="test" value="true"/>
      </section>
      <conditional name="in_cond">
        <param name="in" value="FileMerger_6_input2.mzML,FileMerger_6_input2_2.mzML"/>
      </conditional>
      <param name="out_type" value="mzML"/>
      <output name="out" file="FileMerger_10_output.mzML" compare="sim_size" delta_frac="0.7" ftype="mzml"/>
      <param name="annotate_file_origin" value="false"/>
      <param name="append_method" value="append_rows"/>
      <section name="rt_concat">
        <param name="gap" value="10.0"/>
      </section>
      <output_collection name="rt_concat_trafo_out" count="2"/>
      <section name="raw">
        <param name="rt_auto" value="false"/>
        <param name="rt_custom" value=""/>
        <param name="rt_filename" value="false"/>
        <param name="ms_level" value="0"/>
      </section>
      <param name="OPTIONAL_OUTPUTS" value="ctd_out_FLAG,trafo_out_FLAG"/>
      <output name="ctd_out" ftype="xml">
        <assert_contents>
          <is_valid_xml/>
        </assert_contents>
      </output>
    </test>
    <!-- TOPP_FileMerger_11 -->
    <test expect_num_outputs="2">
      <section name="adv_opts">
        <param name="force" value="false"/>
        <param name="test" value="true"/>
      </section>
      <conditional name="in_cond">
        <param name="in" value="FileMerger_8_input1.consensusXML,FileMerger_8_input2.consensusXML"/>
      </conditional>
      <param name="out_type" value="consensusXML"/>
      <output name="out" file="FileMerger_11_output.consensusXML" compare="sim_size" delta_frac="0.7" ftype="consensusxml"/>
      <param name="annotate_file_origin" value="false"/>
      <param name="append_method" value="append_cols"/>
      <section name="rt_concat">
        <param name="gap" value="0.0"/>
      </section>
      <section name="raw">
        <param name="rt_auto" value="false"/>
        <param name="rt_custom" value=""/>
        <param name="rt_filename" value="false"/>
        <param name="ms_level" value="0"/>
      </section>
      <param name="OPTIONAL_OUTPUTS" value="ctd_out_FLAG"/>
      <output name="ctd_out" ftype="xml">
        <assert_contents>
          <is_valid_xml/>
        </assert_contents>
      </output>
    </test>
  </tests>
  <help><![CDATA[Merges several MS files into one file.


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