changeset 8:2cb130282060 draft

Uploaded
author lecorguille
date Wed, 23 Dec 2015 11:07:20 -0500
parents e18100ba8c10
children 17d585d877ee
files abims_xcms_report.xml abims_xcms_retcor.xml planemo.sh repository_dependencies.xml static/images/xcms_retcor.png static/images/xcms_retcor_workflow.png test-data/.svn/entries test-data/.svn/props/fillpeaks.RData.svn-work test-data/fillpeaks.RData test-data/log.txt test-data/report.html test-data/sacuri.zip test-data/xset.group.RData test-data/xset.group.retcor.BPCs_corrected.pdf test-data/xset.group.retcor.RData test-data/xset.group.retcor.Rplots.pdf test-data/xset.group.retcor.TICs_corrected.pdf tool_dependencies.xml xcms_report.r
diffstat 19 files changed, 412 insertions(+), 277 deletions(-) [+]
line wrap: on
line diff
--- a/abims_xcms_report.xml	Wed Dec 23 09:30:57 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-<tool id="abims_xcms_report" name="xcms.report" version="0.1.0">
-    
-    <description>Create a report of XCMS analysis</description>
-    
-    <requirements>
-        <requirement type="package" version="3.1.2">R</requirement>
-        <requirement type="binary">Rscript</requirement>
-        <requirement type="package" version="1.44.0">xcms</requirement>
-    </requirements>
-    
-    <stdio>
-        <exit_code range="1:" level="fatal" />
-    </stdio>
-    
-    <command interpreter="Rscript"><![CDATA[
-        xcms_report.r
-
-        image $image 
-        htmlOutput $htmlOutput
-        user_email $__user_email__
-       
-    ]]></command>
-    
-    <inputs>
-
-        <param name="image" type="data" format="rdata.xcms.raw,rdata.xcms.group,rdata.xcms.retcor,rdata.xcms.fillpeaks,rdata" label="xset RData file" help="output file from another function xcms (xcmsSet, group, retcor, fillpeaks etc.)" />
-
-    </inputs>
-    
-    <outputs>
-        <data name="htmlOutput" format="html" label="xcms report html" />
-    </outputs>
-    
-    <tests>
-        <test>
-            <param name="image" value="fillpeaks.RData" />
-            <output name="htmlOutput" file="report.html" />
-        </test>
-    </tests>
-    
-    <help><![CDATA[
-
-.. class:: infomark
-
-**Galaxy integration** ABiMS TEAM - UPMC/CNRS - Station biologique de Roscoff part of Workflow4Metabolomics.org [W4M]
-
- | Contact support@workflow4metabolomics.org for any questions or concerns about the Galaxy implementation of this tool.
-
----------------------------------------------------
-
-============
-Xcms.report
-============
-
------------
-Description
------------
-
-This tool provide a HTML report which summarizes your analysis using the [W4M] XCMS and CAMERA tools 
-
-
-    ]]></help>
-
-
-    <citations>
-        <citation type="doi">10.1093/bioinformatics/btu813</citation>
-    </citations>
-
-</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/abims_xcms_retcor.xml	Wed Dec 23 11:07:20 2015 -0500
@@ -0,0 +1,301 @@
+<tool id="abims_xcms_retcor" name="xcms.retcor" version="2.0.4">
+
+    <description>Retention Time Correction using retcor function from xcms R package </description>
+
+    <requirements>
+        <requirement type="package" version="3.1.2">R</requirement>
+        <requirement type="binary">Rscript</requirement>
+        <requirement type="package" version="1.44.0">xcms</requirement>
+        <requirement type="package" version="2.1">xcms_w4m_script</requirement>
+    </requirements>
+
+    <stdio>
+        <exit_code range="1:" level="fatal" />
+    </stdio>
+
+    <command><![CDATA[
+        xcms.r 
+        image $image 
+        xfunction retcor 
+
+        xsetRdataOutput $xsetRData
+        ticspdf $ticsCorPdf
+        bicspdf $bpcsCorPdf
+        rplotspdf $rplotsPdf
+
+        method $methods.method
+        #if $methods.method == "obiwarp":
+            profStep $methods.profStep
+        #else
+            smooth $methods.smooth
+            extra $methods.extra
+            missing $methods.missing
+            #if $methods.options.option == "show":
+                span $methods.options.span
+                family $methods.options.family
+                plottype $methods.options.plottype
+            #end if
+        #end if
+        #if $zip_file:
+            zipfile $zip_file
+        #end if
+        ;
+        return=\$?;
+        mv log.txt $log;
+        cat $log;
+        sh -c "exit \$return"
+        
+    ]]></command>
+
+    <inputs>
+        <param name="image" type="data" format="rdata.xcms.raw,rdata.xcms.group,rdata" label="xset RData file" help="output file from another function xcms (xcmsSet, retcor etc.)" />
+        <conditional name="methods">
+            <param name="method" type="select" label="Method to use for retention time correction" help="[method] See the help section below" >
+                <option value="obiwarp" >obiwarp</option>
+                <option value="peakgroups" selected="peakgroups">peakgroups</option>
+            </param>
+            <when value="obiwarp">
+                <param name="profStep" type="float" value="1" label="Step size (in m/z)" help="[profStep] to use for profile generation from the raw data files" />
+            </when> 
+            <when value="peakgroups">   
+                <param name="smooth" type="select" label="Smooth method" help="[smooth] either 'loess’ for non-linear alignment or ‘linear’ for linear alignment" >
+                    <option value="loess">loess</option>
+                    <option value="linear">linear</option>
+                </param>
+                <param name="extra" type="integer" value="1" label="Number of extra peaks to allow in retention time correction correction groups" help="[extra]" />
+                <param name="missing" type="integer" value="1" label="Number of missing samples to allow in retention time correction groups" help="[missing]" />
+                <conditional name="options">
+                    <param name="option" type="select" label="Advanced options">
+                        <option value="show">show</option>
+                        <option value="hide" selected="true">hide</option>
+                    </param>
+                    <when value="show">
+                        <param name="span" type="float" value="0.2" label="Degree of smoothing for local polynomial regression fitting" help="[span]"/>
+                        
+                        <param name="family" type="select" label="Family" help="[family] if gaussian fitting is by least-squares with no outlier removal, and if symmetric a re descending M estimator is used with Tukey's biweight function, allowing outlier removal">
+                            <option value="gaussian" selected="true">gaussian</option>
+                            <option value="symmetric">symmetric</option>
+                        </param>
+
+                        <param name="plottype" type="select" help="[plottype] if deviation plot retention time deviation points and regression fit, and if mdevden also plot peak overall peak density and retention time correction peak density">
+                            <option value="none" selected="true">none</option>
+                            <option value="deviation">deviation</option>
+                            <option value="mdevden">mdevden</option>
+                        </param>
+                    </when>
+                    <when value="hide">
+                    </when>
+                </conditional>
+            </when>
+        </conditional>
+        <!-- To pass planemo test -->
+        <param name="zip_file" type="hidden_data" format="no_unzip.zip" label="Zip file" />
+    </inputs>
+
+    <outputs>
+        <data name="xsetRData" format="rdata.xcms.retcor" label="${image.name[:-6]}.retcor.RData" />
+        <data name="rplotsPdf" format="pdf"  label="${image.name[:-6]}.retcor.Rplots.pdf">
+            <filter>(methods['method'] == 'peakgroups')</filter>
+            <filter>(options['option'] == 'show')</filter>
+            <filter>(family == 'symmetric')</filter>
+            <filter>(plottype != 'none')</filter>
+        </data>
+        <data name="ticsCorPdf"   format="pdf"  label="${image.name[:-6]}.retcor.TICs_corrected.pdf" />
+        <data name="bpcsCorPdf"   format="pdf" label="${image.name[:-6]}.retcor.BPCs_corrected.pdf" />
+        <data name="log" format="txt" label="xset.log.txt"  hidden="true" />
+    </outputs>
+    
+    <tests>
+        <test>
+            <param name="image" value="xset.group.RData"/>
+            <param name="methods.method" value="peakgroups"/>
+            <param name="methods.smooth" value="loess"/>
+            <param name="methods.extra" value="1"/>
+            <param name="methods.missing" value="1"/>
+            <param name="methods.options.option" value="show"/>
+            <param name="methods.options.span" value="0.2"/>
+            <param name="methods.options.family" value="gaussian"/>
+            <param name="methods.options.plottype" value="deviation"/>
+            <param name="zip_file" value="sacuri.zip"/>
+            <!--<output name="xsetRData" file="xset.group.retcor.RData" />-->
+            <!--<output name="rplotsPdf" file="xset.group.retcor.Rplots.pdf" />-->
+            <!--<output name="ticsCorPdf" file="xset.group.retcor.TICs_corrected.pdf" />-->
+            <!--<output name="bpcsCorPdf" file="xset.group.retcor.BPCs_corrected.pdf" />-->
+            <output name="log">
+                <assert_contents>
+                    <has_text text="object with 9 samples" />
+                    <has_text text="Time range: 0.7-1139.9 seconds (0-19 minutes)" />
+                    <has_text text="Mass range: 50.0019-999.9863 m/z" />
+                    <has_text text="Peaks: 135846 (about 15094 per sample)" />
+                    <has_text text="Peak Groups: 0" />
+                    <has_text text="Sample classes: bio, blank" />
+                </assert_contents>
+            </output>
+        </test>
+    </tests>
+
+    <help><![CDATA[
+
+        
+.. class:: infomark
+
+**Authors**  Colin A. Smith csmith@scripps.edu, Ralf Tautenhahn rtautenh@gmail.com, Steffen Neumann sneumann@ipb-halle.de, Paul Benton hpaul.benton08@imperial.ac.uk and Christopher Conley cjconley@ucdavis.edu 
+
+.. class:: infomark
+
+**Galaxy integration** ABiMS TEAM - UPMC/CNRS - Station biologique de Roscoff and Yann Guitton yann.guitton@univ-nantes.fr - part of Workflow4Metabolomics.org [W4M]
+
+ | Contact support@workflow4metabolomics.org for any questions or concerns about the Galaxy implementation of this tool.
+
+
+
+---------------------------------------------------
+
+===========
+Xcms.retcor
+===========
+
+-----------
+Description
+-----------
+
+After matching peaks into groups, xcms can use those groups to identify and correct 
+correlated drifts in retention time from run to run. The aligned peaks can then be 
+used for a second pass of peak grouping which will be more accurate than the first. 
+The whole process can be repeated in an iterative fashion. Not all peak groups will be helpful 
+for identifying retention time drifts. Some groups may be missing peaks from a large 
+fraction of samples and thus provide an incomplete picture of the drift at that time point. 
+Still others may contain multiple peaks from the same sample, which is a sign of impropper grouping.
+
+.. class:: warningmark
+
+**After an retcor step, it is mandatory to do a group step, otherwise the rest of the workflow will not work with the RData file. (the initial peak grouping becomes invalid and is
+discarded)**
+
+
+
+-----------------
+Workflow position
+-----------------
+
+
+**Upstream tools**
+
+========================= ================= ======= ==========
+Name                      output file       format  parameter
+========================= ================= ======= ==========
+xcms.group                xset.group.RData  RData   RData file
+========================= ================= ======= ==========
+
+
+**Downstream tools**
+
++---------------------------+------------------+--------+
+| Name                      | Output file      | Format |
++===========================+==================+========+
+|xcms.group                 | xset.retcor.RData| RData  |
++---------------------------+------------------+--------+
+
+The output file **xset.retcor.RData** is an RData file. You can continue your analysis using it in **xcms.group** tool as an next step.
+
+
+**General schema of the metabolomic workflow**
+
+.. image:: xcms_retcor_workflow.png
+
+
+-----------
+Input files
+-----------
+
++---------------------------+----------------------+
+| Parameter : num + label   |   Format             |
++===========================+======================+
+| 1 : RData file            |   rdata.xcms.group   |
++---------------------------+----------------------+
+
+
+----------
+Parameters
+----------
+
+Method
+------
+
+**peakgroups**
+
+    | xcms ignores those groups by only considering well-behaved peak groups which are missing at most one sample and have at most one extra peak. (Those values can be changed with the **missing** and **extra** arguments.)
+    | For each of those well-behaved groups, the algorithm calculates a median retention time and, for every sample, a deviation from that median. Within a sample, the observed deviation generally changes over time in a nonlinear fashion. Those changes are approximated using a local polynomial regression technique implemented in the **loess** function. By default, the curve fitting is done using least-squares on all data points.
+    | However, it is possible to enable outlier detection and removal by setting the **family** argument to **symmetric**.
+
+**obiwarp**
+
+    | Calculate retention time deviations for each sample using the obiwarp code at "http://obi-warp.sourceforge.net/". This function is able to align multiple samples by a center-star strategy. Ordered Bijective Interpolated Warping (OBI-Warp) aligns matrices along a single axis using Dynamic Time Warping (DTW) and a one-to-one (bijective) interpolated warp function. OBI-Warp harnesses the non-linear, comprehensive alignment power of DTW and builds on the discrete, non-bijective output of DTW to give natural interpolants that can be used across multiple datasets.
+    | For the original publication see :**Chromatographic Alignment of ESI-LC-MS Proteomics Data Sets by Ordered Bijective Interpo-lated Warping John T. Prince and, Edward M. Marcotte Analytical Chemistry 2006 78 (17), 6140-6152.**
+
+
+------------
+Output files
+------------
+
+xset.group.retcor.TICs_corrected.pdf
+
+    | "Total Ion Chromatograms" graph in pdf format,corrected after a retcor step.
+
+xset.group.retcor.BPCs_corrected.pdf
+
+    | "Total Io"Base Peak Chromatograms" graph in pdf format,corrected after a retcor step
+
+xset.group.retcor.RData: rdata.xcms.retcor format
+
+    | Rdata file that will be necessary in the **xcms.group** step of the workflow.
+    
+    
+------
+
+.. class:: infomark 
+
+The output file is an xset.retcor.RData file. You can continue your analysis using it in **xcms.fillPeaks** tool.
+
+    
+---------------------------------------------------
+
+---------------
+Working example
+---------------
+
+Input files
+-----------
+
+    | RData file -> **xset.group.RData**
+
+Parameters
+----------
+
+    | Method: -> **peakgroups**
+    | smooth: -> **loess**
+    | extra: -> **1**
+    | missing -> **1**
+    | Advanced options: -> **show**
+    | span -> **0.2**
+    | family -> **gaussian**
+    | plottype -> **deviation**
+    
+
+Output files
+------------
+
+    | **1) xset.group.retcor.RData: RData file**
+
+    | **2) Example of an xset.group.retcor.TICs_corrected pdf file**
+
+.. image:: xcms_retcor.png
+
+    ]]></help>
+
+    <citations>
+        <citation type="doi">10.1021/ac051437y</citation>
+        <citation type="doi">10.1093/bioinformatics/btu813</citation>
+    </citations>
+
+</tool>
--- a/planemo.sh	Wed Dec 23 09:30:57 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-planemo shed_init -f --name=xcms_report --owner=lecorguille --description="[W4M][GC-MS] XCMS R Package - Preprocessing - HTML Report for XCMS analysis" --homepage_url="http://workflow4metabolomics.org" --long_description="Part of the W4M project: http://workflow4metabolomics.org\n\nXCMS: http://www.bioconductor.org/packages/release/bioc/html/xcms.html\n\nThis tool create a HTML report of XCMS analysis" --category="Metabolomics"
--- a/repository_dependencies.xml	Wed Dec 23 09:30:57 2015 -0500
+++ b/repository_dependencies.xml	Wed Dec 23 11:07:20 2015 -0500
@@ -1,4 +1,5 @@
 <?xml version="1.0"?>
 <repositories>
