# HG changeset patch
# User lecorguille
# Date 1508860111 14400
# Node ID f6d3e6be4ea3b2006ada0c8aab9a89572eb7e49d
# Parent 9b0bf28bcbaf762200900c2709b452202db14c05
planemo upload for repository https://github.com/workflow4metabolomics/xcms commit bff1445c9b00ccdbe05ee3dc6ed24221033384b9
diff -r 9b0bf28bcbaf -r f6d3e6be4ea3 abims_xcms_fillPeaks.xml
--- a/abims_xcms_fillPeaks.xml Mon Apr 03 07:53:30 2017 -0400
+++ b/abims_xcms_fillPeaks.xml Tue Oct 24 11:48:31 2017 -0400
@@ -117,7 +117,6 @@
Xcms.fillPeaks
==============
------------
Description
-----------
@@ -134,18 +133,17 @@
------------------
Workflow position
-----------------
**Upstream tools**
-========================= ================= ================== ==========
-Name output file format parameter
-========================= ================= ================== ==========
-xcms.group xset.group.RData rdata.xcms.group RData file
-========================= ================= ================== ==========
++------------------------+------------------+--------------------+------------+
+| Name | output file | format | parameter |
++========================+==================+====================+============+
+| xcms.group | xset.group.RData | rdata.xcms.group | RData file |
++------------------------+------------------+--------------------+------------+
**Downstream tools**
@@ -158,14 +156,11 @@
|xcms.summary | xset.retcor.RData| rdata.xcms.fillpeaks |
+---------------------------+------------------+-----------------------+
-The output file **xset.fillpeaks** is a RData file. You can continue your analysis using it in **CAMERA.annotate** or **xcms.summary** tool as a following step of your workflow.
-
-
**General schema of the metabolomic workflow**
.. image:: xcms_fillpeaks_workflow.png
-
+---------------------------------------------------
-----------
Input files
@@ -195,26 +190,7 @@
| "MSW" is used for peaklists without retention-time information like those from direct-infusion spectra.
-
-Get a Peak List
----------------
-
-If 'true', the module generates two additional files corresponding to the peak list:
-- the variable metadata file (corresponding to information about extracted ions such as mass or retention time)
-- the data matrix (corresponding to related intensities)
-
-**decimal places for [mass or retention time] values in identifiers**
-
- | Ions' identifiers are constructed as MxxxTyyy where 'xxx' is the ion median mass and 'yyy' the ion median retention time.
- | Two parameters are used to adjust the number of decimal places wanted in identifiers for mass and retention time respectively.
- | Theses parameters do not affect decimal places in columns other than the identifier one.
-
-**Reported intensity values**
-
- | This parameter determines which values should be reported as intensities in the dataMatrix table; it correspond to xcms 'intval' parameter:
- | - into: integrated area of original (raw) peak
- | - maxo: maximum intensity of original (raw) peak
- | - intb: baseline corrected integrated peak area (only available if peak detection was done by ‘findPeaks.centWave’)
+@HELP_GET_PEAK_LIST@
------------
Output files
@@ -224,19 +200,7 @@
| Rdata file that will be used in the **CAMERA.annotate** or **xcms.summary** step of the workflow.
-xset.variableMetadata.tsv : tabular format
-
- | Table containing information about ions; can be used as one input of **Quality_Metrics** or **Generic_filter* modules.
-
-xset.dataMatrix.tsv : tabular format
-
- | Table containing ions' intensities; can be used as one input of **Quality_Metrics** or **Generic_filter* modules.
-
-------
-
-.. class:: infomark
-
-The output file is a xset.fillPeaks.RData file. You can continue your analysis using it in **CAMERA.annotate** or **xcms.summary** tool.
+@HELP_GET_PEAK_LIST_OUTPUTS@
---------------------------------------------------
@@ -253,14 +217,7 @@
Parameters
----------
- | method -> **chrom**
- | Get a Peak List -> **false**
-
-
-Output files
-------------
-
- | **xset.fillPeaks.RData: RData file**
+ | **method**: chrom
---------------------------------------------------
diff -r 9b0bf28bcbaf -r f6d3e6be4ea3 lib.r
--- a/lib.r Mon Apr 03 07:53:30 2017 -0400
+++ b/lib.r Tue Oct 24 11:48:31 2017 -0400
@@ -51,6 +51,42 @@
write.table(dataMatrix, file=dataMatrixOutput,sep="\t",quote=F,row.names=F)
}
+#@author G. Le Corguille
+exportTicBpcTabular <- function(dataset, filenameBase, ticORbpc, rt='raw') {
+
+ rawORcorrected = ''
+ title = ''
+ if (rt=='corrected') {
+ rawORcorrected = '_corrected'
+ title = ' corrected by retcor'
+ }
+
+ if (ticORbpc == "TIC") {
+ section_name = paste0('TIC',rawORcorrected)
+ title = paste0('Total Ion Current (TIC) chromatogram',title)
+ description = 'Sum of intensity (Y) of all ions detected at each retention time(X)'
+ } else if (ticORbpc == "BPC") {
+ section_name = paste0('BPC',rawORcorrected)
+ title = paste0('Base Peak Chromatogram (BPC)',title)
+ description = 'Sum of intensity (Y) of the most intense peaks at each retention time(X)'
+ }
+
+ filename=paste0(basename(file_path_sans_ext(filenameBase)),"-",ticORbpc,rawORcorrected,"_mqc.out")
+
+ # Headers for MultiQC
+ cat("# file_format: 'tsv'\n", sep="", file = filename)
+ cat("# section_name: '",section_name,"'\n", sep="", file = filename, append = T)
+ cat("# title: '",title,"'\n", sep="", file = filename, append = T)
+ cat("# description: '",description,"'\n", sep="", file = filename, append = T)
+ cat("# plot_type: 'linegraph'\n", sep="", file = filename, append = T)
+ cat("# pconfig:\n", sep="", file = filename, append = T)
+ cat("# id: '",ticORbpc,rawORcorrected,"_lineplot'\n", sep="", file = filename, append = T)
+ cat("# ylab: 'Base Peak Intensity'\n", sep="", file = filename, append = T)
+ cat("# xlab: 'Retention Time'\n", sep="", file = filename, append = T)
+ cat("Intensity\tRT\n", file = filename, append = T)
+ write.table(dataset, filename ,row.names = F, col.names = F, sep = "\t", append = T, quote = F)
+}
+
#@author Y. Guitton
getBPC <- function(file,rtcor=NULL, ...) {
object <- xcmsRaw(file)
@@ -94,6 +130,9 @@
rtcor <- NULL
TIC[[j]] <- getBPC(files[j],rtcor=rtcor)
+
+ exportTicBpcTabular(TIC[[j]], files[j], "BPC", rt=rt)
+
# TIC[[j]][,1]<-rtcor
}
@@ -221,6 +260,8 @@
rtcor <- xcmsSet@rt$corrected[[i]] else
rtcor <- NULL
TIC[[i]] <- getTIC(files[i],rtcor=rtcor)
+
+ exportTicBpcTabular(TIC[[i]], files[i], "TIC", rt=rt)
}
pdf(pdfname,w=16,h=10)
@@ -476,7 +517,7 @@
# This function get the raw file path from the arguments
-getRawfilePathFromArguments <- function(singlefile, zipfile, listArguments) {
+getRawfilePathFromArguments <- function(singlefile, zipfile, listArguments) {
if (!is.null(listArguments[["zipfile"]])) zipfile = listArguments[["zipfile"]]
if (!is.null(listArguments[["zipfilePositive"]])) zipfile = listArguments[["zipfilePositive"]]
if (!is.null(listArguments[["zipfileNegative"]])) zipfile = listArguments[["zipfileNegative"]]
diff -r 9b0bf28bcbaf -r f6d3e6be4ea3 macros.xml
--- a/macros.xml Mon Apr 03 07:53:30 2017 -0400
+++ b/macros.xml Tue Oct 24 11:48:31 2017 -0400
@@ -12,6 +12,7 @@
bioconductor-xcms
+
@@ -116,14 +117,55 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
.. 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@oniris-nantes.fr - part of Workflow4Metabolomics.org [W4M]
+**Galaxy integration** ABiMS TEAM - UPMC/CNRS - Station Biologique de Roscoff and Yann Guitton yann.guitton@oniris-nantes.fr - part of Workflow4Metabolomics.org [W4M]
| Contact support@workflow4metabolomics.org for any questions or concerns about the Galaxy implementation of this tool.
@@ -131,6 +173,57 @@
+
+
+BPCs and TICs: tabular
+
+ | "Base Peak Chromatograms" and "Total Ion Chromatograms" graphs
+ | Import BPC and TIC from xcmsSet and retcor [at once] within MultiQC_ (in or outside Galaxy) to display and navigate in the graphs.
+ | - In MultiQC: as tool, use the Custom Content
+
+.. _MultiQC: http://multiqc.info/
+
+BPCs and TICs: pdf [if using zip]
+
+ | "Base Peak Chromatograms" and "Total Ion Chromatograms" graphs in pdf format.
+
+
+
+
+
+Get a Peak List
+---------------
+
+If 'true', the module generates two additional files corresponding to the peak list:
+- the variable metadata file (corresponding to information about extracted ions such as mass or retention time)
+- the data matrix (corresponding to related intensities)
+
+**decimal places for [mass or retention time] values in identifiers**
+
+ | Ions' identifiers are constructed as MxxxTyyy where 'xxx' is the ion median mass and 'yyy' the ion median retention time.
+ | Two parameters are used to adjust the number of decimal places wanted in identifiers for mass and retention time respectively.
+ | Theses parameters do not affect decimal places in columns other than the identifier one.
+
+**Reported intensity values**
+
+ | This parameter determines which values should be reported as intensities in the dataMatrix table; it correspond to xcms 'intval' parameter:
+ | - into: integrated area of original (raw) peak
+ | - maxo: maximum intensity of original (raw) peak
+ | - intb: baseline corrected integrated peak area (only available if peak detection was done by ‘findPeaks.centWave’)
+
+
+
+
+
+xset.variableMetadata.tsv : tabular format [If Get a Peak List == Yes]
+
+ | Table containing information about ions - Can be used in **Normalisation/Generic_filter** and **Statitics** tools.
+
+xset.dataMatrix.tsv : tabular format
+
+ | Table containing ions' intensities - Can be used **Normalisation/Generic_filter** and **Statitics** tools.
+
+
diff -r 9b0bf28bcbaf -r f6d3e6be4ea3 xcms.r
--- a/xcms.r Mon Apr 03 07:53:30 2017 -0400
+++ b/xcms.r Tue Oct 24 11:48:31 2017 -0400
@@ -13,7 +13,7 @@
# ----- PACKAGE -----
cat("\tPACKAGE INFO\n")
#pkgs=c("xcms","batch")
-pkgs=c("parallel","BiocGenerics", "Biobase", "Rcpp", "mzR", "xcms","snow","batch")
+pkgs=c("tools","parallel","BiocGenerics", "Biobase", "Rcpp", "mzR", "xcms","snow","batch")
for(pkg in pkgs) {
suppressPackageStartupMessages( stopifnot( library(pkg, quietly=TRUE, logical.return=TRUE, character.only=TRUE)))
cat(pkg,"\t",as.character(packageVersion(pkg)),"\n",sep="")
@@ -65,10 +65,6 @@
}
#saving the specific parameters
-rplotspdf = "Rplots.pdf"
-if (!is.null(listArguments[["rplotspdf"]])){
- rplotspdf = listArguments[["rplotspdf"]]; listArguments[["rplotspdf"]]=NULL
-}
sampleMetadataOutput = "sampleMetadata.tsv"
if (!is.null(listArguments[["sampleMetadataOutput"]])){
sampleMetadataOutput = listArguments[["sampleMetadataOutput"]]; listArguments[["sampleMetadataOutput"]]=NULL
@@ -94,11 +90,6 @@
intval = listArguments[["intval"]]; listArguments[["intval"]]=NULL
}
-if (thefunction %in% c("xcmsSet","retcor")) {
- ticspdf = listArguments[["ticspdf"]]; listArguments[["ticspdf"]]=NULL
- bicspdf = listArguments[["bicspdf"]]; listArguments[["bicspdf"]]=NULL
-}
-
if (thefunction %in% c("xcmsSet","retcor","fillPeaks")) {
if (!exists("singlefile")) singlefile=NULL
@@ -147,7 +138,7 @@
#change the default display settings
#dev.new(file="Rplots.pdf", width=16, height=12)
-pdf(file=rplotspdf, width=16, height=12)
+pdf(file="Rplots.pdf", width=16, height=12)
if (thefunction == "group") {
par(mfrow=c(2,2))
}
@@ -197,12 +188,12 @@
if (thefunction == "xcmsSet") {
cat("\t\tGET TIC GRAPH\n")
sampleNamesList = getSampleMetadata(xcmsSet=xset, sampleMetadataOutput=sampleMetadataOutput)
- getTICs(xcmsSet=xset, pdfname=ticspdf,rt="raw")
- getBPCs(xcmsSet=xset,rt="raw",pdfname=bicspdf)
+ getTICs(xcmsSet=xset, rt="raw")
+ getBPCs(xcmsSet=xset, rt="raw")
} else if (thefunction == "retcor") {
cat("\t\tGET TIC GRAPH\n")
- getTICs(xcmsSet=xset, pdfname=ticspdf,rt="corrected")
- getBPCs(xcmsSet=xset,rt="corrected",pdfname=bicspdf)
+ getTICs(xcmsSet=xset, rt="corrected")
+ getBPCs(xcmsSet=xset, rt="corrected")
}
if ((thefunction == "group" || thefunction == "fillPeaks") && exists("intval")) {