view QualityControl.xml @ 5:ea02cc72f0b9 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:46:38 +0000
parents bd210b86fb5d
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: [Quality Control]-->
<tool id="QualityControl" name="QualityControl" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="21.05">
  <description>Computes various QC metrics from many possible input files (only the consensusXML is required). The more optional files you provide, the more metrics you get</description>
  <macros>
    <token name="@EXECUTABLE@">QualityControl</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_cm &&
cp '$in_cm' 'in_cm/${re.sub("[^\w\-_]", "_", $in_cm.element_identifier)}.$gxy2omsext($in_cm.ext)' &&
#if $in_raw_cond.in_raw:
  mkdir in_raw_cond.in_raw &&
  #if $in_raw_cond.in_raw_select == "no"
  mkdir ${' '.join(["'in_raw_cond.in_raw/%s'" % (i) for i, f in enumerate($in_raw_cond.in_raw) if f])} && 
  ${' '.join(["cp '%s' 'in_raw_cond.in_raw/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($in_raw_cond.in_raw) if f])}
  #else
  cp '$in_raw_cond.in_raw' 'in_raw_cond.in_raw/${re.sub("[^\w\-_]", "_", $in_raw_cond.in_raw.element_identifier)}.$gxy2omsext($in_raw_cond.in_raw.ext)' &&
  #end if
#end if
#if $in_postFDR_cond.in_postFDR:
  mkdir in_postFDR_cond.in_postFDR &&
  #if $in_postFDR_cond.in_postFDR_select == "no"
  mkdir ${' '.join(["'in_postFDR_cond.in_postFDR/%s'" % (i) for i, f in enumerate($in_postFDR_cond.in_postFDR) if f])} && 
  ${' '.join(["cp '%s' 'in_postFDR_cond.in_postFDR/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($in_postFDR_cond.in_postFDR) if f])}
  #else
  cp '$in_postFDR_cond.in_postFDR' 'in_postFDR_cond.in_postFDR/${re.sub("[^\w\-_]", "_", $in_postFDR_cond.in_postFDR.element_identifier)}.$gxy2omsext($in_postFDR_cond.in_postFDR.ext)' &&
  #end if
#end if
#if "out_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
  mkdir out &&
#end if
#if "out_cm_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
  mkdir out_cm &&
#end if
#if "out_feat_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
  mkdir out_feat &&
  mkdir ${' '.join(["'out_feat/%s'" % (i) for i, f in enumerate($in_postFDR_cond.in_postFDR) if f])} && 
#end if
#if $in_contaminants:
  mkdir in_contaminants &&
  cp '$in_contaminants' 'in_contaminants/${re.sub("[^\w\-_]", "_", $in_contaminants.element_identifier)}.$gxy2omsext($in_contaminants.ext)' &&
#end if
#if $in_fasta:
  mkdir in_fasta &&
  cp '$in_fasta' 'in_fasta/${re.sub("[^\w\-_]", "_", $in_fasta.element_identifier)}.$gxy2omsext($in_fasta.ext)' &&
#end if
#if $in_trafo_cond.in_trafo:
  mkdir in_trafo_cond.in_trafo &&
  #if $in_trafo_cond.in_trafo_select == "no"
  mkdir ${' '.join(["'in_trafo_cond.in_trafo/%s'" % (i) for i, f in enumerate($in_trafo_cond.in_trafo) if f])} && 
  ${' '.join(["cp '%s' 'in_trafo_cond.in_trafo/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($in_trafo_cond.in_trafo) if f])}
  #else
  cp '$in_trafo_cond.in_trafo' 'in_trafo_cond.in_trafo/${re.sub("[^\w\-_]", "_", $in_trafo_cond.in_trafo.element_identifier)}.$gxy2omsext($in_trafo_cond.in_trafo.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_cm
'in_cm/${re.sub("[^\w\-_]", "_", $in_cm.element_identifier)}.$gxy2omsext($in_cm.ext)'
#if $in_raw_cond.in_raw:
  -in_raw
  #if $in_raw_cond.in_raw_select == "no"
  ${' '.join(["'in_raw_cond.in_raw/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($in_raw_cond.in_raw) if f])}
  #else
  'in_raw_cond.in_raw/${re.sub("[^\w\-_]", "_", $in_raw_cond.in_raw.element_identifier)}.$gxy2omsext($in_raw_cond.in_raw.ext)'
  #end if
#end if
#if $in_postFDR_cond.in_postFDR:
  -in_postFDR
  #if $in_postFDR_cond.in_postFDR_select == "no"
  ${' '.join(["'in_postFDR_cond.in_postFDR/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($in_postFDR_cond.in_postFDR) if f])}
  #else
  'in_postFDR_cond.in_postFDR/${re.sub("[^\w\-_]", "_", $in_postFDR_cond.in_postFDR.element_identifier)}.$gxy2omsext($in_postFDR_cond.in_postFDR.ext)'
  #end if
#end if
#if "out_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
  -out
  'out/output.${gxy2omsext("mztab")}'
#end if
#if "out_cm_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
  -out_cm
  'out_cm/output.${gxy2omsext("consensusxml")}'
#end if
#if "out_feat_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
  -out_feat
  ${' '.join(["'out_feat/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext("featurexml")) for i, f in enumerate($in_postFDR_cond.in_postFDR) if f])}
#end if
#if $in_contaminants:
  -in_contaminants
  'in_contaminants/${re.sub("[^\w\-_]", "_", $in_contaminants.element_identifier)}.$gxy2omsext($in_contaminants.ext)'
#end if
#if $in_fasta:
  -in_fasta
  'in_fasta/${re.sub("[^\w\-_]", "_", $in_fasta.element_identifier)}.$gxy2omsext($in_fasta.ext)'
#end if
#if $in_trafo_cond.in_trafo:
  -in_trafo
  #if $in_trafo_cond.in_trafo_select == "no"
  ${' '.join(["'in_trafo_cond.in_trafo/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($in_trafo_cond.in_trafo) if f])}
  #else
  'in_trafo_cond.in_trafo/${re.sub("[^\w\-_]", "_", $in_trafo_cond.in_trafo.element_identifier)}.$gxy2omsext($in_trafo_cond.in_trafo.ext)'
  #end if
#end if
#if len(str($OPTIONAL_OUTPUTS).split(',')) == 0
  | tee '$stdout'
#end if

## Postprocessing
#if "out_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
  && mv 'out/output.${gxy2omsext("mztab")}' '$out'
#end if
#if "out_cm_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
  && mv 'out_cm/output.${gxy2omsext("consensusxml")}' '$out_cm'
#end if
#if "out_feat_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
  ${' '.join(["&& mv -n 'out_feat/%(bn)s/%(id)s.%(gext)s' 'out_feat/%(bn)s/%(id)s'"%{"bn": i, "id": re.sub('[^\w\-_]', '_', f.element_identifier), "gext": $gxy2omsext("featurexml")} for i, f in enumerate($in_postFDR_cond.in_postFDR) 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>
    <param argument="-in_cm" type="data" format="consensusxml" label="ConsensusXML input, generated by FeatureLinke" help=" select consensusxml data sets(s)"/>
    <conditional name="in_raw_cond">
      <param name="in_raw_select" type="select" label="Run tool in batch mode for -in_raw">
        <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_raw" type="data" format="mzml" multiple="true" optional="true" label="MzML input (after InternalCalibration, if available)" help=" select mzml data sets(s)"/>
      </when>
      <when value="yes">
        <param argument="-in_raw" type="data" format="mzml" optional="true" label="MzML input (after InternalCalibration, if available)" help=" select mzml data sets(s)"/>
      </when>
    </conditional>
    <conditional name="in_postFDR_cond">
      <param name="in_postFDR_select" type="select" label="Run tool in batch mode for -in_postFDR">
        <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_postFDR" type="data" format="featurexml" multiple="true" optional="true" label="FeatureXMLs after FDR filtering" help=" select featurexml data sets(s)"/>
      </when>
      <when value="yes">
        <param argument="-in_postFDR" type="data" format="featurexml" optional="true" label="FeatureXMLs after FDR filtering" help=" select featurexml data sets(s)"/>
      </when>
    </conditional>
    <param argument="-in_contaminants" type="data" format="fasta" optional="true" label="Proteins considered contaminants" help=" select fasta data sets(s)"/>
    <param argument="-in_fasta" type="data" format="fasta" optional="true" label="FASTA file used during MS/MS identification (including decoys)" help="If the protein description contains 'GN=...' then gene names will be extracted select fasta data sets(s)"/>
    <conditional name="in_trafo_cond">
      <param name="in_trafo_select" type="select" label="Run tool in batch mode for -in_trafo">
        <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_trafo" type="data" format="trafoxml" multiple="true" optional="true" label="trafoXMLs from MapAligners" help=" select trafoxml data sets(s)"/>
      </when>
      <when value="yes">
        <param argument="-in_trafo" type="data" format="trafoxml" optional="true" label="trafoXMLs from MapAligners" help=" select trafoxml data sets(s)"/>
      </when>
    </conditional>
    <param argument="-out_evd" type="text" optional="true" value="" label="If a Path is given, a MQEvidence txt-file will be created in this directory" help="If the directory does not exist, it will be created as well">
      <expand macro="list_string_san" name="out_evd"/>
    </param>
    <param argument="-out_msms" type="text" optional="true" value="" label="If a Path is given, a MQMsms txt-file will be created in this directory" help="If the directory does not exist, it will be created as well">
      <expand macro="list_string_san" name="out_msms"/>
    </param>
    <section name="FragmentMassError" title="Fragment Mass Error settings" help="" expanded="false">
      <param name="unit" argument="-FragmentMassError:unit" type="select" label="Unit for mass tolerance" help="'auto' uses information from FeatureXML">
        <option value="auto" selected="true">auto</option>
        <option value="ppm">ppm</option>
        <option value="da">da</option>
        <expand macro="list_string_san" name="unit"/>
      </param>
      <param name="tolerance" argument="-FragmentMassError:tolerance" type="float" value="20.0" label="m/z search window for matching peaks in two spectra" help=""/>
    </section>
    <section name="MS2_id_rate" title="MS2 ID Rate settings" help="" expanded="false">
      <param name="assume_all_target" argument="-MS2_id_rate:assume_all_target" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Forces the metric to run even if target/decoy annotation is missing (accepts all pep_ids as target hits)" help=""/>
    </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_FLAG">out (Output mzTab with QC information)</option>
      <option value="out_cm_FLAG">out_cm (ConsensusXML with QC information (as metavalues))</option>
      <option value="out_feat_FLAG">out_feat (FeatureXMLs with QC information (as metavalues))</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">
      <filter>OPTIONAL_OUTPUTS is not None and "out_FLAG" in OPTIONAL_OUTPUTS</filter>
    </data>
    <data name="out_cm" label="${tool.name} on ${on_string}: out_cm" format="consensusxml">
      <filter>OPTIONAL_OUTPUTS is not None and "out_cm_FLAG" in OPTIONAL_OUTPUTS</filter>
    </data>
    <collection type="list" name="out_feat" label="${tool.name} on ${on_string}: out_feat">
      <discover_datasets directory="out_feat" recurse="true" format="featurexml" pattern="__name__"/>
      <filter>OPTIONAL_OUTPUTS is not None and "out_feat_FLAG" in OPTIONAL_OUTPUTS</filter>
    </collection>
    <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_QualityControl_1 -->
    <test expect_num_outputs="3">
      <section name="adv_opts">
        <param name="force" value="false"/>
        <param name="test" value="true"/>
      </section>
      <param name="in_cm" value="QualityControl_1_in.consensusXML"/>
      <conditional name="in_raw_cond">
        <param name="in_raw" value="QualityControl_1_in1.mzML.gz,QualityControl_1_in2.mzML.gz,QualityControl_1_in3.mzML.gz"/>
      </conditional>
      <conditional name="in_postFDR_cond">
        <param name="in_postFDR" value="QualityControl_1_in1.featureXML,QualityControl_1_in2.featureXML,QualityControl_1_in3.featureXML"/>
      </conditional>
      <output name="out" value="QualityControl_1_out.mzTab" compare="sim_size" delta_frac="0.7" ftype="mztab"/>
      <output name="out_cm" value="QualityControl_1_out.consensusXML" compare="sim_size" delta_frac="0.7" ftype="consensusxml"/>
      <param name="in_contaminants" value="QualityControl_1.fasta"/>
      <param name="in_fasta" value="PeptideIndexer_1.fasta"/>
      <conditional name="in_trafo_cond">
        <param name="in_trafo" value="QualityControl_1_in1.trafoXML,QualityControl_1_in2.trafoXML,QualityControl_1_in3.trafoXML"/>
      </conditional>
      <param name="out_evd" value=""/>
      <param name="out_msms" value=""/>
      <section name="FragmentMassError">
        <param name="unit" value="auto"/>
        <param name="tolerance" value="20.0"/>
      </section>
      <section name="MS2_id_rate">
        <param name="assume_all_target" value="false"/>
      </section>
      <param name="OPTIONAL_OUTPUTS" value="ctd_out_FLAG,out_FLAG,out_cm_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[Computes various QC metrics from many possible input files (only the consensusXML is required). The more optional files you provide, the more metrics you get.


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