diff OpenSwathDIAPreScoring.xml @ 11:c99d5004b74f draft

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3
author galaxyp
date Thu, 01 Dec 2022 19:20:01 +0000
parents e6ba7a995b35
children 986d14ec9394
line wrap: on
line diff
--- a/OpenSwathDIAPreScoring.xml	Fri Nov 06 20:16:12 2020 +0000
+++ b/OpenSwathDIAPreScoring.xml	Thu Dec 01 19:20:01 2022 +0000
@@ -1,13 +1,11 @@
 <?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: [Targeted Experiments]-->
-<tool id="OpenSwathDIAPreScoring" name="OpenSwathDIAPreScoring" version="@TOOL_VERSION@+galaxy@GALAXY_VERSION@" profile="20.05">
+<tool id="OpenSwathDIAPreScoring" name="OpenSwathDIAPreScoring" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="21.05">
   <description>Scoring spectra using the DIA scores.</description>
   <macros>
     <token name="@EXECUTABLE@">OpenSwathDIAPreScoring</token>
     <import>macros.xml</import>
-    <import>macros_autotest.xml</import>
-    <import>macros_test.xml</import>
   </macros>
   <expand macro="requirements"/>
   <expand macro="stdio"/>
@@ -18,9 +16,15 @@
 ## Preprocessing
 mkdir tr &&
 ln -s '$tr' 'tr/${re.sub("[^\w\-_]", "_", $tr.element_identifier)}.$gxy2omsext($tr.ext)' &&
