changeset 26:626d3db664ef draft

planemo upload for repository https://github.com/workflow4metabolomics/xcms commit b1ebca6e0188e0aa0645e67259d6729ce80a6bdf
author lecorguille
date Wed, 22 Mar 2017 16:04:45 -0400
parents dc4d3e2b9968
children 8e46e9bd7c50
files Makefile README.rst abims_xcms_xcmsSet.xml destinations_input_type.py job_conf.xml.sample
diffstat 5 files changed, 90 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Thu Mar 02 08:20:04 2017 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-# USAGE: make [install|clean]
-
-# -------- VARIABLE --------
-
-OBJ=xcms_set.tgz
-DEP=abims_xcms_xcmsSet.xml tool_dependencies.xml repository_dependencies.xml static test-data
-
-
-# ------------------------
-
-all: $(OBJ)
-
-$(OBJ): $(DEP)
-	tar --exclude=".svn" -zchf $@ $^
-
-# ------------------------
-
-install: $(OBJ)
-	mv *.tgz ~
-
-clean:
-	rm *.tgz
-
--- a/README.rst	Thu Mar 02 08:20:04 2017 -0500
+++ b/README.rst	Wed Mar 22 16:04:45 2017 -0400
@@ -1,11 +1,33 @@
+Job Dynamic Destination Mapping
+-------------------------------
+
+**Why**
+
+xcmsSet wrapper allow both individual file and zip file which can contain several samples.
+Thus, it can be interesting to adjust the number of thread according to the input type.
+For example: 1 thread for a single mzXML or NetCDF file and 8 threads for a zip file.
+
+**What**
+
+The [Dynamic Destination Mapping](https://galaxyproject.org/admin/config/jobs/#dynamic-destination-mapping) allow Galaxy to choose a destination at runtime based on factors such as the job inputs, user submitting the job, cluster status, etc...
+
+**How**
+
+ - The file `destinations_input_type.py` (shiped with this tool) must be place in `lib/galaxy/jobs/rules/`
+ - The `job_conf.xml` must be inspired by the `job_conf.xml.sample` shiped with this tool
+ - The final destination names must match between the `job_conf.xml` and the `destinations_input_type.py`
+ - Restart Galaxy
+
 
 Changelog/News
 --------------
 
-**Version 2.1.0 - 03/02/2017**
+**Version 2.1.0 - 22/02/2017**
 
 - NEW: The W4M tools will be able now to take as input a single file. It will allow to submit in parallel several files and merge them afterward using "xcms.xcmsSet Merger" before "xcms.group".
 
+- BUGFIX: the default value of "matchedFilter" -> "Step size to use for profile generation" which was of 0.01 have been changed to fix with the XMCS default values to 0.1
+
 **Version 2.0.11 - 22/12/2016**
 
 - BUGFIX: propose scanrange for all methods
@@ -53,4 +75,3 @@
 - IMPROVEMENT: new datatype/dataset formats (rdata.xcms.raw, rdata.xcms.group, rdata.xcms.retcor ...) will facilitate the sequence of tools and so avoid incompatibility errors.
 
 - IMPROVEMENT: parameter labels have changed to facilitate their reading.
-
--- a/abims_xcms_xcmsSet.xml	Thu Mar 02 08:20:04 2017 -0500
+++ b/abims_xcms_xcmsSet.xml	Wed Mar 22 16:04:45 2017 -0400
@@ -48,9 +48,8 @@
                 ## sigma "$methods.options_m.sigma"
                 max $methods.options_m.max
                 snthresh $methods.options_m.snthresh
-                ## mzdiff $methods.options_m.mzdiff
                 steps $methods.options_m.steps
-                ## sleep $methods.options_m.sleep
+                mzdiff $methods.options_m.mzdiff
             #end if
         #elif $methods.method == "MSW":
             snthr $methods.snthr
@@ -109,7 +108,7 @@
                     </param>
                     <when value="show">
                         <param name="snthresh" type="integer" value="10" label="Signal/Noise threshold" help="[snthresh] Signal to noise ratio cutoff" />
-                        <param name="mzdiff" type="float" value="-0.001" label="Min m/z difference" help="[mzdiff] Min m/z difference for peaks with overlapping RT " />
+                        <param name="mzdiff" type="float" value="-0.001" label="Minimum difference in m/z for peaks with overlapping retention times" help="[mzdiff] Can be negative to allow overlap" />
                         <param name="integrate" type="select" label="peak limits method" help="[integrate]" >
                             <option value="1">peak limits based on smoothed 2nd derivative (less precise)</option>
                             <option value="2">peak limits based on real data (more sensitive to noise)</option>
@@ -124,7 +123,7 @@
 
             <!-- matched Filter options -->
             <when value="matchedFilter">
-                <param name="step" type="float" value="0.01" label="Step size to use for profile generation" help="[step] The peak detection algorithm creates extracted ion base peak chromatograms (EIBPC) on a fixed step size" />
+                <param name="step" type="float" value="0.1" label="Step size to use for profile generation" help="[step] The peak detection algorithm creates extracted ion base peak chromatograms (EIBPC) on a fixed step size" />
                 <param name="fwhm" type="integer" value="30" label="Full width at half maximum of matched filtration gaussian model peak" help="[fwhm] Only used to calculate the actual sigma" />
                 <conditional name="options_m">
                     <param name="option" type="select" label="Advanced options" >
@@ -132,15 +131,11 @@
                         <option value="hide" selected="true">hide</option>
                     </param>
                     <when value="show">
-<!--
-                        <param name="sigma" type="hidden" value="fwhm/2.3548" label="sigma" help="standard deviation (fwhm/2.3548)" />
--->
+                        <!--<param name="sigma" type="float" value="12.739935451" label="Standard deviation (width) of matched filtration model peak" help="[sigma] By default: fwhm/2.3548" />-->
                         <param name="max" type="integer" value="5" label="Maximum number of peaks per extracted ion chromatogram" help="[max]" />
                         <param name="snthresh" type="integer" value="10" label="Signal to noise ratio cutoff" help="[snthresh]" />
                         <param name="steps" type="integer" value="2" label="Number of steps to merge prior to filtration" help="[steps] The peak identification algorithm combines a given number of EIBPCs prior to filtration and peak detection, as defined by the steps argument" />
-<!--
-                        <param name="mzdiff" type="text" size="20" value="0.8-step*steps" label="m/z difference" help="min m/z difference for peaks with overlapping RT " />
--->
+                        <param name="mzdiff" type="float" value="0.6" label="Minimum difference in m/z for peaks with overlapping Retention Times" help="[mzdiff] By default: 0.8-step*steps " />
                     </when>
                     <when value="hide">
                     </when>
@@ -562,10 +557,12 @@
 Changelog/News
 --------------
 
-**Version 2.1.0 - 03/02/2017**
+**Version 2.1.0 - 22/02/2017**
 
 - NEW: The W4M tools will be able now to take as input a single file. It will allow to submit in parallel several files and merge them afterward using "xcms.xcmsSet Merger" before "xcms.group".
 
+- BUGFIX: the default value of "matchedFilter" -> "Step size to use for profile generation" which was of 0.01 have been changed to fix with the XMCS default values to 0.1
+
 **Version 2.0.11 - 22/12/2016**
 
 - BUGFIX: propose scanrange for all methods
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/destinations_input_type.py	Wed Mar 22 16:04:45 2017 -0400
@@ -0,0 +1,23 @@
+from galaxy.jobs import JobDestination
+import logging
+import os
+
+'''
+This file must be placed in lib/galaxy/jobs/rules/
+'''
+
+def input_type(job):
+    '''
+    This function checks the input file format/extension and decide which destination in the job_conf.xml using
+     - If it's a zip file, we will launch the job in multi-thread mode (-pe thread 8)
+     - If it's an individual file (mzxml, mzml, mzdata or netcdf), the job will use for instance (-pe thread 1)
+    '''
+    log = logging.getLogger(__name__)
+    inp_data = dict( [ ( da.name, da.dataset ) for da in job.input_datasets ] )
+    inp_data.update( [ ( da.name, da.dataset ) for da in job.input_library_datasets ] )
+    input_extension = inp_data[ "input" ].extension
+    log.debug("The input extension is %s" % input_extension)
+    if input_extension in ["mzxml","mzml","mzdata","netcdf"]:
+        return 'thread1-men_free10'
+    else: # zip file
+        return 'thread4-men_free10'
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/job_conf.xml.sample	Wed Mar 22 16:04:45 2017 -0400
@@ -0,0 +1,36 @@
+<?xml version="1.0"?>
+<!-- A sample job config that explicitly configures job running the way it is configured by default (if there is no explicit config). -->
+<job_conf>
+    <plugins>
+        <plugin id="local" type="runner" load="galaxy.jobs.runners.local:LocalJobRunner" workers="4"/>
+        <plugin id="sge" load="galaxy.jobs.runners.drmaa:DRMAAJobRunner" type="runner"/>
+        <plugin id="dynamic" type="runner" >
+            <param id="rules_module">galaxy.jobs.rules</param>
+        </plugin>
+    </plugins>
+    <handlers>
+        <handler id="main"/>
+    </handlers>
+    <destinations default="sge_default">
+        <destination id="local" runner="local"/>
+        <destination id="sge_default" runner="sge">
+             <param id="nativeSpecification">-V -w n -q galaxy.q</param>
+        </destination>
+        
+        <destination id="thread1-men_free10" runner="sge">
+             <param id="nativeSpecification">-V -w n -q galaxy.q -pe thread 1 -R y -l mem_free=10G </param>
+        </destination>
+        <destination id="thread4-men_free10" runner="sge">
+            <param id="nativeSpecification">-V -w n -q galaxy.q -pe thread 4 -R y -l mem_free=10G </param>
+        </destination>
+
+        <destination id="python_destination_input_type" runner="dynamic">
+            <param id="type">python</param>
+            <param id="function">input_type</param>
+        </destination>
+    </destinations>
+    <tools>
+        <tool destination="python_destination_input_type" id="abims_xcms_xcmsSet" />
+        <tool destination="local" id="upload1"/>
+    </tools>
+</job_conf>