diff mzmine_batch.xml @ 1:90d60c9da21e draft default tip

planemo upload for repository https://github.com/workflow4metabolomics/tools-metabolomics/blob/master/tools/mzmine/ commit 889d26f1e96edf1f2608ce0dba2d66e8ee60e313
author iuc
date Fri, 10 Nov 2023 14:20:45 +0000
parents 02e802817d48
children
line wrap: on
line diff
--- a/mzmine_batch.xml	Sat Oct 21 10:29:31 2023 +0000
+++ b/mzmine_batch.xml	Fri Nov 10 14:20:45 2023 +0000
@@ -1,6 +1,6 @@
 <tool id="mzmine_batch" name="MZMine batch" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="21.05">
     <macros>
-        <token name="@TOOL_VERSION@">3.6.0</token>
+        <token name="@TOOL_VERSION@">3.9.0</token>
         <token name="@VERSION_SUFFIX@">0</token>
     </macros>
     <xrefs>
@@ -8,6 +8,7 @@
     </xrefs>
     <requirements>
         <requirement type="package" version="@TOOL_VERSION@">mzmine</requirement>
+        <requirement type="package" version="3.11">python</requirement>
     </requirements>
     <command detect_errors="exit_code"><![CDATA[
     #import re
@@ -30,9 +31,16 @@
     ## modify output paths in batch XML to relative path
     ## - any output will be redirected to ./output/BASENAME
     mkdir -p output/ &&
-    
-    sed -e 's@<current_file>.*[\\\/]\([^\\\/]\+\)</current_file>@<current_file>./output/\1</current_file>@' '$batch' > batch.xml &&
+    python '$__tool_directory__/set_path.py'
+        --input '$batch'
+        --output batch.xml
+    #if $localdb
+        --localdb '$localdb'
+    #end if
+    &&
 
+    ## https://github.com/mzmine/mzmine3/issues/1534
+    JAVA_OPTS="-XX:ActiveProcessorCount=\${GALAXY_SLOTS:-1}"
     mzmine
         --batch 'batch.xml'
         --input 'input.txt'
@@ -54,6 +62,7 @@
         <param argument="--batch" type="data" format="xml" label="MZMine batch file" help="XML batch file (ideally created with version @TOOL_VERSION@)"/>
         <param argument="--input" type="data" format="mzml,mzxml,csv" multiple="true" label="Spectra (mzml)"/>
         <param argument="--libraries" type="data" format="json,mgf,msp" multiple="true" optional="true" label="Spectral libraries"/>
+        <param name="localdb" type="data" format="csv,tsv,tabular,txt" optional="true" label="Local database" help="For 'Custom database search'"/>
     </inputs>
     <outputs>
         <collection name="output" type="list">
@@ -61,13 +70,10 @@
         </collection>
     </outputs>
     <tests>
-        <test>
+        <!-- <test>
             <param name="batch" value="test_small.xml" ftype="xml"/>
-            <param name="input" value="DOM_a.mzML,DOM_b.mzXML"/>
+            <param name="input" location="https://raw.githubusercontent.com/mzmine/mzmine3/v@TOOL_VERSION@/src/test/resources/rawdatafiles/DOM_a.mzML,https://raw.githubusercontent.com/mzmine/mzmine3/v@TOOL_VERSION@/src/test/resources/rawdatafiles/DOM_b.mzXML"/>
             <param name="libraries" value="GNPS-FAULKNERLEGACY.json" ftype="json"/>
-            <!-- <param name="input" location="https://raw.githubusercontent.com/mzmine/mzmine3/master/src/test/resources/rawdatafiles/DOM_a.mzML"/> -->
-            <!-- <param name="input" location="https://raw.githubusercontent.com/mzmine/mzmine3/master/src/test/resources/rawdatafiles/DOM_a.mzML,https://raw.githubusercontent.com/mzmine/mzmine3/master/src/test/resources/rawdatafiles/DOM_b.mzXML"/>
-            <param name="libraries" location="https://external.gnps2.org/gnpslibrary/GNPS-FAULKNERLEGACY.json" ftype="json"/> -->
             <output_collection name="output" count="3" type="list">
                 <element name="test2_iimn_gnps" ftype="mgf">
                     <assert_contents>
@@ -88,7 +94,51 @@
                     </assert_contents>
                 </element>
             </output_collection>
-        </test>
+            <assert_stderr>
+                <has_text text="INFO: Starting processing of task Local CSV identification using database" negate="true"/>
+                <has_text text="INFO: Finished a batch of 11 steps"/>
+            </assert_stderr>
+        </test> -->
+        <!-- test with localdb -->
+        <!-- <test>
+            <param name="batch" value="test_localdatabase.xml" ftype="xml"/>
+            <param name="input" location="https://raw.githubusercontent.com/mzmine/mzmine3/v@TOOL_VERSION@/src/test/resources/rawdatafiles/DOM_a.mzML,https://raw.githubusercontent.com/mzmine/mzmine3/v@TOOL_VERSION@/src/test/resources/rawdatafiles/DOM_b.mzXML"/>
+            <param name="libraries" value="GNPS-FAULKNERLEGACY.json" ftype="json"/>
+            <param name="localdb" value="local_database.csv" ftype="csv"/>
+            <output_collection name="output" count="3" type="list">
+                <element name="test2_iimn_gnps" ftype="mgf">
+                    <assert_contents>
+                        <has_n_lines n="2103"/>
+                        <has_text text="BEGIN IONS"/>
+                    </assert_contents>
+                </element>
+                <element name="test2_iimn_gnps_quant" ftype="csv">
+                    <assert_contents>
+                        <has_n_lines n="34"/>
+                        <has_n_columns sep="," n="16"/>
+                    </assert_contents>
+                </element>
+                <element name="test2_sirius" ftype="mgf">
+                    <assert_contents>
+                        <has_n_lines n="54406"/>
+                        <has_text text="BEGIN IONS"/>
+                    </assert_contents>
+                </element>
+            </output_collection>
+            <assert_stderr>
+                <has_text text="INFO: Starting processing of task Local CSV identification using database"/>
+                <has_text text="INFO: Finished a batch of 12 steps"/>
+            </assert_stderr>
+        </test> -->
+        <!-- test with localdb in batch, but user does not provide one-->
+        <!-- <test expect_failure="true" expect_exit_code="1">
+            <param name="batch" value="test_localdatabase.xml" ftype="xml"/>
+            <param name="input" location="https://raw.githubusercontent.com/mzmine/mzmine3/v@TOOL_VERSION@/src/test/resources/rawdatafiles/DOM_a.mzML,https://raw.githubusercontent.com/mzmine/mzmine3/v@TOOL_VERSION@/src/test/resources/rawdatafiles/DOM_b.mzXML"/>
+            <param name="libraries" value="GNPS-FAULKNERLEGACY.json" ftype="json"/>
+            <assert_stderr>
+                <has_text text="Batch file contains LocalCSVDatabaseSearchModule but no local DB CSV file given"/>
+            </assert_stderr>
+        </test> -->
     </tests>
     <help><![CDATA[
         MZmine 3 is an open-source software for mass-spectrometry data processing, with the main focus on LC-MS data.
@@ -102,6 +152,13 @@
         - Input spectra in mzml format
         - Spectra libraries in mgf or json format (optional)
 
+        If the batch file contains steps requiring input data sets these need to be provided
+        via the optional inputs. Currently this is: 
+
+        - 'Local database' for a 'Custom database search' (LocalCSVDatabaseSearchModule) step 
+
+        Please open an issue if inputs for other steps are needed: https://github.com/galaxyproject/tools-iuc/issues/new
+
         **Outputs**
 
         Galaxy will store all outputs of MZMine in a single collection. When specifying the batch XML
@@ -126,4 +183,4 @@
     <citations>
         <citation type="doi">10.1038/s41587-023-01690-2</citation>
     </citations>
-</tool>
\ No newline at end of file
+</tool>