-mkdir swath_files &&
-${ ' '.join(["ln -s '%s' 'swath_files/%s.%s' &&" % (_, re.sub('[^\w\-_]', '_', _.element_identifier), $gxy2omsext(_.ext)) for _ in $swath_files if _]) }
+mkdir swath_files_cond.swath_files &&
+#if $swath_files_cond.swath_files_select == "no"
+mkdir ${' '.join(["'swath_files_cond.swath_files/%s'" % (i) for i, f in enumerate($swath_files_cond.swath_files) if f])} && 
+${' '.join(["ln -s '%s' 'swath_files_cond.swath_files/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($swath_files_cond.swath_files) if f])}
+#else
+ln -s '$swath_files_cond.swath_files' 'swath_files_cond.swath_files/${re.sub("[^\w\-_]", "_", $swath_files_cond.swath_files.element_identifier)}.$gxy2omsext($swath_files_cond.swath_files.ext)' &&
+#end if
 mkdir output_files &&
+mkdir ${' '.join(["'output_files/%s'" % (i) for i, f in enumerate($swath_files_cond.swath_files) if f])} && 
 
 ## Main program call
 
@@ -31,12 +35,16 @@
 -tr
 'tr/${re.sub("[^\w\-_]", "_", $tr.element_identifier)}.$gxy2omsext($tr.ext)'
 -swath_files
-${' '.join(["'swath_files/%s.%s'"%(re.sub('[^\w\-_]', '_', _.element_identifier), $gxy2omsext(_.ext)) for _ in $swath_files if _])}
+#if $swath_files_cond.swath_files_select == "no"
+${' '.join(["'swath_files_cond.swath_files/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($swath_files_cond.swath_files) if f])}
+#else
+'swath_files_cond.swath_files/${re.sub("[^\w\-_]", "_", $swath_files_cond.swath_files.element_identifier)}.$gxy2omsext($swath_files_cond.swath_files.ext)'
+#end if
 -output_files
-${' '.join(["'output_files/%s.%s'"%(re.sub('[^\w\-_]', '_', _.element_identifier), $gxy2omsext("tabular")) for _ in $swath_files if _])}
+${' '.join(["'output_files/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext("tabular")) for i, f in enumerate($swath_files_cond.swath_files) if f])}
 
 ## Postprocessing
-${' '.join(["&& mv -n 'swath_files/%(id)s.%(gext)s' 'output_files/%(id)s'"%{"id": re.sub('[^\w\-_]', '_', _.element_identifier), "gext": $gxy2omsext("tabular")} for _ in $output_files if _])}
+${' '.join(["&& mv -n 'output_files/%(bn)s/%(id)s.%(gext)s' 'output_files/%(bn)s/%(id)s'"%{"bn": i, "id": re.sub('[^\w\-_]', '_', f.element_identifier), "gext": $gxy2omsext("tabular")} for i, f in enumerate($swath_files_cond.swath_files) if f])}
 #if "ctd_out_FLAG" in $OPTIONAL_OUTPUTS
   && mv '@EXECUTABLE@.ctd' '$ctd_out'
 #end if]]></command>
@@ -45,13 +53,24 @@
     <configfile name="hardcoded_json"><![CDATA[{"log": "log.txt", "threads": "\${GALAXY_SLOTS:-1}", "no_progress": true}]]></configfile>
   </configfiles>
   <inputs>
-    <param name="tr" argument="-tr" type="data" format="traml" optional="false" label="transition file" help=" select traml data sets(s)"/>
-    <param name="swath_files" argument="-swath_files" type="data" format="mzml" multiple="true" optional="false" label="Swath files that were used to extract the transitions" help="If present, SWATH specific scoring will be applied select mzml data sets(s)"/>
-    <param name="min_upper_edge_dist" argument="-min_upper_edge_dist" type="float" optional="true" value="0.0" label="Minimal distance to the edge to still consider a precursor, in Thomson (only in SWATH)" help=""/>
+    <param argument="-tr" type="data" format="traml" optional="false" label="transition file" help=" select traml data sets(s)"/>
+    <conditional name="swath_files_cond">
+      <param name="swath_files_select" type="select" label="Run tool in batch mode for -swath_files">
+        <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="-swath_files" type="data" format="mzml" multiple="true" optional="false" label="Swath files that were used to extract the transitions" help="If present, SWATH specific scoring will be applied select mzml data sets(s)"/>
+      </when>
+      <when value="yes">
+        <param argument="-swath_files" type="data" format="mzml" multiple="false" optional="false" label="Swath files that were used to extract the transitions" help="If present, SWATH specific scoring will be applied select mzml data sets(s)"/>
+      </when>
+    </conditional>
+    <param argument="-min_upper_edge_dist" type="float" optional="true" value="0.0" label="Minimal distance to the edge to still consider a precursor, in Thomson (only in SWATH)" help=""/>
     <expand macro="adv_opts_macro">
-      <param name="force" argument="-force" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Overrides 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 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">
@@ -60,19 +79,33 @@
   </inputs>
   <outputs>
     <collection type="list" name="output_files" label="${tool.name} on ${on_string}: output_files">
-      <discover_datasets directory="output_files" format="tabular" pattern="__name__"/>
+      <discover_datasets directory="output_files" recurse="true" format="tabular" pattern="__name__"/>
     </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>
-    <expand macro="autotest_OpenSwathDIAPreScoring"/>
-    <expand macro="manutest_OpenSwathDIAPreScoring"/>
-  </tests>
+  <tests><!-- data from a test that included all the needed test files -->
+  <test>
+    <param name="tr" value="OpenSwathWorkflow_1_input.TraML"/>
+    <param name="swath_files" value="OpenSwathAnalyzer_2_swathfile.mzML"/>
+    <output_collection name="output_files" count="1">
+      <element name="OpenSwathAnalyzer_2_swathfile_mzML" file="OpenSwathDIAPreScoring.tsv" ftype="tabular"/>
+    </output_collection>
+  </test>
+  <!-- test with two inputs (actually the same file .. symlinked) -->
+  <test>
+    <param name="tr" value="OpenSwathWorkflow_1_input.TraML"/>
+    <param name="swath_files" value="OpenSwathDIAPreScoring_in1.mzML,OpenSwathDIAPreScoring_in2.mzML"/>
+    <output_collection name="output_files" count="2">
+      <element name="OpenSwathDIAPreScoring_in1_mzML" file="OpenSwathDIAPreScoring_2_1.tsv" ftype="tabular"/>
+      <element name="OpenSwathDIAPreScoring_in2_mzML" file="OpenSwathDIAPreScoring_2_2.tsv" ftype="tabular"/>
+    </output_collection>
+  </test>
+</tests>
   <help><![CDATA[Scoring spectra using the DIA scores.
 
 
-For more information, visit http://www.openms.de/doxygen/release/2.6.0/html/UTILS_OpenSwathDIAPreScoring.html]]></help>
+For more information, visit http://www.openms.de/doxygen/release/2.8.0/html/UTILS_OpenSwathDIAPreScoring.html]]></help>
   <expand macro="references"/>
 </tool>