-	<repository name="rdata_xcms_datatypes" owner="lecorguille" />
+    <repository changeset_revision="9ed593071db2" name="no_unzip_datatype" owner="lecorguille" toolshed="https://testtoolshed.g2.bx.psu.edu" />
+    <repository changeset_revision="bff835d58914" name="rdata_xcms_datatypes" owner="lecorguille" toolshed="https://testtoolshed.g2.bx.psu.edu" />
 </repositories>
Binary file static/images/xcms_retcor.png has changed
Binary file static/images/xcms_retcor_workflow.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/.svn/entries	Wed Dec 23 11:07:20 2015 -0500
@@ -0,0 +1,49 @@
+10
+
+dir
+0
+svn+ssh://lecorguille@svn.sb-roscoff.fr/svn/logiciel/galaxy-workflow4metabo/xcms_report/test-data
+svn+ssh://lecorguille@svn.sb-roscoff.fr/svn/logiciel/galaxy-workflow4metabo
+add
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+87d02074-be8c-4456-a071-04b64888326c
+
+fillpeaks.RData
+file
+
+
+
+add
+
+
+
+
+
+has-props
+has-prop-mods
+
+report.html
+file
+
+
+
+add
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/.svn/props/fillpeaks.RData.svn-work	Wed Dec 23 11:07:20 2015 -0500
@@ -0,0 +1,5 @@
+K 13
+svn:mime-type
+V 24
+application/octet-stream
+END
Binary file test-data/fillpeaks.RData has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/log.txt	Wed Dec 23 11:07:20 2015 -0500
@@ -0,0 +1,52 @@
+	PACKAGE INFO
+parallel	3.1.2
+BiocGenerics	0.14.0
+Biobase	2.28.0
+Rcpp	0.12.0
+mzR	2.2.2
+xcms	1.44.0
+snow	0.3.13
+batch	1.1.4
+
+
+	ARGUMENTS INFO
+image	test-data/xset.group.RData
+xfunction	retcor
+xsetRdataOutput	test-data/xset.group.retcor.RData
+ticspdf	xset.group.retcor.TICs_corrected.pdf
+bicspdf	xset.group.retcor.BPCs_corrected.pdf
+rplotspdf	xset.group.retcor.Rplots.pdf
+method	obiwarp
+profStep	1
+zipfile	test-data/sacuri.zip
+
+
+	INFILE PROCESSING INFO
+
+
+	ARGUMENTS PROCESSING INFO
+
+
+	MAIN PROCESSING INFO
+center sample:  HU_neg_060 
+Processing: HU_neg_028  HU_neg_051  HU_neg_017  HU_neg_034  Blanc09  Blanc06  Blanc12  Blanc04  
+null device 
+          1 
+
+
+	XSET OBJECT INFO
+An "xcmsSet" object with 9 samples
+
+Time range: 0.7-1139.9 seconds (0-19 minutes)
+Mass range: 50.0019-999.9863 m/z
+Peaks: 135846 (about 15094 per sample)
+Peak Groups: 0 
+Sample classes: bio, blank 
+
+Profile settings: method = bin
+                  step = 0.01
+
+Memory usage: 13.8 MB
+
+
+	DONE
--- a/test-data/report.html	Wed Dec 23 09:30:57 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-<!DOCTYPE html>
-<HTML lang='en'>
-<HEAD>
-<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
-<title>[W4M] XCMS analysis report</title>
-<style>
-table { min-width: 500px; border:1px solid #D6B161; border-collapse:collapse;}
-th { background: #898989; text-align:left;}
-tr { border: 1px solid #000000 }
-h2 { color: #FFA212; }
-ul li { margin-bottom:10px; }
-</style>
-</HEAD>
-<BODY>
-<h1>___ XCMS analysis report using Workflow4Metabolomics ___</h1>
-<h2>Samples used:</h2>
-<table
-<tr><th>sample</th><th>filename</th></tr>
-<tr><td> HU_neg_051 </td><td> sacuri//bio2/HU_neg_051.mzXML </td></tr><tr><td> HU_neg_060 </td><td> sacuri//bio2/HU_neg_060.mzXML </td></tr><tr><td> HU_neg_017 </td><td> sacuri//bio/HU_neg_017.mzXML </td></tr><tr><td> HU_neg_028 </td><td> sacuri//bio/HU_neg_028.mzXML </td></tr><tr><td> Blanc04 </td><td> sacuri//blank/Blanc04.mzXML </td></tr><tr><td> Blanc06 </td><td> sacuri//blank/Blanc06.mzXML </td></tr>
-</table>
-<h2>Function launched:</h2>
-<table>
-<tr><th>timestamp<br />(ymd-h:m:s)</th><th>function</th><th>argument</th><th>value</th></tr>
-<tr><td rowspan='4'>151221-16:20:54</td><td rowspan='4'>xcmsSet</td>
-<td>nSlaves</td><td>1</td></tr>
-<tr><td>method</td><td>matchedFilter</td></tr>
-<tr><td>step</td><td>0.01</td></tr>
-<tr><td>fwhm</td><td>30</td></tr>
-<tr><td rowspan='5'>151221-16:37:00</td><td rowspan='5'>group</td>
-<td>method</td><td>density</td></tr>
-<tr><td>sleep</td><td>0.001</td></tr>
-<tr><td>minfrac</td><td>0.5</td></tr>
-<tr><td>bw</td><td>30</td></tr>
-<tr><td>mzwid</td><td>0.25</td></tr>
-<tr><td rowspan='1'>151221-16:37:20</td><td rowspan='1'>fillPeaks</td>
-<td>method</td><td>chrom</td></tr>
-</table>
-<h2>Information about the xcmsSet object:</h2>
-<pre>
-An "xcmsSet" object with 6 samples
-
-Time range: 16.3-1138.9 seconds (0.3-19 minutes)
-Mass range: 61.9883-481.2446 m/z
-Peaks: 1799 (about 300 per sample)
-Peak Groups: 289 
-Sample classes: bio, bio2, blank 
-
-Profile settings: method = bin
-                  step = 0.01
-
-Memory usage: 0.421 MB
-</pre>
-<h2>Citations:</h2>
-<ul>
-<li>To cite the <b>XCMS</b> package in publications use:
-<ul>
-<li>Smith, C.A. and Want, E.J. and O'Maille, G. and Abagyan,R. and Siuzdak, G.XCMS: Processing mass spectrometry data for metabolite profiling using nonlinear peak alignment, matching and identification, Analytical Chemistry, 78:779-787 (2006)</li>
-<li>Ralf Tautenhahn, Christoph Boettcher, Steffen Neumann: Highly sensitive feature detection for high resolution LC/MS BMC Bioinformatics, 9:504 (2008)</li>
-<li>H. Paul Benton, Elizabeth J. Want and Timothy M. D. Ebbels Correction of mass calibration gaps in liquid chromatography-mass spectrometry metabolomics data Bioinformatics, 26:2488 (2010)</li>
-</ul>
-</li>
-<li>To cite the <b>CAMERA</b> package in publications use:
-<ul>
-<li>Kuhl, C., Tautenhahn, R., Boettcher, C., Larson, T. R. and Neumann,S. CAMERA: an integrated strategy for compound spectra extraction and annotation of liquid chromatography/mass spectrometry data sets. Analytical Chemistry, 84:283-289 (2012)</li>
-</ul>
-</li>
-<li>To cite the <b>Workflow4Metabolimics (W4M)</b> project in publications use:
-<ul>
-<li>Franck Giacomoni, Gildas Le Corguillé, Misharl Monsoor, Marion Landi, Pierre Pericard, Mélanie Pétéra, Christophe Duperier, Marie Tremblay-Franco, Jean-François Martin, Daniel Jacob, Sophie Goulitquer, Etienne A. Thévenot and Christophe Caron (2014). Workflow4Metabolomics: A collaborative research infrastructure for computational metabolomics. Bioinformatics  doi:10.1093/bioinformatics/btu813</li>
-</ul>
-</li>
-</ul>
-</BODY>
-</HTML>
Binary file test-data/sacuri.zip has changed
Binary file test-data/xset.group.RData has changed
Binary file test-data/xset.group.retcor.BPCs_corrected.pdf has changed
Binary file test-data/xset.group.retcor.RData has changed
Binary file test-data/xset.group.retcor.Rplots.pdf has changed
Binary file test-data/xset.group.retcor.TICs_corrected.pdf has changed
--- a/tool_dependencies.xml	Wed Dec 23 09:30:57 2015 -0500
+++ b/tool_dependencies.xml	Wed Dec 23 11:07:20 2015 -0500
@@ -6,4 +6,7 @@
     <package name="xcms" version="1.44.0">
         <repository changeset_revision="8ea252413ed6" name="package_r_xcms_1_44_0" owner="lecorguille" toolshed="https://testtoolshed.g2.bx.psu.edu" />
     </package>
+    <package name="xcms_w4m_script" version="2.1">
+        <repository changeset_revision="af163ca0ac33" name="package_xcms_w4m_script_2_1" owner="lecorguille" toolshed="https://testtoolshed.g2.bx.psu.edu" />
+    </package>
 </tool_dependency>
--- a/xcms_report.r	Wed Dec 23 09:30:57 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-#!/usr/local/public/bin/Rscript --vanilla --slave --no-site-file
-# version="0.1.0"
-#@author Gildas Le Corguille lecorguille@sb-roscoff.fr ABIMS TEAM
-
-
-
-# ----- ARGUMENTS BLACKLIST -----
-#xcms.r
-argBlacklist=c("zipfile","xfunction","xsetRdataOutput","sampleMetadataOutput","ticspdf","bicspdf","rplotspdf")
-#CAMERA.r
-argBlacklist=c(argBlacklist,"dataMatrixOutput","variableMetadataOutput","new_file_path")
-
-# ----- PACKAGE -----
-
-pkgs=c("parallel","BiocGenerics", "Biobase", "Rcpp", "mzR", "xcms","snow","batch")
-for(pkg in pkgs) {
-	suppressPackageStartupMessages( stopifnot( library(pkg, quietly=TRUE, logical.return=TRUE, character.only=TRUE)))
-}
-
-
-# ----- FUNCTION -----
-writehtml = function(...) { cat(...,"\n", file=htmlOutput,append = TRUE,sep="") }
-
-
-# ----- ARGUMENTS -----
-
-listArguments = parseCommandArgs(evaluate=FALSE) #interpretation of arguments given in command line as an R list of objects
-
-
-# ----- ARGUMENTS PROCESSING -----
-
-#image is an .RData file necessary to use xset variable given by previous tools
-load(listArguments[["image"]]);
-
-htmlOutput = "report.html"
-if (!is.null(listArguments[["htmlOutput"]])){
-	htmlOutput = listArguments[["htmlOutput"]];
-}
-
-user_email = NULL
-if (!is.null(listArguments[["user_email"]])){
-	user_email = listArguments[["user_email"]];
-}
-
-
-# ----- MAIN PROCESSING INFO -----
-writehtml("<!DOCTYPE html>")
-writehtml("<HTML lang='en'>")
-
-writehtml("<HEAD>")
-    writehtml("<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />")
-
-    writehtml("<title>[W4M] XCMS analysis report</title>")
-    
-    writehtml("<style>")
-        writehtml("table { min-width: 500px; border:1px solid #D6B161; border-collapse:collapse;}")
-        writehtml("th { background: #898989; text-align:left;}")
-        writehtml("tr { border: 1px solid #000000 }")
-        writehtml("h2 { color: #FFA212; }")
-        writehtml("ul li { margin-bottom:10px; }")
-    writehtml("</style>")
-writehtml("</HEAD>")
-
-writehtml("<BODY>")
-    writehtml("<h1>___ XCMS analysis report using Workflow4Metabolomics ___</h1>")
-    # to pass the planemo shed_test
-    if (user_email != "test@bx.psu.edu") {
-        if (!is.null(user_email)) writehtml("By: ",user_email," - ")
-        writehtml("Date: ",format(Sys.time(), "%y%m%d-%H:%M:%S"))
-    }
-
-
-    writehtml("<h2>Samples used:</h2>")
-    writehtml("<table")
-        writehtml("<tr><th>sample</th><th>filename</th></tr>")
-        writehtml(paste("<tr><td>",sampnames(xset),"</td><td>",xset@filepaths,"</td></tr>"))
-    writehtml("</table>")
-
-    writehtml("<h2>Function launched:</h2>")
-    writehtml("<table>")
-        writehtml("<tr><th>timestamp<br />(ymd-h:m:s)</th><th>function</th><th>argument</th><th>value</th></tr>")
-        for(tool in names(listOFlistArguments)) {
-            listOFlistArgumentsDisplay=listOFlistArguments[[tool]][!(names(listOFlistArguments[[tool]]) %in% argBlacklist)]
-
-            timestamp = strsplit(tool,"_")[[1]][1]
-            xcmsFunction = strsplit(tool,"_")[[1]][2]
-            writehtml("<tr><td rowspan='",length(listOFlistArgumentsDisplay),"'>",timestamp,"</td><td rowspan='",length(listOFlistArgumentsDisplay),"'>",xcmsFunction,"</td>")
-            line_begin=""
-            for (arg in names(listOFlistArgumentsDisplay)) {
-                writehtml(line_begin,"<td>",arg,"</td><td>",unlist(listOFlistArgumentsDisplay[arg][1]),"</td></tr>")
-                line_begin="<tr>"
-            }
-        }
-    writehtml("</table>")
-
-    writehtml("<h2>Information about the xcmsSet object:</h2>")
-
-    log_file=file(htmlOutput, open = "at")
-    writehtml("<pre>")
-        sink(log_file)
-        sink(log_file, type = "output")
-            xset
-        sink()
-    writehtml("</pre>")
-
-    writehtml("<h2>Citations:</h2>")
-    writehtml("<ul>")
-        writehtml("<li>To cite the <b>XCMS</b> package in publications use:")
-            writehtml("<ul>")
-            writehtml("<li>","Smith, C.A. and Want, E.J. and O'Maille, G. and Abagyan,R. and Siuzdak, G.XCMS: Processing mass spectrometry data for metabolite profiling using nonlinear peak alignment, matching and identification, Analytical Chemistry, 78:779-787 (2006)","</li>")
-            writehtml("<li>","Ralf Tautenhahn, Christoph Boettcher, Steffen Neumann: Highly sensitive feature detection for high resolution LC/MS BMC Bioinformatics, 9:504 (2008)","</li>")
-            writehtml("<li>","H. Paul Benton, Elizabeth J. Want and Timothy M. D. Ebbels Correction of mass calibration gaps in liquid chromatography-mass spectrometry metabolomics data Bioinformatics, 26:2488 (2010)","</li>")
-            writehtml("</ul>")
-        writehtml("</li>")
-
-        writehtml("<li>To cite the <b>CAMERA</b> package in publications use:")
-            writehtml("<ul>")
-            writehtml("<li>","Kuhl, C., Tautenhahn, R., Boettcher, C., Larson, T. R. and Neumann,S. CAMERA: an integrated strategy for compound spectra extraction and annotation of liquid chromatography/mass spectrometry data sets. Analytical Chemistry, 84:283-289 (2012)","</li>")
-            writehtml("</ul>")
-        writehtml("</li>")
-
-        writehtml("<li>To cite the <b>Workflow4Metabolimics (W4M)</b> project in publications use:")
-            writehtml("<ul>")
-            writehtml("<li>","Franck Giacomoni, Gildas Le Corguillé, Misharl Monsoor, Marion Landi, Pierre Pericard, Mélanie Pétéra, Christophe Duperier, Marie Tremblay-Franco, Jean-François Martin, Daniel Jacob, Sophie Goulitquer, Etienne A. Thévenot and Christophe Caron (2014). Workflow4Metabolomics: A collaborative research infrastructure for computational metabolomics. Bioinformatics  doi:10.1093/bioinformatics/btu813","</li>")
-            writehtml("</ul>")
-        writehtml("</li>")
-    writehtml("</ul>")
-
-writehtml("</BODY>")
-
-writehtml("</HTML>")
-