changeset 0:f9b3dae104eb draft

planemo upload commit 73f46f4e08141f78927056fa3e4709d0ab323972
author lecorguille
date Wed, 23 Dec 2015 03:38:38 -0500
parents
children ce7878df30fe
files abims_xcms_report.xml planemo.sh test-data/fillpeaks.RData test-data/report.html xcms_report.r
diffstat 5 files changed, 275 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/abims_xcms_report.xml	Wed Dec 23 03:38:38 2015 -0500
@@ -0,0 +1,69 @@
+<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/planemo.sh	Wed Dec 23 03:38:38 2015 -0500
@@ -0,0 +1,1 @@
+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"
Binary file test-data/fillpeaks.RData has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/report.html	Wed Dec 23 03:38:38 2015 -0500
@@ -0,0 +1,76 @@
+<!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>
+By: lecorguille@sb-roscoff.fr - 
+Date: 151223-09:22:45
+<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>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xcms_report.r	Wed Dec 23 03:38:38 2015 -0500
@@ -0,0 +1,129 @@
+#!/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>")
+    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>")
+