Repository 'xcms_group'
hg clone https://toolshed.g2.bx.psu.edu/repos/lecorguille/xcms_group

Changeset 14:833d2c821d9c (2018-09-18)
Previous changeset 13:13558e8a4778 (2017-11-29) Next changeset 15:dd6eb1f37f40 (2018-09-19)
Commit message:
planemo upload for repository https://github.com/workflow4metabolomics/xcms commit 9f72e947d9c241d11221cad561f3525d27231857
modified:
README.rst
abims_xcms_group.xml
lib.r
macros.xml
static/images/xcms_group_workflow.png
test-data/faahKO-single-class.xset.merged.RData
test-data/faahKO-single.xset.merged.RData
test-data/faahKO-single.xset.merged.group.retcor.RData
test-data/faahKO.xset.RData
test-data/faahKO.xset.group.dataMatrix.tsv
test-data/faahKO.xset.group.retcor.RData
test-data/faahKO.xset.group.variableMetadata.tsv
added:
lib-xcms3.x.x.r
macros_xcms.xml
test-data/faahKO_reduce.zip
test-data/ko15.CDF
test-data/ko16.CDF
test-data/wt15.CDF
test-data/wt16.CDF
xcms_group.r
removed:
test-data/MM-single.xset.merged.RData
xcms.r
b
diff -r 13558e8a4778 -r 833d2c821d9c README.rst
--- a/README.rst Wed Nov 29 09:46:03 2017 -0500
+++ b/README.rst Tue Sep 18 16:11:06 2018 -0400
b
@@ -2,10 +2,22 @@
 Changelog/News
 --------------
 
+**Version 3.0.0.0 - 08/03/2018**
+
+- UPGRADE: upgrade the xcms version from 1.46.0 to 3.0.0. So refactoring of a lot of underlying codes and methods. Some parameters may have been renamed.
+
+- NEW: a bunch of new options: PeakDensity.minSamples), MzClust.minSamples)
+
+- NEW: a new density plot
+
+- IMPROVEMENT: the advanced options are now in sections. It will allow you to access to all the parameters and to know their default values.
+
+
 **Version 2.1.1 - 29/11/2017**
 
 - BUGFIX: To avoid issues with accented letter in the parentFile tag of the mzXML files, we changed a hidden mechanim to LC_ALL=C
 
+
 **Version 2.1.0 - 07/02/2017**
 
 - IMPROVEMENT: Add an option to export the peak list at this step without have to wait camara.annotate
@@ -14,11 +26,13 @@
 
 - BUGFIX: the default value of "density" -> "Maximum number of groups to identify in a single m/z slice" which was of 5 have been changed to fix with the XMCS default values to 50
 
+
 **Version 2.0.6 - 06/07/2016**
 
 - UPGRADE: upgrate the xcms version from 1.44.0 to 1.46.0
 
-**Version 2.0.5 04/04/2016**
+
+**Version 2.0.5 - 04/04/2016**
 
 - TEST: refactoring to pass planemo test using conda dependencies
 
b
diff -r 13558e8a4778 -r 833d2c821d9c abims_xcms_group.xml
--- a/abims_xcms_group.xml Wed Nov 29 09:46:03 2017 -0500
+++ b/abims_xcms_group.xml Tue Sep 18 16:11:06 2018 -0400
[
b'@@ -1,286 +1,270 @@\n-<tool id="abims_xcms_group" name="xcms.group" version="2.1.1">\n+<tool id="abims_xcms_group" name="xcms groupChromPeaks (group)" version="@WRAPPER_VERSION@.0">\n \n-    <description>Group peaks together across samples using overlapping m/z bins and calculation of smoothed peak distributions in chromatographic time.</description>\n+    <description>Perform the correspondence, the grouping of chromatographic peaks within and between samples.</description>\n \n     <macros>\n         <import>macros.xml</import>\n+        <import>macros_xcms.xml</import>\n     </macros>\n \n     <expand macro="requirements"/>\n     <expand macro="stdio"/>\n \n     <command><![CDATA[\n-        @COMMAND_XCMS_SCRIPT@\n-        xfunction group\n+        @COMMAND_RSCRIPT@/xcms_group.r\n         image \'$image\'\n \n-        xsetRdataOutput \'$xsetRData\'\n-        rplotspdf \'$rplotsPdf\'\n-\n         method $methods.method\n-        #if $methods.method == "density":\n-            ## minsamp $methods.minsamp\n-            minfrac $methods.minfrac\n+        #if $methods.method == "PeakDensity":\n             bw $methods.bw\n-            mzwid $methods.mzwid\n-            sleep 0.001\n-        #if $methods.density_options.option == "show":\n-            max $methods.density_options.max\n-        #end if\n-        #elif $methods.method == "mzClust":\n-            mzppm $methods.mzppm\n-            mzabs $methods.mzabs\n-            minfrac $methods.minfrac\n-            ## minsamp $methods.minsamp\n+            minFraction $methods.minFraction\n+            minSamples $methods.minSamples\n+            binSize $methods.binSize\n+            ## Advanced\n+            maxFeatures $methods.PeakDensityAdv.maxFeatures\n+        #elif $methods.method == "MzClust":\n+            ppm $methods.ppm\n+            absMz $methods.absMz\n+            minFraction $methods.minFraction\n+            minSamples $methods.minSamples\n         #else:\n-            mzVsRTbalance $methods.mzVsRTbalance\n-            mzCheck $methods.mzCheck\n-            rtCheck $methods.rtCheck\n+            mzVsRtBalance $methods.mzVsRtBalance\n+            absMz $methods.absMz\n+            absRt $methods.absRt\n             kNN $methods.kNN\n         #end if\n \n         @COMMAND_PEAKLIST@\n \n+        @COMMAND_FILE_LOAD@\n+\n         @COMMAND_LOG_EXIT@\n    ]]></command>\n \n     <inputs>\n-        <param name="image" type="data" format="rdata.xcms.raw,rdata.xcms.group,rdata.xcms.retcor,rdata" label="xset RData file" help="output file from another function xcms (xcmsSet, retcor etc.)" />\n+        <param name="image" type="data" format="rdata.xcms.findchrompeaks,rdata.xcms.group,rdata.xcms.retcor,rdata" label="@INPUT_IMAGE_LABEL@" help="@INPUT_IMAGE_HELP@ from: findChromPeaks, groupChromPeaks or adjustRtime" />\n         <conditional name="methods">\n-            <param name="method" type="select" label="Method to use for grouping" help="[method] See the help section below">\n-                <option value="density" selected="true">density</option>\n-                <option value="mzClust" >mzClust</option>\n-                <option value="nearest" >nearest</option>\n+            <param name="method" type="select" label="Method to use for grouping" help="See the help section below">\n+                <option value="PeakDensity" selected="true">PeakDensity - peak grouping based on time dimension peak densities</option>\n+                <option value="MzClust">MzClust - high resolution peak grouping for single spectra (direct infusion) MS data</option>\n+                <option value="NearestPeaks">NearestPeaks - chromatographic peak grouping based on their proximity in the mz-rt space</option>\n             </param>\n-            <when value="density">\n-                <param name="bw" type="float" value="30" label="Bandwidth" help="[bw] bandwidth (standard deviation or half width at half maximum) of gaussian smoothing kernel to apply to the peak density chromatogram" />\n-                <param name="minfrac" type="float" value="0.5" label="Minimum fra'..b'based on the density (distribution) of identified peaks along the retention time axis within slices of overlapping mz ranges.  All peaks (from the same or from different samples) being close on the retention time axis are grouped into a feature (peak group).\n+    | See the PeakDensity_manual_\n \n-    | Groups peaks together across samples using overlapping m/z bins and calculation of smoothed peak distributions in chromatographic time.\n+**NearestPeaks**\n+\n+    | This method is inspired by the grouping algorithm of mzMine [Katajamaa 2006] and performs correspondence based on proximity of peaks in the space spanned by retention time and mz values.  The method creates first a master peak list consisting of all chromatographic peaks from the sample in which most peaks were identified, and starting from that, calculates distances to peaks from the sample with the next most number of peaks. If peaks are closer than the defined threshold they are grouped together.\n+    | See the NearestPeaks_manual_\n \n-**nearest**\n+.. _MzClust_manual: https://rdrr.io/bioc/xcms/man/groupChromPeaks-mzClust.html#heading-2\n+.. _PeakDensity_manual: https://rdrr.io/bioc/xcms/man/groupChromPeaks-density.html#heading-2\n+.. _NearestPeaks_manual: https://rdrr.io/bioc/xcms/man/groupChromPeaks-nearest.html#heading-2\n \n-    | Groups peaks together across samples by creating a master peak list and assigning corresponding peaks from all samples. It is inspired by the alignment algorithm of mzMine.\n+@HELP_XCMS_MANUAL@\n \n+@HELP_PEAKLIST@\n \n ------------\n Output files\n ------------\n \n-xset.group.Rplots.pdf\n-\n-xset.group.RData: rdata.xcms.group format\n-\n-    | Rdata file that will be necessary in the third and fourth step of the workflow (xcms.retcor and xcms.fillpeaks).\n-\n-\n-------\n+xset.groupChromPeaks.RData: rdata.xcms.group format\n \n-.. class:: infomark\n-\n-The output file is an xset.group.RData file. You can continue your analysis using it in **xcms.retcor** tool.\n-\n-\n----------------------------------------------------\n-\n-\n----------------\n-Working example\n----------------\n+    | RData file that will be necessary in the third and fourth step of the workflow (xcms.adjustRtime and xcms.fillChromPeaks).\n \n-Input files\n------------\n-\n-    | RData file -> **xset.RData**\n-\n-Parameters\n-----------\n+xset.groupChromPeaks.plotChromPeakDensity.pdf\n \n-    | Method -> **density**\n-    | bw     -> **5**\n-    | minfrac -> **0.3**\n-    | mzwid    -> **0.01**\n-    | Advanced options: **show**\n-    | max -> **50**\n-\n+    | Density plot\n \n-Output files\n-------------\n-\n-    | **1) xset.RData: RData file**\n-\n-    | **2) Example of an xset.group.Rplots pdf file**\n-\n-.. image:: xcms_group.png\n-        :width: 700\n+@HELP_PEAKLIST_OUTPUT@\n \n \n ---------------------------------------------------\n@@ -414,10 +355,22 @@\n Changelog/News\n --------------\n \n+**Version 3.0.0.0 - 08/03/2018**\n+\n+- UPGRADE: upgrade the xcms version from 1.46.0 to 3.0.0. So refactoring of a lot of underlying codes and methods. Some parameters may have been renamed.\n+\n+- NEW: a bunch of new options: PeakDensity.minSamples), MzClust.minSamples)\n+\n+- NEW: a new density plot\n+\n+- IMPROVEMENT: the advanced options are now in sections. It will allow you to access to all the parameters and to know their default values.\n+\n+\n **Version 2.1.1 - 29/11/2017**\n \n - BUGFIX: To avoid issues with accented letter in the parentFile tag of the mzXML files, we changed a hidden mechanim to LC_ALL=C\n \n+\n **Version 2.1.0 - 07/02/2017**\n \n - IMPROVEMENT: Add an option to export the peak list at this step without have to wait camara.annotate\n@@ -426,10 +379,12 @@\n \n - BUGFIX: the default value of "density" -> "Maximum number of groups to identify in a single m/z slice" which was of 5 have been changed to fix with the XMCS default values to 50\n \n+\n **Version 2.0.6 - 06/07/2016**\n \n - UPGRADE: upgrate the xcms version from 1.44.0 to 1.46.0\n \n+\n **Version 2.0.5 - 04/04/2016**\n \n - TEST: refactoring to pass planemo test using conda dependencies\n'
b
diff -r 13558e8a4778 -r 833d2c821d9c lib-xcms3.x.x.r
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib-xcms3.x.x.r Tue Sep 18 16:11:06 2018 -0400
[
@@ -0,0 +1,152 @@
+
+
+#@TODO: remove this function as soon as we can use xcms 3.x.x from Bioconductor 3.7
+# https://github.com/sneumann/xcms/issues/250
+groupnamesW4M <- function(xdata, mzdec = 0, rtdec = 0) {
+    mzfmt <- paste("%.", mzdec, "f", sep = "")
+    rtfmt <- paste("%.", rtdec, "f", sep = "")
+
+    gnames <- paste("M", sprintf(mzfmt, featureDefinitions(xdata)[,"mzmed"]), "T",
+                    sprintf(rtfmt, featureDefinitions(xdata)[,"rtmed"]), sep = "")
+
+    if (any(dup <- duplicated(gnames)))
+        for (dupname in unique(gnames[dup])) {
+            dupidx <- which(gnames == dupname)
+            gnames[dupidx] <- paste(gnames[dupidx], seq(along = dupidx), sep = "_")
+        }
+
+    return (gnames)
+}
+
+#@TODO: remove this function as soon as we can use xcms 3.x.x from Bioconductor 3.7
+# https://github.com/sneumann/xcms/issues/247
+.concatenate_XCMSnExp <- function(...) {
+    x <- list(...)
+    if (length(x) == 0)
+        return(NULL)
+    if (length(x) == 1)
+        return(x[[1]])
+    ## Check that all are XCMSnExp objects.
+    if (!all(unlist(lapply(x, function(z) is(z, "XCMSnExp")))))
+        stop("All passed objects should be 'XCMSnExp' objects")
+    new_x <- as(.concatenate_OnDiskMSnExp(...), "XCMSnExp")
+    ## If any of the XCMSnExp has alignment results or detected features drop
+    ## them!
+    x <- lapply(x, function(z) {
+        if (hasAdjustedRtime(z)) {
+            z <- dropAdjustedRtime(z)
+            warning("Adjusted retention times found, had to drop them.")
+        }
+        if (hasFeatures(z)) {
+            z <- dropFeatureDefinitions(z)
+            warning("Feature definitions found, had to drop them.")
+        }
+        z
+    })
+    ## Combine peaks
+    fls <- lapply(x, fileNames)
+    startidx <- cumsum(lengths(fls))
+    pks <- lapply(x, chromPeaks)
+    procH <- lapply(x, processHistory)
+    for (i in 2:length(fls)) {
+        pks[[i]][, "sample"] <- pks[[i]][, "sample"] + startidx[i - 1]
+        procH[[i]] <- lapply(procH[[i]], function(z) {
+            z@fileIndex <- as.integer(z@fileIndex + startidx[i - 1])
+            z
+            })
+    }
+    pks <- do.call(rbind, pks)
+    new_x@.processHistory <- unlist(procH)
+    chromPeaks(new_x) <- pks
+    if (validObject(new_x))
+        new_x
+}
+
+#@TODO: remove this function as soon as we can use xcms 3.x.x from Bioconductor 3.7
+# https://github.com/sneumann/xcms/issues/247
+.concatenate_OnDiskMSnExp <- function(...) {
+    x <- list(...)
+    if (length(x) == 0)
+        return(NULL)
+    if (length(x) == 1)
+        return(x[[1]])
+    ## Check that all are XCMSnExp objects.
+    if (!all(unlist(lapply(x, function(z) is(z, "OnDiskMSnExp")))))
+        stop("All passed objects should be 'OnDiskMSnExp' objects")
+    ## Check processingQueue
+    procQ <- lapply(x, function(z) z@spectraProcessingQueue)
+    new_procQ <- procQ[[1]]
+    is_ok <- unlist(lapply(procQ, function(z)
+        !is.character(all.equal(new_procQ, z))
+        ))
+    if (any(!is_ok)) {
+        warning("Processing queues from the submitted objects differ! ",
+                "Dropping the processing queue.")
+        new_procQ <- list()
+    }
+    ## processingData
+    fls <- lapply(x, function(z) z@processingData@files)
+    startidx <- cumsum(lengths(fls))
+    ## featureData
+    featd <- lapply(x, fData)
+    ## Have to update the file index and the spectrum names.
+    for (i in 2:length(featd)) {
+        featd[[i]]$fileIdx <- featd[[i]]$fileIdx + startidx[i - 1]
+        rownames(featd[[i]]) <- MSnbase:::formatFileSpectrumNames(
+                                              fileIds = featd[[i]]$fileIdx,
+                                              spectrumIds = featd[[i]]$spIdx,
+                                              nSpectra = nrow(featd[[i]]),
+                                              nFiles = length(unlist(fls))
+                                          )
+    }
+    featd <- do.call(rbind, featd)
+    featd$spectrum <- 1:nrow(featd)
+    ## experimentData
+    expdata <- lapply(x, function(z) {
+        ed <- z@experimentData
+        data.frame(instrumentManufacturer = ed@instrumentManufacturer,
+                   instrumentModel = ed@instrumentModel,
+                   ionSource = ed@ionSource,
+                   analyser = ed@analyser,
+                   detectorType = ed@detectorType,
+                   stringsAsFactors = FALSE)
+    })
+    expdata <- do.call(rbind, expdata)
+    expdata <- new("MIAPE",
+                   instrumentManufacturer = expdata$instrumentManufacturer,
+                   instrumentModel = expdata$instrumentModel,
+                   ionSource = expdata$ionSource,
+                   analyser = expdata$analyser,
+                   detectorType = expdata$detectorType)
+
+    ## protocolData
+    protodata <- lapply(x, function(z) z@protocolData)
+    if (any(unlist(lapply(protodata, nrow)) > 0))
+        warning("Found non-empty protocol data, but merging protocol data is",
+                " currently not supported. Skipped.")
+    ## phenoData
+    pdata <- do.call(rbind, lapply(x, pData))
+    res <- new(
+        "OnDiskMSnExp",
+        phenoData = new("NAnnotatedDataFrame", data = pdata),
+        featureData = new("AnnotatedDataFrame", featd),
+        processingData = new("MSnProcess",
+                             processing = paste0("Concatenated [", date(), "]"),
+                             files = unlist(fls), smoothed = NA),
+        experimentData = expdata,
+        spectraProcessingQueue = new_procQ)
+    if (validObject(res))
+        res
+}
+
+#@TODO: remove this function as soon as we can use xcms 3.x.x from Bioconductor 3.7
+# https://github.com/sneumann/xcms/issues/247
+c.XCMSnExp <- function(...) {
+    .concatenate_XCMSnExp(...)
+}
+
+#@TODO: remove this function as soon as we can use xcms 3.x.x from Bioconductor 3.7
+# https://github.com/sneumann/xcms/issues/247
+c.MSnbase <- function(...) {
+    .concatenate_OnDiskMSnExp(...)
+}
b
diff -r 13558e8a4778 -r 833d2c821d9c lib.r
--- a/lib.r Wed Nov 29 09:46:03 2017 -0500
+++ b/lib.r Tue Sep 18 16:11:06 2018 -0400
[
b'@@ -1,319 +1,269 @@\n-#Authors ABiMS TEAM\n-#Lib.r for Galaxy Workflow4Metabolomics xcms tools\n-#\n-#version 2.4: lecorguille\n-#   add getPeaklistW4M\n-#version 2.3: yguitton\n-#   correction for empty PDF when only 1 class\n-#version 2.2\n-#   correct bug in Base Peak Chromatogram (BPC) option, not only TIC when scanrange used in xcmsSet\n-#   Note if scanrange is used a warning is prompted in R console but do not stop PDF generation\n-#version 2.1: yguitton\n-#   Modifications made by Guitton Yann\n+#@authors ABiMS TEAM, Y. Guitton\n+# lib.r for Galaxy Workflow4Metabolomics xcms tools\n+\n+#@author G. Le Corguille\n+# solve an issue with batch if arguments are logical TRUE/FALSE\n+parseCommandArgs <- function(...) {\n+    args <- batch::parseCommandArgs(...)\n+    for (key in names(args)) {\n+        if (args[key] %in% c("TRUE","FALSE"))\n+            args[key] = as.logical(args[key])\n+    }\n+    return(args)\n+}\n \n+#@author G. Le Corguille\n+# This function will\n+# - load the packages\n+# - display the sessionInfo\n+loadAndDisplayPackages <- function(pkgs) {\n+    for(pkg in pkgs) suppressPackageStartupMessages( stopifnot( library(pkg, quietly=TRUE, logical.return=TRUE, character.only=TRUE)))\n+\n+    sessioninfo = sessionInfo()\n+    cat(sessioninfo$R.version$version.string,"\\n")\n+    cat("Main packages:\\n")\n+    for (pkg in names(sessioninfo$otherPkgs)) { cat(paste(pkg,packageVersion(pkg)),"\\t") }; cat("\\n")\n+    cat("Other loaded packages:\\n")\n+    for (pkg in names(sessioninfo$loadedOnly)) { cat(paste(pkg,packageVersion(pkg)),"\\t") }; cat("\\n")\n+}\n+\n+#@author G. Le Corguille\n+# This function merge several chromBPI or chromTIC into one.\n+mergeChrom <- function(chrom_merged, chrom) {\n+    if (is.null(chrom_merged)) return(NULL)\n+    chrom_merged@.Data <- cbind(chrom_merged@.Data, chrom@.Data)\n+    return(chrom_merged)\n+}\n \n #@author G. Le Corguille\n-#This function convert if it is required the Retention Time in minutes\n+# This function merge several xdata into one.\n+mergeXData <- function(args) {\n+    chromTIC <- NULL\n+    chromBPI <- NULL\n+    chromTIC_adjusted <- NULL\n+    chromBPI_adjusted <- NULL\n+    for(image in args$images) {\n+\n+        load(image)\n+        # Handle infiles\n+        if (!exists("singlefile")) singlefile <- NULL\n+        if (!exists("zipfile")) zipfile <- NULL\n+        rawFilePath <- getRawfilePathFromArguments(singlefile, zipfile, args)\n+        zipfile <- rawFilePath$zipfile\n+        singlefile <- rawFilePath$singlefile\n+        retrieveRawfileInTheWorkingDirectory(singlefile, zipfile)\n+\n+        if (exists("raw_data")) xdata <- raw_data\n+        if (!exists("xdata")) stop("\\n\\nERROR: The RData doesn\'t contain any object called \'xdata\'. This RData should have been created by an old version of XMCS 2.*")\n+\n+        cat(sampleNamesList$sampleNamesOrigin,"\\n")\n+\n+        if (!exists("xdata_merged")) {\n+            xdata_merged <- xdata\n+            singlefile_merged <- singlefile\n+            md5sumList_merged <- md5sumList\n+            sampleNamesList_merged <- sampleNamesList\n+            chromTIC_merged <- chromTIC\n+            chromBPI_merged <- chromBPI\n+            chromTIC_adjusted_merged <- chromTIC_adjusted\n+            chromBPI_adjusted_merged <- chromBPI_adjusted\n+        } else {\n+            if (is(xdata, "XCMSnExp")) xdata_merged <- c(xdata_merged,xdata)\n+            else if (is(xdata, "OnDiskMSnExp")) xdata_merged <- .concatenate_OnDiskMSnExp(xdata_merged,xdata)\n+            else stop("\\n\\nERROR: The RData either a OnDiskMSnExp object called raw_data or a XCMSnExp object called xdata")\n+\n+            singlefile_merged <- c(singlefile_merged,singlefile)\n+            md5sumList_merged$origin <- rbind(md5sumList_merged$origin,md5sumList$origin)\n+            sampleNamesList_merged$sampleNamesOrigin <- c(sampleNamesList_merged$sampleNamesOrigin,sampleNamesList$sampleNamesOrigin)\n+            sampleNamesList_merged$sampleNamesMakeNames <- c(sampleNamesList_merged$sampleNamesMakeNames,sampleNamesList$sampleNamesMakeNam'..b'ile[[singlefile_sampleName]] = singlefile_galaxyPath\n-        }\n-    }\n-    for (argument in c("zipfile","zipfilePositive","zipfileNegative","singlefile_galaxyPath","singlefile_sampleName","singlefile_galaxyPathPositive","singlefile_sampleNamePositive","singlefile_galaxyPathNegative","singlefile_sampleNameNegative")) {\n-        listArguments[[argument]]=NULL\n-    }\n-    return(list(zipfile=zipfile, singlefile=singlefile, listArguments=listArguments))\n+  }\n+  return(list(zipfile=zipfile, singlefile=singlefile))\n }\n \n-\n # This function retrieve the raw file in the working directory\n #   - if zipfile: unzip the file with its directory tree\n #   - if singlefiles: set symlink with the good filename\n+#@author Gildas Le Corguille lecorguille@sb-roscoff.fr\n retrieveRawfileInTheWorkingDirectory <- function(singlefile, zipfile) {\n     if(!is.null(singlefile) && (length("singlefile")>0)) {\n         for (singlefile_sampleName in names(singlefile)) {\n-            singlefile_galaxyPath = singlefile[[singlefile_sampleName]]\n+            singlefile_galaxyPath <- singlefile[[singlefile_sampleName]]\n             if(!file.exists(singlefile_galaxyPath)){\n-                error_message=paste("Cannot access the sample:",singlefile_sampleName,"located:",singlefile_galaxyPath,". Please, contact your administrator ... if you have one!")\n+                error_message <- paste("Cannot access the sample:",singlefile_sampleName,"located:",singlefile_galaxyPath,". Please, contact your administrator ... if you have one!")\n                 print(error_message); stop(error_message)\n             }\n \n-            file.symlink(singlefile_galaxyPath,singlefile_sampleName)\n+            if (!suppressWarnings( try (file.link(singlefile_galaxyPath, singlefile_sampleName), silent=T)))\n+                file.copy(singlefile_galaxyPath, singlefile_sampleName)\n+\n         }\n-        directory = "."\n+        directory <- "."\n \n     }\n-    if(!is.null(zipfile) && (zipfile!="")) {\n+    if(!is.null(zipfile) && (zipfile != "")) {\n         if(!file.exists(zipfile)){\n-            error_message=paste("Cannot access the Zip file:",zipfile,". Please, contact your administrator ... if you have one!")\n+            error_message <- paste("Cannot access the Zip file:",zipfile,". Please, contact your administrator ... if you have one!")\n             print(error_message)\n             stop(error_message)\n         }\n \n         #list all file in the zip file\n-        #zip_files=unzip(zipfile,list=T)[,"Name"]\n+        #zip_files <- unzip(zipfile,list=T)[,"Name"]\n \n         #unzip\n         suppressWarnings(unzip(zipfile, unzip="unzip"))\n \n         #get the directory name\n-        filesInZip=unzip(zipfile, list=T);\n-        directories=unique(unlist(lapply(strsplit(filesInZip$Name,"/"), function(x) x[1])));\n-        directories=directories[!(directories %in% c("__MACOSX")) & file.info(directories)$isdir]\n-        directory = "."\n-        if (length(directories) == 1) directory = directories\n+        suppressWarnings(filesInZip <- unzip(zipfile, list=T))\n+        directories <- unique(unlist(lapply(strsplit(filesInZip$Name,"/"), function(x) x[1])))\n+        directories <- directories[!(directories %in% c("__MACOSX")) & file.info(directories)$isdir]\n+        directory <- "."\n+        if (length(directories) == 1) directory <- directories\n \n         cat("files_root_directory\\t",directory,"\\n")\n \n     }\n     return (directory)\n }\n+\n+\n+# This function retrieve a xset like object\n+#@author Gildas Le Corguille lecorguille@sb-roscoff.fr\n+getxcmsSetObject <- function(xobject) {\n+    # XCMS 1.x\n+    if (class(xobject) == "xcmsSet")\n+        return (xobject)\n+    # XCMS 3.x\n+    if (class(xobject) == "XCMSnExp") {\n+        # Get the legacy xcmsSet object\n+        suppressWarnings(xset <- as(xobject, \'xcmsSet\'))\n+        if (!is.null(xset@phenoData$sample_group))\n+            sampclass(xset) <- xset@phenoData$sample_group\n+        else\n+            sampclass(xset) <- "."\n+        return (xset)\n+    }\n+}\n'
b
diff -r 13558e8a4778 -r 833d2c821d9c macros.xml
--- a/macros.xml Wed Nov 29 09:46:03 2017 -0500
+++ b/macros.xml Tue Sep 18 16:11:06 2018 -0400
[
@@ -1,141 +1,52 @@
 <?xml version="1.0"?>
 <macros>
-    <xml name="requirements">
-        <requirements>
-            <requirement type="package" version="0.4_1">r-snow</requirement>
-            <requirement type="package" version="1.46.0">bioconductor-xcms</requirement>
-            <requirement type="package" version="1.1_4">r-batch</requirement>
-        </requirements>
-    </xml>
-    <xml name="requirements_light">
-        <requirements>
-            <requirement type="package" version="1.46.0">bioconductor-xcms</requirement>
-        </requirements>
-    </xml>
     <xml name="stdio">
         <stdio>
             <exit_code range="1" level="fatal" />
         </stdio>
     </xml>
 
-    <token name="@COMMAND_XCMS_SCRIPT@">
-        LC_ALL=C Rscript $__tool_directory__/xcms.r
-    </token>
+    <!-- COMMAND -->
+    <token name="@COMMAND_RSCRIPT@">LC_ALL=C Rscript $__tool_directory__/</token>
 
     <token name="@COMMAND_LOG_EXIT@">
         ;
         return=\$?;
-        mv log.txt '$log';
-        cat '$log';
+        cat 'log.txt';
         sh -c "exit \$return"
     </token>
 
-    <!-- zipfile load for planemo test -->
-
-    <token name="@COMMAND_FILE_LOAD@">
-        #if $file_load_section.file_load_conditional.file_load_select == "yes":
-            #if $file_load_section.file_load_conditional.input[0].is_of_type("mzxml") or $file_load_section.file_load_conditional.input[0].is_of_type("mzml") or $file_load_section.file_load_conditional.input[0].is_of_type("mzdata") or $file_load_section.file_load_conditional.input[0].is_of_type("netcdf"):
-                #set singlefile_galaxyPath = ','.join( [ str( $single_file ) for $single_file in $file_load_section.file_load_conditional.input ] )
-                #set singlefile_sampleName = ','.join( [ str( $single_file.name ) for $single_file in $file_load_section.file_load_conditional.input ] )
-
-                singlefile_galaxyPath '$singlefile_galaxyPath' singlefile_sampleName '$singlefile_sampleName'
-            #else
-                zipfile '$file_load_section.file_load_conditional.input'
-            #end if
-        #end if
-    </token>
-
-    <xml name="input_file_load">
-        <section name="file_load_section" title="Resubmit your raw dataset or your zip file">
-            <conditional name="file_load_conditional">
-                <param name="file_load_select" type="select" label="Resubmit your dataset or your zip file" help="Use only if you get a message which say that your original dataset or zip file have been deleted on the server." >
-                    <option value="no" >no need</option>
-                    <option value="yes" >yes</option>
-                </param>
-                <when value="no">
-                </when>
-                <when value="yes">
-                    <param name="input" type="data" format="mzxml,mzml,mzdata,netcdf,no_unzip.zip,zip" multiple="true" label="File(s) from your history containing your chromatograms" help="Single file mode for the format: mzxml, mzml, mzdata and netcdf. Zip file mode for the format: no_unzip.zip, zip. See the help section below." />
-                </when>
-            </conditional>
-        </section>
+    <!-- INPUT_VALIDATORS -->
+    <xml name="input_validator_range_integer">
+        <validator type="regex" message="The format is 'min,max'" >[0-9]+ *, *[0-9]+</validator>
     </xml>
 
-    <xml name="test_file_load_zip">
-        <section name="file_load_section">
-            <conditional name="file_load_conditional">
-                <param name="file_load_select" value="yes" />
-                <param name="input" value="faahKO_reduce.zip" ftype="zip" />
-            </conditional>
-        </section>
+    <xml name="input_validator_range_float">
+        <validator type="regex" message="The format is 'min,max'" >[0-9]+\.?[0-9]* *, *[0-9]+\.?[0-9]*</validator>
     </xml>
 
-    <xml name="test_file_load_single">
-        <section name="file_load_section">
-            <conditional name="file_load_conditional">
-                <param name="file_load_select" value="yes" />
-                <param name="input" value="wt15.CDF,ko16.CDF,ko15.CDF,wt16.CDF" ftype="netcdf" />
-            </conditional>
-        </section>
+    <xml name="input_validator_list_integer">
+        <validator type="regex" message="The format is '1,2,4,6'" >[0-9, ]+</validator>
     </xml>
 
-    <token name="@COMMAND_PEAKLIST@">
-        #if $peaklist.peaklistBool
-            variableMetadataOutput '$variableMetadata'
-            dataMatrixOutput '$dataMatrix'
-            convertRTMinute $peaklist.convertRTMinute
-            numDigitsMZ $peaklist.numDigitsMZ
-            numDigitsRT $peaklist.numDigitsRT
-            intval $peaklist.intval
-        #end if
-    </token>
+
+    <token name="@INPUT_IMAGE_LABEL@">RData file</token>
+    <token name="@INPUT_IMAGE_HELP@">It contains a xcms3::XCMSnExp object (named xdata)</token>
 
-    <xml name="input_peaklist">
-        <conditional name="peaklist">
-            <param name="peaklistBool" type="boolean" label="Get a Peak List" />
-            <when value="true">
-              <param name="convertRTMinute" type="boolean" checked="false" truevalue="TRUE" falsevalue="FALSE" label="Convert retention time (seconds) into minutes" help="Convert the columns rtmed, rtmin and rtmax into minutes"/>
-              <param name="numDigitsMZ" type="integer" value="4" label="Number of decimal places for mass values reported in ions' identifiers." help="A minimum of 4 decimal places is recommended. Useful to avoid duplicates within identifiers" />
-              <param name="numDigitsRT" type="integer" value="0" label="Number of decimal places for retention time values reported in ions' identifiers." help="Useful to avoid duplicates within identifiers" />
-              <param name="intval" type="select" label="Reported intensity values" help="[intval] See the help section below">
-                  <option value="into" selected="true">into</option>
-                  <option value="maxo">maxo</option>
-                  <option value="intb">intb</option>
-              </param>
-            </when>
-            <when value="false" />
-        </conditional>
-    </xml>
 
-    <xml name="output_peaklist"  token_function="">
-        <data name="variableMetadata" format="tabular" label="${image.name[:-6]}.@FUNCTION@.variableMetadata.tsv">
-            <filter>(peaklist['peaklistBool'])</filter>
-        </data>
-        <data name="dataMatrix" format="tabular" label="${image.name[:-6]}.@FUNCTION@.dataMatrix.tsv" >
-            <filter>(peaklist['peaklistBool'])</filter>
-        </data>
-    </xml>
-
-    <token name="@HELP_AUTHORS@">
-.. 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
+    <!-- MISC -->
+    <token name="@HELP_AUTHORS_WRAPPERS@">
 
 .. 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 - SU/CNRS - Station biologique de Roscoff and Yann Guitton - LABERCA
+Part of Workflow4Metabolomics.org [W4M]
 
  | Contact support@workflow4metabolomics.org for any questions or concerns about the Galaxy implementation of this tool.
 
----------------------------------------------------
-
     </token>
 
-
-    <xml name="citation">
-        <citations>
-            <citation type="doi">10.1021/ac051437y</citation>
+    <xml name="citation_w4m">
             <citation type="doi">10.1093/bioinformatics/btu813</citation>
-        </citations>
     </xml>
 </macros>
b
diff -r 13558e8a4778 -r 833d2c821d9c macros_xcms.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/macros_xcms.xml Tue Sep 18 16:11:06 2018 -0400
[
b'@@ -0,0 +1,244 @@\n+<?xml version="1.0"?>\n+<macros>\n+\n+    <token name="@WRAPPER_VERSION@">3.0.0</token>\n+    <xml name="requirements">\n+        <requirements>\n+            <requirement type="package" version="@WRAPPER_VERSION@">bioconductor-xcms</requirement>\n+            <requirement type="package" version="1.1_4">r-batch</requirement>\n+            <requirement type="package" version="1.1_2">r-rcolorbrewer</requirement>\n+            <requirement type="package" version="6.0">unzip</requirement>\n+            <yield />\n+        </requirements>\n+    </xml>\n+\n+    <!-- FILE_LOAD for planemo test -->\n+    <token name="@COMMAND_FILE_LOAD@">\n+        #if $file_load_section.file_load_conditional.file_load_select == "yes":\n+            #if $file_load_section.file_load_conditional.input[0].is_of_type("mzxml") or $file_load_section.file_load_conditional.input[0].is_of_type("mzml") or $file_load_section.file_load_conditional.input[0].is_of_type("mzdata") or $file_load_section.file_load_conditional.input[0].is_of_type("netcdf"):\n+                #set singlefile_galaxyPath = \'|\'.join( [ str( $single_file ) for $single_file in $file_load_section.file_load_conditional.input ] )\n+                #set singlefile_sampleName = \'|\'.join( [ str( $single_file.name ) for $single_file in $file_load_section.file_load_conditional.input ] )\n+\n+                singlefile_galaxyPath \'$singlefile_galaxyPath\' singlefile_sampleName \'$singlefile_sampleName\'\n+            #else\n+                zipfile \'$file_load_section.file_load_conditional.input\'\n+            #end if\n+        #end if\n+    </token>\n+\n+    <xml name="input_file_load">\n+        <section name="file_load_section" title="Resubmit your raw dataset or your zip file">\n+            <conditional name="file_load_conditional">\n+                <param name="file_load_select" type="select" label="Resubmit your dataset or your zip file" help="Use only if you get a message saying that your original dataset or zip file have been deleted on the server." >\n+                    <option value="no" >no need</option>\n+                    <option value="yes" >yes</option>\n+                </param>\n+                <when value="no">\n+                </when>\n+                <when value="yes">\n+                    <param name="input" type="data" format="mzxml,mzml,mzdata,netcdf,no_unzip.zip,zip" multiple="true" label="File(s) from your history containing your chromatograms" help="Single file mode for the format: mzxml, mzml, mzdata and netcdf. Zip file mode for the format: no_unzip.zip, zip. See the help section below." />\n+                </when>\n+            </conditional>\n+        </section>\n+    </xml>\n+\n+    <xml name="test_file_load_zip">\n+        <section name="file_load_section">\n+            <conditional name="file_load_conditional">\n+                <param name="file_load_select" value="yes" />\n+                <param name="input" value="faahKO_reduce.zip" ftype="zip" />\n+            </conditional>\n+        </section>\n+    </xml>\n+\n+    <xml name="test_file_load_zip_sacuri">\n+        <section name="file_load_section">\n+            <conditional name="file_load_conditional">\n+                <param name="file_load_select" value="yes" />\n+                <param name="input" value="sacuri_dir_root.zip" ftype="zip" />\n+            </conditional>\n+        </section>\n+    </xml>\n+\n+    <xml name="test_file_load_single">\n+        <section name="file_load_section">\n+            <conditional name="file_load_conditional">\n+                <param name="file_load_select" value="yes" />\n+                <param name="input" value="wt15.CDF,ko16.CDF,ko15.CDF,wt16.CDF" ftype="netcdf" />\n+            </conditional>\n+        </section>\n+    </xml>\n+\n+    <xml name="test_file_load_single_ko15">\n+        <section name="file_load_section">\n+            <conditional name="file_load_conditional">\n+                <param name="file_load_select" value="yes" />\n+                <param name="input" value="ko15.CDF" ftype="netcdf" />\n+'..b'the m/z value at the peak apex and the m/z values left and right of it</option>\n+            <option value="meanApex3">mean of the m/z value of the peak apex and the m/z values left and right of it</option>\n+        </param>\n+        <param argument="integrate" type="select" label="Integration method" >\n+            <option value="1">peak limits are found through descent on the mexican hat filtered data (more robust, but less exact)</option>\n+            <option value="2">peak limits based on real data (more accurate but prone to noise)</option>\n+        </param>\n+        <param argument="mzdiff" type="float" value="-0.001" label="Minimum difference in m/z for peaks with overlapping retention times" help="can be negative to allow overlap" />\n+        <param argument="fitgauss" type="boolean" checked="false" truevalue="TRUE" falsevalue="FALSE" label="fitgauss" help="whether or not a Gaussian should be fitted to each peak" />\n+        <param argument="noise" type="integer" value="0" label="Noise filter" help="allowing to set a minimum intensity required for centroids to be considered in the first analysis step (centroids with intensity lower than \xe2\x80\x98noise\xe2\x80\x99 are omitted from ROI detection)." />\n+        <param argument="verboseColumns" type="boolean" checked="false" truevalue="TRUE" falsevalue="FALSE" label="verbose Columns" help="whether additional peak meta data columns should be returned" />\n+    </xml>\n+\n+    <token name="@COMMAND_CENTWAVEADVROI@">\n+            #if $sectionROI.roiList:\n+                roiList \'$sectionROI.roiList\'\n+                firstBaselineCheck $sectionROI.firstBaselineCheck\n+                #if $sectionROI.roiScales != "":\n+                    roiScales "c($sectionROI.roiScales)"\n+                #end if\n+            #end if\n+    </token>\n+\n+    <xml name="input_centwaveAdvROI" token_optional="true">\n+        <param argument="roiList" type="data" format="tabular" optional="@OPTIONAL@" label="List of regions-of-interest (ROI) representing detected mass traces" help="If ROIs are submitted the first analysis step is omitted and chromatographic peak detection is performed on the submitted ROIs. Each ROI is expected to have the following elements specified: \xe2\x80\x98scmin\xe2\x80\x99 (start scan index), \xe2\x80\x98scmax\xe2\x80\x99 (end scan index), \xe2\x80\x98mzmin\xe2\x80\x99 (minimum m/z), \xe2\x80\x98mzmax\xe2\x80\x99 (maximum m/z), \xe2\x80\x98length\xe2\x80\x99 (number of scans), \xe2\x80\x98intensity\xe2\x80\x99 (summed intensity)." />\n+        <param argument="firstBaselineCheck" type="boolean" checked="true" truevalue="TRUE" falsevalue="FALSE" label="Is continuous data within regions of interest is checked to be above the first baseline." />\n+        <param argument="roiScales" type="text" value="" optional="true" label="Numeric vector defining the scale for each region of interest in \xe2\x80\x98roiList\xe2\x80\x99" help="Length equal to \xe2\x80\x98roiList\xe2\x80\x99 - Should be used for the centWave-wavelets (format 0.9,1,0.2)">\n+            <expand macro="input_validator_range_float"/>\n+        </param>\n+    </xml>\n+\n+    <!-- MISC -->\n+    <token name="@HELP_AUTHORS@">\n+.. class:: infomark\n+\n+**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\n+\n+@HELP_AUTHORS_WRAPPERS@\n+\n+---------------------------------------------------\n+\n+    </token>\n+\n+    <token name="@HELP_XCMS_MANUAL@">\n+\n+For details and explanations concerning all the parameters and workflow of xcms_ package, see its manual_ and this example_\n+\n+.. _xcms: https://bioconductor.org/packages/release/bioc/html/xcms.html\n+.. _manual: http://www.bioconductor.org/packages/release/bioc/manuals/xcms/man/xcms.pdf\n+.. _example: https://bioconductor.org/packages/release/bioc/vignettes/xcms/inst/doc/xcms.html\n+\n+    </token>\n+\n+    <xml name="citation">\n+        <citations>\n+            <citation type="doi">10.1021/ac051437y</citation>\n+            <expand macro="citation_w4m"/>\n+        </citations>\n+    </xml>\n+</macros>\n'
b
diff -r 13558e8a4778 -r 833d2c821d9c static/images/xcms_group_workflow.png
b
Binary file static/images/xcms_group_workflow.png has changed
b
diff -r 13558e8a4778 -r 833d2c821d9c test-data/MM-single.xset.merged.RData
b
Binary file test-data/MM-single.xset.merged.RData has changed
b
diff -r 13558e8a4778 -r 833d2c821d9c test-data/faahKO-single-class.xset.merged.RData
b
Binary file test-data/faahKO-single-class.xset.merged.RData has changed
b
diff -r 13558e8a4778 -r 833d2c821d9c test-data/faahKO-single.xset.merged.RData
b
Binary file test-data/faahKO-single.xset.merged.RData has changed
b
diff -r 13558e8a4778 -r 833d2c821d9c test-data/faahKO-single.xset.merged.group.retcor.RData
b
Binary file test-data/faahKO-single.xset.merged.group.retcor.RData has changed
b
diff -r 13558e8a4778 -r 833d2c821d9c test-data/faahKO.xset.RData
b
Binary file test-data/faahKO.xset.RData has changed
b
diff -r 13558e8a4778 -r 833d2c821d9c test-data/faahKO.xset.group.dataMatrix.tsv
--- a/test-data/faahKO.xset.group.dataMatrix.tsv Wed Nov 29 09:46:03 2017 -0500
+++ b/test-data/faahKO.xset.group.dataMatrix.tsv Tue Sep 18 16:11:06 2018 -0400
b
b'@@ -1,62 +1,62 @@\n name\tko15\tko16\twt15\twt16\n M200T2877\tNA\t506848.884266667\tNA\tNA\n-M200T3874\t1144.01499999999\tNA\tNA\tNA\n+M200T3188\tNA\t4333.4849999999\tNA\tNA\n M200T3483\t6029.94499999992\tNA\tNA\tNA\n-M200T3188\tNA\t4333.4849999999\tNA\tNA\n+M200T3874\t1144.01499999999\tNA\tNA\tNA\n+M200T3672\tNA\tNA\t5108.15999999988\tNA\n M200T3523\tNA\tNA\t4586.52650000006\tNA\n-M200T3672\tNA\tNA\t5108.15999999988\tNA\n M200T3980\tNA\tNA\tNA\t1242.61000000004\n M200T3811\tNA\tNA\t1018.81499999998\tNA\n M201T3548\tNA\t2863.6449999999\tNA\tNA\n+M201T3778\tNA\tNA\t1680.81000000006\tNA\n M201T4055\tNA\tNA\t1339.64000000005\tNA\n-M201T3778\tNA\tNA\t1680.81000000006\tNA\n M201T3270\tNA\tNA\t4090.91000000014\tNA\n+M201T2559\tNA\t14307.2299999999\tNA\tNA\n M201T3630\tNA\tNA\tNA\t2931.24499999993\n-M201T2559\tNA\t14307.2299999999\tNA\tNA\n M201T3141\tNA\t254581.758476187\tNA\tNA\n-M201T3506\t4023.61499999999\tNA\tNA\tNA\n+M201T3991\tNA\tNA\t1657.33500000006\tNA\n M201T3683\tNA\tNA\t2906.20499999993\tNA\n+M201T3802\tNA\tNA\tNA\t3245.80999999992\n+M201T3506\t4023.61499999999\tNA\tNA\tNA\n M201T4059\tNA\tNA\t1275.47500000004\tNA\n-M201T3802\tNA\tNA\tNA\t3245.80999999992\n-M201T3991\tNA\tNA\t1657.33500000006\tNA\n M201T3885\tNA\t1220.70000000004\tNA\tNA\n-M201T4157\tNA\t774.575999999962\tNA\tNA\n+M201T4040\tNA\tNA\tNA\t1220.69999999998\n M201T3930\tNA\tNA\t1284.72816666668\tNA\n-M201T4040\tNA\tNA\tNA\t1220.69999999998\n+M201T4157\tNA\t774.575999999962\tNA\tNA\n M202T4013\tNA\tNA\t831.015000000029\tNA\n M202T3852\t892.050000000031\tNA\tNA\tNA\n M202T3298\t2759.095\tNA\tNA\tNA\n M202T3285\tNA\t3872.96250000005\tNA\tNA\n M202T3318\t3588.54500000001\tNA\tNA\tNA\n+M202T3170\t7682.58500000004\tNA\tNA\tNA\n M202T4062\tNA\tNA\t754.233600000007\tNA\n M202T3758\tNA\tNA\t1151.71733333335\tNA\n-M202T3170\t7682.58500000004\tNA\tNA\tNA\n M202T3375\t9879.84499999977\tNA\tNA\tNA\n+M202T4035\tNA\t688.600000000024\tNA\tNA\n M202T3897\tNA\t841.96999999998\tNA\tNA\n-M202T3267\t77227.3769090911\tNA\tNA\tNA\n M202T4145\tNA\tNA\tNA\t732.419999999983\n-M202T4035\tNA\t688.600000000024\tNA\tNA\n M202T3190\tNA\t3806.07999999999\tNA\tNA\n+M202T3267\t77227.3769090911\tNA\tNA\tNA\n M202T4012\tNA\t1629.165\tNA\tNA\n+M202T3936\tNA\tNA\t1461.71\tNA\n M202T2896\t36435.3079999996\tNA\tNA\tNA\n-M202T3936\tNA\tNA\t1461.71\tNA\n M202T3295\tNA\tNA\tNA\t3372.57500000002\n M203T4041\tNA\tNA\tNA\t978.124999999977\n M203T3320\tNA\tNA\tNA\t1136.19000000004\n M203T3310\tNA\t1694.89499999996\tNA\tNA\n M203T3972\tNA\tNA\t2796.65500000002\tNA\n-M203T2683\tNA\tNA\tNA\t6346.07499999991\n-M203T3725\tNA\tNA\tNA\t3345.96999999992\n-M203T3325\t3852.53759999981\tNA\tNA\tNA\n+M203T4143\tNA\t1020.37999999998\tNA\tNA\n M203T3353\tNA\t2974.74816666671\tNA\tNA\n+M203T3794\tNA\t2690.23500000009\tNA\tNA\n+M203T3725\tNA\tNA\tNA\t3345.96999999992\n+M203T2683\tNA\tNA\tNA\t6346.07499999991\n M203T4181\tNA\t804.409999999981\tNA\tNA\n-M203T3794\tNA\t2690.23500000009\tNA\tNA\n-M203T4143\tNA\t1020.37999999998\tNA\tNA\n+M203T3325\t3852.53759999981\tNA\tNA\tNA\n M203T4060\tNA\tNA\tNA\t1550.91499999999\n M204T3517\tNA\tNA\t967.169999999987\tNA\n+M204T4132\tNA\tNA\tNA\t793.455000000074\n M204T3059\t3905.96266666662\tNA\tNA\tNA\n M204T3661\t3002.85120000003\tNA\tNA\tNA\n-M204T4132\tNA\tNA\tNA\t793.455000000074\n M204T4018\t1111.14999999999\tNA\tNA\tNA\n M204T3838\tNA\tNA\t1676.11500000006\tNA\n M204T4146\tNA\tNA\tNA\t1089.24000000004\n@@ -74,106 +74,107 @@\n M205T3919\tNA\t3392.55866666671\tNA\tNA\n M205T4057\tNA\tNA\t1198.79000000004\tNA\n M206T4073\tNA\tNA\t793.454999999982\tNA\n+M206T3345\tNA\tNA\t641.649999999985\tNA\n M206T3295\tNA\tNA\tNA\t1023.50999999998\n M206T3093\tNA\tNA\tNA\t4682.47999999989\n-M206T3345\tNA\tNA\t641.649999999985\tNA\n+M206T3196\tNA\t10174.0649999999\tNA\tNA\n M206T4099\t1685.41525000004\tNA\tNA\tNA\n-M206T3196\tNA\t10174.0649999999\tNA\tNA\n M206T2783\t213659.293920001\tNA\t253825.557279999\t241844.442068965\n M206T3448\tNA\tNA\tNA\t3090.62812500006\n-M206T3674\tNA\tNA\tNA\t2237.94999999995\n+M206T2539\tNA\tNA\t9324.27000000002\tNA\n+M206T3185\t1931.20999999997\tNA\tNA\tNA\n+M206T3433\tNA\tNA\tNA\t2558.77500000009\n+M206T3551\tNA\tNA\t3048.62\tNA\n+M206T3237\t1713.67500000006\tNA\tNA\tNA\n M206T3262\tNA\tNA\tNA\t3137.82499999993\n M206T3699\tNA\tNA\tNA\t1953.12000000007\n-M206T2539\tNA\tNA\t9324.27000000002\tNA\n+M206T4052\tNA\tNA\tNA\t1505.46128571426\n M206T3357\tNA\tNA\tNA\t1536.82999999996\n+M206T3674\tNA\tNA\tNA\t2237.94999999995\n M206T3766\tNA\tNA\tNA\t2529.03999999997\n-M206T3185\t1931.20999999997\tNA'..b'186500.84141178\tNA\tNA\n+M597T4130\t15187.814210526\tNA\tNA\tNA\n+M598T2652\tNA\tNA\tNA\t5450.66280000004\n M598T2896\tNA\tNA\tNA\t2579.12000000009\n-M598T2652\tNA\tNA\tNA\t5450.66280000004\n M598T3985\t4690.30499999994\tNA\tNA\tNA\n+M598T3927\tNA\tNA\tNA\t5100.33500000001\n M598T3852\tNA\tNA\t6475.97000000023\tNA\n-M598T3927\tNA\tNA\tNA\t5100.33500000001\n M598T4234\t780.835199999962\tNA\tNA\tNA\n M598T3911\t2421.055\tNA\tNA\tNA\n+M598T2838\t4328.7899999999\tNA\tNA\tNA\n M598T3866\tNA\tNA\t923.232000000008\tNA\n-M598T2838\t4328.7899999999\tNA\tNA\tNA\n M598T2735\tNA\tNA\t3392.92\tNA\n M598T2526\tNA\tNA\t3350.66499999992\tNA\n M598T3054\tNA\tNA\t3904.17600000003\tNA\n M598T2564\tNA\tNA\t5259.96499999993\tNA\n M598T3243\tNA\tNA\t11160.015\tNA\n+M598T3165\tNA\tNA\tNA\t1547.78500000005\n M598T3688\tNA\tNA\tNA\t2907.39840000003\n-M598T3165\tNA\tNA\tNA\t1547.78500000005\n M598T3570\t4893.75500000017\tNA\tNA\tNA\n+M598T2990\tNA\t7907.94500000028\tNA\tNA\n M598T3738\t6735.75999999984\tNA\tNA\tNA\n-M598T2990\tNA\t7907.94500000028\tNA\tNA\n-M598T3724\tNA\t29323.4050000004\tNA\t48876.8056363635\n+M598T3730\tNA\t29323.4050000004\tNA\tNA\n+M598T3719\tNA\tNA\tNA\t48876.8056363635\n M598T3850\tNA\t19344.1924374998\tNA\tNA\n M598T4228_1\tNA\tNA\tNA\t852.92499999998\n M598T3702\tNA\tNA\tNA\t28572.205000001\n-M598T2827\t5337.7886250001\tNA\tNA\tNA\n+M598T3814\tNA\t201593.909999999\tNA\tNA\n M598T3223\tNA\t16185.5021250003\tNA\tNA\n-M598T3814\tNA\t201593.909999999\tNA\tNA\n-M598T3115\t3137.82499999993\tNA\tNA\tNA\n+M598T2827\t5337.7886250001\tNA\tNA\tNA\n+M598T3400\tNA\tNA\t4532.24000000016\tNA\n M598T3487\tNA\tNA\t9308.62000000032\tNA\n+M598T3708\tNA\tNA\tNA\t65022.6200000009\n+M598T4228_2\t1558.64039999994\tNA\tNA\tNA\n+M598T3115\t3137.82499999993\tNA\tNA\tNA\n+M598T3371\tNA\tNA\tNA\t7501.04499999995\n M598T3825\tNA\t126881.278714286\tNA\tNA\n-M598T3708\tNA\tNA\tNA\t65022.6200000009\n-M598T3400\tNA\tNA\t4532.24000000016\tNA\n-M598T4228_2\t1558.64039999994\tNA\tNA\tNA\n-M598T3371\tNA\tNA\tNA\t7501.04499999995\n M598T2659\t2139.08160000002\tNA\tNA\tNA\n M598T2680\tNA\t2826.02880000002\tNA\tNA\n+M598T3181\tNA\t2838.6076666667\tNA\tNA\n M598T2534\tNA\t1600.99499999996\tNA\tNA\n-M598T4015\t4444.59999999997\tNA\tNA\tNA\n-M598T3181\tNA\t2838.6076666667\tNA\tNA\n M598T2764\tNA\t5078.42499999999\tNA\tNA\n M598T2952\t5756.0700000002\tNA\tNA\tNA\n+M598T4015\t4444.59999999997\tNA\tNA\tNA\n M599T4234\tNA\tNA\tNA\t881.094999999979\n M599T3187\tNA\tNA\tNA\t2164.39499999999\n+M599T2935\tNA\t2557.20999999994\tNA\tNA\n M599T2855\tNA\tNA\tNA\t3757.56499999997\n-M599T2935\tNA\t2557.20999999994\tNA\tNA\n M599T2622\tNA\t2237.94999999995\tNA\tNA\n+M599T3096\tNA\tNA\tNA\t5745.1150000002\n M599T2619\t24597.6221333335\tNA\tNA\tNA\n-M599T3096\tNA\tNA\tNA\t5745.1150000002\n M599T4179\tNA\tNA\t769.979999999982\tNA\n M599T3744_1\tNA\t8220.94499999976\tNA\tNA\n M599T2885\tNA\tNA\tNA\t3269.28500000002\n M599T4196\t1370.93999999996\tNA\tNA\tNA\n M599T4163\tNA\t8068.71033333314\tNA\t5823.36499999964\n-M599T3478\tNA\tNA\tNA\t6298.5500000001\n M599T3697\tNA\tNA\t55051.9369090907\tNA\n+M599T3980\tNA\t15327.6100000005\tNA\tNA\n+M599T3839\tNA\tNA\t5238.05500000018\tNA\n M599T4129\tNA\tNA\t13849.6178571426\tNA\n+M599T3478\tNA\tNA\tNA\t6298.5500000001\n M599T3719\t22852.13\tNA\tNA\tNA\n-M599T3839\tNA\tNA\t5238.05500000018\tNA\n-M599T3980\tNA\t15327.6100000005\tNA\tNA\n M599T4048\t798856.451441174\tNA\t897286.005000001\tNA\n M599T3929\tNA\tNA\tNA\t2271127.28014893\n M599T3744_2\t2472129.73859259\tNA\tNA\tNA\n@@ -8259,18 +8356,18 @@\n M599T2974\tNA\tNA\tNA\t12502.4521250001\n M599T4127\tNA\t354770.43852632\tNA\tNA\n M599T3724\tNA\tNA\t797434.72246154\tNA\n-M600T2730\tNA\tNA\tNA\t1760.62499999996\n M600T3407\t3353.79499999992\tNA\tNA\tNA\n M600T3005\tNA\t5849.96999999986\tNA\tNA\n+M600T2730\tNA\tNA\tNA\t1760.62499999996\n M600T3609\tNA\tNA\tNA\t5001.73999999997\n M600T2523\tNA\tNA\t3209.81499999996\tNA\n M600T2562\tNA\t2928.1150000001\tNA\tNA\n M600T2606\t6022.12000000021\tNA\tNA\t2331.63714285708\n M600T2782\tNA\tNA\tNA\t2608.74386666668\n M600T3449\t4671.52499999989\t8782.77999999999\tNA\tNA\n+M600T2542\tNA\t3639.80233333338\tNA\tNA\n+M600T3348\t2327.15500000008\tNA\tNA\tNA\n+M600T3207\t7784.31000000027\tNA\tNA\tNA\n M600T3079\tNA\tNA\tNA\t3430.04160000003\n-M600T2542\tNA\t3639.80233333338\tNA\tNA\n+M600T2846\tNA\tNA\tNA\t1987.33833333336\n M600T2966\t9211.58999999991\tNA\tNA\tNA\n-M600T3207\t7784.31000000027\tNA\tNA\tNA\n-M600T2846\tNA\tNA\tNA\t1987.33833333336\n-M600T3348\t2327.15500000008\tNA\tNA\tNA\n'
b
diff -r 13558e8a4778 -r 833d2c821d9c test-data/faahKO.xset.group.retcor.RData
b
Binary file test-data/faahKO.xset.group.retcor.RData has changed
b
diff -r 13558e8a4778 -r 833d2c821d9c test-data/faahKO.xset.group.variableMetadata.tsv
--- a/test-data/faahKO.xset.group.variableMetadata.tsv Wed Nov 29 09:46:03 2017 -0500
+++ b/test-data/faahKO.xset.group.variableMetadata.tsv Tue Sep 18 16:11:06 2018 -0400
b
b'@@ -1,8276 +1,8373 @@\n-name\tnamecustom\tmz\tmzmin\tmzmax\trt\trtmin\trtmax\tnpeaks\tKO\tWT\n-M200T2877\tM200.1T2877\t200.100006103516\t200.100006103516\t200.100006103516\t2876.967\t2876.967\t2876.967\t1\t1\t0\n-M200T3874\tM200.2T3873.8\t200.199996948242\t200.199996948242\t200.199996948242\t3873.842\t3873.842\t3873.842\t1\t1\t0\n-M200T3483\tM200.2T3482.6\t200.199996948242\t200.199996948242\t200.199996948242\t3482.604\t3482.604\t3482.604\t1\t1\t0\n-M200T3188\tM200.2T3188.4\t200.199996948242\t200.199996948242\t200.199996948242\t3188.392\t3188.392\t3188.392\t1\t1\t0\n-M200T3523\tM200.2T3523.3\t200.199996948242\t200.199996948242\t200.199996948242\t3523.293\t3523.293\t3523.293\t1\t0\t1\n-M200T3672\tM200.2T3672\t200.199996948242\t200.199996948242\t200.199996948242\t3671.963\t3671.963\t3671.963\t1\t0\t1\n-M200T3980\tM200.3T3980.3\t200.300003051758\t200.300003051758\t200.300003051758\t3980.259\t3980.259\t3980.259\t1\t0\t1\n-M200T3811\tM200.3T3811.2\t200.300003051758\t200.300003051758\t200.300003051758\t3811.244\t3811.244\t3811.244\t1\t0\t1\n-M201T3548\tM200.8T3548.3\t200.800003051758\t200.800003051758\t200.800003051758\t3548.332\t3548.332\t3548.332\t1\t1\t0\n-M201T4055\tM200.8T4055.4\t200.800003051758\t200.800003051758\t200.800003051758\t4055.377\t4055.377\t4055.377\t1\t0\t1\n-M201T3778\tM200.8T3778.4\t200.800003051758\t200.800003051758\t200.800003051758\t3778.38\t3778.38\t3778.38\t1\t0\t1\n-M201T3270\tM200.9T3269.8\t200.900009155273\t200.900009155273\t200.900009155273\t3269.77\t3269.77\t3269.77\t1\t0\t1\n-M201T3630\tM200.9T3629.7\t200.900009155273\t200.900009155273\t200.900009155273\t3629.709\t3629.709\t3629.709\t1\t0\t1\n-M201T2559\tM200.9T2559.3\t200.900009155273\t200.900009155273\t200.900009155273\t2559.281\t2559.281\t2559.281\t1\t1\t0\n-M201T3141\tM201.1T3141.4\t201.100006103516\t201.100006103516\t201.100006103516\t3141.444\t3141.444\t3141.444\t1\t1\t0\n-M201T3506\tM201.2T3506.1\t201.199996948242\t201.199996948242\t201.199996948242\t3506.078\t3506.078\t3506.078\t1\t1\t0\n-M201T3683\tM201.2T3682.9\t201.199996948242\t201.199996948242\t201.199996948242\t3682.918\t3682.918\t3682.918\t1\t0\t1\n-M201T4059\tM201.2T4058.5\t201.199996948242\t201.199996948242\t201.199996948242\t4058.507\t4058.507\t4058.507\t1\t0\t1\n-M201T3802\tM201.2T3801.9\t201.199996948242\t201.199996948242\t201.199996948242\t3801.854\t3801.854\t3801.854\t1\t0\t1\n-M201T3991\tM201.2T3991.2\t201.199996948242\t201.199996948242\t201.199996948242\t3991.214\t3991.214\t3991.214\t1\t0\t1\n-M201T3885\tM201.3T3884.8\t201.300003051758\t201.300003051758\t201.300003051758\t3884.797\t3884.797\t3884.797\t1\t1\t0\n-M201T4157\tM201.3T4157.1\t201.300003051758\t201.300003051758\t201.300003051758\t4157.099\t4157.099\t4157.099\t1\t1\t0\n-M201T3930\tM201.3T3930.2\t201.300003051758\t201.300003051758\t201.300003051758\t3930.18\t3930.18\t3930.18\t1\t0\t1\n-M201T4040\tM201.3T4039.7\t201.300003051758\t201.300003051758\t201.300003051758\t4039.727\t4039.727\t4039.727\t1\t0\t1\n-M202T4013\tM201.7T4013.1\t201.699996948242\t201.699996948242\t201.699996948242\t4013.123\t4013.123\t4013.123\t1\t0\t1\n-M202T3852\tM201.7T3851.9\t201.699996948242\t201.699996948242\t201.699996948242\t3851.933\t3851.933\t3851.933\t1\t1\t0\n-M202T3298\tM201.8T3297.9\t201.800003051758\t201.800003051758\t201.800003051758\t3297.939\t3297.939\t3297.939\t1\t1\t0\n-M202T3285\tM201.8T3285.4\t201.800003051758\t201.800003051758\t201.800003051758\t3285.419\t3285.419\t3285.419\t1\t1\t0\n-M202T3318\tM201.8T3318.3\t201.800003051758\t201.800003051758\t201.800003051758\t3318.284\t3318.284\t3318.284\t1\t1\t0\n-M202T4062\tM201.8T4061.6\t201.800003051758\t201.800003051758\t201.800003051758\t4061.637\t4061.637\t4061.637\t1\t0\t1\n-M202T3758\tM201.8T3758\t201.800003051758\t201.800003051758\t201.800003051758\t3758.036\t3758.036\t3758.036\t1\t0\t1\n-M202T3170\tM201.8T3169.6\t201.800003051758\t201.800003051758\t201.800003051758\t3169.613\t3169.613\t3169.613\t1\t1\t0\n-M202T3375\tM201.8T3374.6\t201.800003051758\t201.800003051758\t201.800003051758\t3374.622\t3374.622\t3374.622\t1\t1\t0\n-M202T3897\tM201.9T3897.3\t201.900009155273\t201.900009155273\t201.900009155273\t3897.316\t3897.316\t3897.316\t1\t1\t0\n-M202T3267\tM201.9T3266.6\t201.900009155273\t201.900009155273\t201.900009155273\t3266.64\t3266.64\t3266.64\t1\t1\t0\n-M202T4145\tM201.9T4144.6\t201.900009155273\t201.900009155273\t201.900009155273\t4144.579\t4144.579\t4144.579\t1\t0\t1\n-M202T4035\t'..b'6\tM598.9T3096.1\t598.900024414062\t598.900024414062\t598.900024414062\t3096.06\t3096.06\t3096.06\t1\t0\t1\t7627\n+M599T2619\tM598.9T2618.8\t598.900024414062\t598.900024414062\t598.900024414062\t2618.75\t2618.75\t2618.75\t1\t1\t0\t93\n+M599T4179\tM599T4179\t599\t599\t599\t4179.008\t4179.008\t4179.008\t1\t0\t1\t6828\n+M599T3744_1\tM599.1T3744_1\t599.100036621094\t599.100036621094\t599.100036621094\t3743.951\t3743.951\t3743.951\t1\t1\t0\t3887\n+M599T2885\tM599.1T2884.8\t599.100036621094\t599.100036621094\t599.100036621094\t2884.791\t2884.791\t2884.791\t1\t0\t1\t7424\n+M599T4196\tM599.1T4196.2\t599.100036621094\t599.100036621094\t599.100036621094\t4196.223\t4196.223\t4196.223\t1\t1\t0\t2190\n+M599T4163\tM599.2T4163.4\t599.200012207031\t599.200012207031\t599.200012207031\t4163.358\t4160.228\t4166.488\t2\t1\t1\tc(4567, 9114)\n+M599T3697\tM599.2T3697\t599.200012207031\t599.200012207031\t599.200012207031\t3697.002\t3697.002\t3697.002\t1\t0\t1\t6075\n+M599T3980\tM599.2T3980.3\t599.200012207031\t599.200012207031\t599.200012207031\t3980.259\t3980.259\t3980.259\t1\t1\t0\t4253\n+M599T3839\tM599.2T3839.4\t599.200012207031\t599.200012207031\t599.200012207031\t3839.413\t3839.413\t3839.413\t1\t0\t1\t6302\n+M599T4129\tM599.2T4128.9\t599.200012207031\t599.200012207031\t599.200012207031\t4128.93\t4128.93\t4128.93\t1\t0\t1\t6764\n+M599T3478\tM599.2T3477.9\t599.200012207031\t599.200012207031\t599.200012207031\t3477.909\t3477.909\t3477.909\t1\t0\t1\t8116\n+M599T3719\tM599.2T3718.9\t599.200012207031\t599.200012207031\t599.200012207031\t3718.912\t3718.912\t3718.912\t1\t1\t0\t1427\n+M599T4048\tM599.3T4047.6\t599.299987792969\t599.299987792969\t599.299987792969\t4047.552\t4047.552\t4053.812\t3\t1\t1\tc(1980, 6571, 6597)\n+M599T3929\tM599.3T3928.6\t599.299987792969\t599.299987792969\t599.299987792969\t3928.615\t3928.615\t3928.615\t2\t0\t1\tc(8717, 8748)\n+M599T3744_2\tM599.3T3744_2\t599.299987792969\t599.299987792969\t599.299987792969\t3743.951\t3743.951\t3743.951\t1\t1\t0\t1481\n+M599T3731\tM599.3T3731.4\t599.299987792969\t599.299987792969\t599.299987792969\t3731.431\t3731.431\t3731.431\t1\t0\t1\t6133\n+M599T3431\tM599.3T3431\t599.299987792969\t599.299987792969\t599.299987792969\t3430.96\t3430.96\t3430.96\t1\t1\t0\t1028\n+M599T4130\tM599.3T4130.5\t599.299987792969\t599.299987792969\t599.299987792969\t4130.494\t4130.494\t4130.494\t1\t0\t1\t9058\n+M599T2847\tM599.4T2847.2\t599.400024414062\t599.400024414062\t599.400024414062\t2847.232\t2847.232\t2847.232\t1\t1\t0\t2616\n+M599T3810\tM599.4T3809.7\t599.400024414062\t599.400024414062\t599.400024414062\t3809.679\t3809.679\t3809.679\t1\t1\t0\t1552\n+M599T2974\tM599.4T2974\t599.400024414062\t599.400024414062\t599.400024414062\t2973.994\t2973.994\t2973.994\t1\t0\t1\t7528\n+M599T4127\tM599.4T4127.4\t599.400024414062\t599.400024414062\t599.400024414062\t4127.364\t4127.364\t4127.364\t1\t1\t0\t4466\n+M599T3724\tM599.4T3723.6\t599.400024414062\t599.400024414062\t599.400024414062\t3723.607\t3723.607\t3723.607\t1\t0\t1\t6112\n+M600T3407\tM599.5T3407.5\t599.5\t599.5\t599.5\t3407.486\t3407.486\t3407.486\t1\t1\t0\t999\n+M600T3005\tM599.5T3005.3\t599.5\t599.5\t599.5\t3005.293\t3005.293\t3005.293\t1\t1\t0\t2885\n+M600T2730\tM599.5T2729.9\t599.5\t599.5\t599.5\t2729.861\t2729.861\t2729.861\t1\t0\t1\t7235\n+M600T3609\tM599.5T3609.4\t599.5\t599.5\t599.5\t3609.365\t3609.365\t3609.365\t1\t0\t1\t8294\n+M600T2523\tM599.8T2523.3\t599.799987792969\t599.799987792969\t599.799987792969\t2523.287\t2523.287\t2523.287\t1\t0\t1\t4673\n+M600T2562\tM599.8T2562.4\t599.799987792969\t599.799987792969\t599.799987792969\t2562.411\t2562.411\t2562.411\t1\t1\t0\t2316\n+M600T2606\tM599.9T2606.2\t599.900024414062\t599.900024414062\t599.900024414062\t2606.23\t2604.665\t2607.795\t2\t1\t1\tc(75, 7054)\n+M600T2782\tM599.9T2781.5\t599.900024414062\t599.900024414062\t599.900024414062\t2781.504\t2781.504\t2781.504\t1\t0\t1\t7290\n+M600T3449\tM600T3449\t600\t600\t600\t3448.9575\t3445.045\t3452.87\t2\t2\t0\tc(1049, 3394)\n+M600T2542\tM600T2542.1\t600\t600\t600\t2542.067\t2542.067\t2542.067\t1\t1\t0\t2295\n+M600T3348\tM600T3348\t600\t600\t600\t3348.018\t3348.018\t3348.018\t1\t1\t0\t903\n+M600T3207\tM600T3207.2\t600\t600\t600\t3207.172\t3207.172\t3207.172\t1\t1\t0\t705\n+M600T3079\tM600T3078.8\t600\t600\t600\t3078.845\t3078.845\t3078.845\t1\t0\t1\t7609\n+M600T2846\tM600T2845.7\t600\t600\t600\t2845.667\t2845.667\t2845.667\t1\t0\t1\t7388\n+M600T2966\tM600T2966.2\t600\t600\t600\t2966.169\t2966.169\t2966.169\t1\t1\t0\t455\n'
b
diff -r 13558e8a4778 -r 833d2c821d9c test-data/faahKO_reduce.zip
b
Binary file test-data/faahKO_reduce.zip has changed
b
diff -r 13558e8a4778 -r 833d2c821d9c test-data/ko15.CDF
b
Binary file test-data/ko15.CDF has changed
b
diff -r 13558e8a4778 -r 833d2c821d9c test-data/ko16.CDF
b
Binary file test-data/ko16.CDF has changed
b
diff -r 13558e8a4778 -r 833d2c821d9c test-data/wt15.CDF
b
Binary file test-data/wt15.CDF has changed
b
diff -r 13558e8a4778 -r 833d2c821d9c test-data/wt16.CDF
b
Binary file test-data/wt16.CDF has changed
b
diff -r 13558e8a4778 -r 833d2c821d9c xcms.r
--- a/xcms.r Wed Nov 29 09:46:03 2017 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
[
@@ -1,229 +0,0 @@
-#!/usr/bin/env Rscript
-# xcms.r version="2.2.0"
-#Authors ABIMS TEAM
-#BPC Addition from Y.guitton
-
-
-# ----- LOG FILE -----
-log_file=file("log.txt", open = "wt")
-sink(log_file)
-sink(log_file, type = "output")
-
-
-# ----- PACKAGE -----
-cat("\tPACKAGE INFO\n")
-#pkgs=c("xcms","batch")
-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)))
-    cat(pkg,"\t",as.character(packageVersion(pkg)),"\n",sep="")
-}
-source_local <- function(fname){ argv <- commandArgs(trailingOnly = FALSE); base_dir <- dirname(substring(argv[grep("--file=", argv)], 8)); source(paste(base_dir, fname, sep="/")) }
-cat("\n\n");
-
-
-
-
-
-# ----- ARGUMENTS -----
-cat("\tARGUMENTS INFO\n")
-listArguments = parseCommandArgs(evaluate=FALSE) #interpretation of arguments given in command line as an R list of objects
-write.table(as.matrix(listArguments), col.names=F, quote=F, sep='\t')
-
-cat("\n\n");
-
-
-# ----- ARGUMENTS PROCESSING -----
-cat("\tINFILE PROCESSING INFO\n")
-
-#image is an .RData file necessary to use xset variable given by previous tools
-if (!is.null(listArguments[["image"]])){
-    load(listArguments[["image"]]); listArguments[["image"]]=NULL
-}
-
-#Import the different functions
-source_local("lib.r")
-
-cat("\n\n")
-
-#Import the different functions
-
-# ----- PROCESSING INFILE -----
-cat("\tARGUMENTS PROCESSING INFO\n")
-
-# Save arguments to generate a report
-if (!exists("listOFlistArguments")) listOFlistArguments=list()
-listOFlistArguments[[paste(format(Sys.time(), "%y%m%d-%H:%M:%S_"),listArguments[["xfunction"]],sep="")]] = listArguments
-
-
-#saving the commun parameters
-thefunction = listArguments[["xfunction"]]; listArguments[["xfunction"]]=NULL #delete from the list of arguments
-
-xsetRdataOutput = paste(thefunction,"RData",sep=".")
-if (!is.null(listArguments[["xsetRdataOutput"]])){
-    xsetRdataOutput = listArguments[["xsetRdataOutput"]]; listArguments[["xsetRdataOutput"]]=NULL
-}
-
-#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
-}
-variableMetadataOutput = "variableMetadata.tsv"
-if (!is.null(listArguments[["variableMetadataOutput"]])){
-    variableMetadataOutput = listArguments[["variableMetadataOutput"]]; listArguments[["variableMetadataOutput"]]=NULL
-}
-dataMatrixOutput = "dataMatrix.tsv"
-if (!is.null(listArguments[["dataMatrixOutput"]])){
-    dataMatrixOutput = listArguments[["dataMatrixOutput"]]; listArguments[["dataMatrixOutput"]]=NULL
-}
-if (!is.null(listArguments[["convertRTMinute"]])){
-    convertRTMinute = listArguments[["convertRTMinute"]]; listArguments[["convertRTMinute"]]=NULL
-}
-if (!is.null(listArguments[["numDigitsMZ"]])){
-    numDigitsMZ = listArguments[["numDigitsMZ"]]; listArguments[["numDigitsMZ"]]=NULL
-}
-if (!is.null(listArguments[["numDigitsRT"]])){
-  numDigitsRT = listArguments[["numDigitsRT"]]; listArguments[["numDigitsRT"]]=NULL
-}
-if (!is.null(listArguments[["intval"]])){
-    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
-    if (!exists("zipfile")) zipfile=NULL
-    rawFilePath = getRawfilePathFromArguments(singlefile, zipfile, listArguments)
-    zipfile = rawFilePath$zipfile
-    singlefile = rawFilePath$singlefile
-    listArguments = rawFilePath$listArguments
-    directory = retrieveRawfileInTheWorkingDirectory(singlefile, zipfile)
-    md5sumList=list("origin"=getMd5sum(directory))
-}
-
-#addition of the directory to the list of arguments in the first position
-if (thefunction == "xcmsSet") {
-    checkXmlStructure(directory)
-    checkFilesCompatibilityWithXcms(directory)
-    listArguments=append(directory, listArguments)
-}
-
-
-#addition of xset object to the list of arguments in the first position
-if (exists("xset")){
-    listArguments=append(list(xset), listArguments)
-}
-
-cat("\n\n")
-
-
-
-
-# ----- MAIN PROCESSING INFO -----
-cat("\tMAIN PROCESSING INFO\n")
-
-
-#Verification of a group step before doing the fillpeaks job.
-
-if (thefunction == "fillPeaks") {
-    res=try(is.null(groupnames(xset)))
-    if (class(res) == "try-error"){
-        error<-geterrmessage()
-        write(error, stderr())
-        stop("You must always do a group step after a retcor. Otherwise it won't work for the fillpeaks step")
-    }
-
-}
-
-#change the default display settings
-#dev.new(file="Rplots.pdf", width=16, height=12)
-pdf(file=rplotspdf, width=16, height=12)
-if (thefunction == "group") {
-    par(mfrow=c(2,2))
-}
-#else if (thefunction == "retcor") {
-#try to change the legend display
-#     par(xpd=NA)
-#     par(xpd=T, mar=par()$mar+c(0,0,0,4))
-#}
-
-
-#execution of the function "thefunction" with the parameters given in "listArguments"
-
-cat("\t\tCOMPUTE\n")
-xset = do.call(thefunction, listArguments)
-
-# check if there are no peaks
-if (nrow(peaks(xset)) == 0) {
-    stop("No peaks were detected. You should review your settings")
-}
-
-
-cat("\n\n")
-
-dev.off() #dev.new(file="Rplots.pdf", width=16, height=12)
-
-if (thefunction  == "xcmsSet") {
-
-    #transform the files absolute pathways into relative pathways
-    xset@filepaths<-sub(paste(getwd(),"/",sep="") ,"", xset@filepaths)
-    if(exists("zipfile") && !is.null(zipfile) && (zipfile!="")) {
-
-        #Modify the samples names (erase the path)
-        for(i in 1:length(sampnames(xset))){
-
-            sample_name=unlist(strsplit(sampnames(xset)[i], "/"))
-            sample_name=sample_name[length(sample_name)]
-            sample_name= unlist(strsplit(sample_name,"[.]"))[1]
-            sampnames(xset)[i]=sample_name
-
-        }
-
-    }
-
-}
-
-# -- TIC --
-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)
-} else if (thefunction == "retcor") {
-    cat("\t\tGET TIC GRAPH\n")
-    getTICs(xcmsSet=xset, pdfname=ticspdf,rt="corrected")
-    getBPCs(xcmsSet=xset,rt="corrected",pdfname=bicspdf)
-}
-
-if ((thefunction == "group" || thefunction == "fillPeaks") && exists("intval")) {
-    getPeaklistW4M(xset,intval,convertRTMinute,numDigitsMZ,numDigitsRT,variableMetadataOutput,dataMatrixOutput)
-}
-
-
-cat("\n\n")
-
-# ----- EXPORT -----
-
-cat("\tXSET OBJECT INFO\n")
-print(xset)
-#delete the parameters to avoid the passage to the next tool in .RData image
-
-
-#saving R data in .Rdata file to save the variables used in the present tool
-objects2save = c("xset","zipfile","singlefile","listOFlistArguments","md5sumList","sampleNamesList")
-save(list=objects2save[objects2save %in% ls()], file=xsetRdataOutput)
-
-cat("\n\n")
-
-
-cat("\tDONE\n")
b
diff -r 13558e8a4778 -r 833d2c821d9c xcms_group.r
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/xcms_group.r Tue Sep 18 16:11:06 2018 -0400
[
@@ -0,0 +1,114 @@
+#!/usr/bin/env Rscript
+
+# ----- LOG FILE -----
+log_file=file("log.txt", open = "wt")
+sink(log_file)
+sink(log_file, type = "output")
+
+
+# ----- PACKAGE -----
+cat("\tSESSION INFO\n")
+
+#Import the different functions
+source_local <- function(fname){ argv <- commandArgs(trailingOnly=FALSE); base_dir <- dirname(substring(argv[grep("--file=", argv)], 8)); source(paste(base_dir, fname, sep="/")) }
+source_local("lib.r")
+source_local("lib-xcms3.x.x.r")
+
+pkgs <- c("xcms","batch","RColorBrewer")
+loadAndDisplayPackages(pkgs)
+cat("\n\n");
+
+
+# ----- ARGUMENTS -----
+cat("\tARGUMENTS INFO\n")
+args <- parseCommandArgs(evaluate=FALSE) #interpretation of arguments given in command line as an R list of objects
+write.table(as.matrix(args), col.names=F, quote=F, sep='\t')
+
+cat("\n\n")
+
+# ----- PROCESSING INFILE -----
+cat("\tARGUMENTS PROCESSING INFO\n")
+
+#saving the specific parameters
+method <- args$method
+
+if (!is.null(args$convertRTMinute)) convertRTMinute <- args$convertRTMinute
+if (!is.null(args$numDigitsMZ)) numDigitsMZ <- args$numDigitsMZ
+if (!is.null(args$numDigitsRT)) numDigitsRT <- args$numDigitsRT
+if (!is.null(args$intval)) intval <- args$intval
+if (!is.null(args$naTOzero)) naTOzero <- args$naTOzero
+
+cat("\n\n")
+
+
+# ----- ARGUMENTS PROCESSING -----
+cat("\tINFILE PROCESSING INFO\n")
+
+#image is an .RData file necessary to use xset variable given by previous tools
+load(args$image)
+if (!exists("xdata")) stop("\n\nERROR: The RData doesn't contain any object called 'xdata'. This RData should have been created by an old version of XMCS 2.*")
+
+# Handle infiles
+if (!exists("singlefile")) singlefile <- NULL
+if (!exists("zipfile")) zipfile <- NULL
+rawFilePath <- getRawfilePathFromArguments(singlefile, zipfile, args)
+zipfile <- rawFilePath$zipfile
+singlefile <- rawFilePath$singlefile
+directory <- retrieveRawfileInTheWorkingDirectory(singlefile, zipfile)
+
+# Check some character issues
+md5sumList <- list("origin" = getMd5sum(directory))
+checkXmlStructure(directory)
+checkFilesCompatibilityWithXcms(directory)
+
+
+cat("\n\n")
+
+
+# ----- MAIN PROCESSING INFO -----
+cat("\tMAIN PROCESSING INFO\n")
+
+
+cat("\t\tCOMPUTE\n")
+
+
+cat("\t\t\tPerform the correspondence\n")
+args$sampleGroups = xdata$sample_group
+
+# clear the arguement list to remove unexpected key/value as singlefile_galaxyPath or method ...
+args <- args[names(args) %in% slotNames(do.call(paste0(method,"Param"), list(sampleGroups=c(1,2))))]
+
+groupChromPeaksParam <- do.call(paste0(method,"Param"), args)
+print(groupChromPeaksParam)
+xdata <- groupChromPeaks(xdata, param = groupChromPeaksParam)
+
+
+cat("\t\tDRAW GRAPHICS\n")
+getPlotChromPeakDensity(xdata)
+
+if (exists("intval")) {
+    getPeaklistW4M(xdata, intval, convertRTMinute, numDigitsMZ, numDigitsRT, naTOzero, "variableMetadata.tsv", "dataMatrix.tsv")
+}
+
+cat("\n\n")
+
+# ----- EXPORT -----
+
+cat("\tXCMSnExp OBJECT INFO\n")
+print(xdata)
+cat("\n\n")
+
+cat("\txcmsSet OBJECT INFO\n")
+# Get the legacy xcmsSet object
+xset <- getxcmsSetObject(xdata)
+print(xset)
+cat("\n\n")
+
+#saving R data in .Rdata file to save the variables used in the present tool
+objects2save = c("xdata","zipfile","singlefile","md5sumList","sampleNamesList", "chromTIC", "chromBPI", "chromTIC_adjusted", "chromBPI_adjusted")
+save(list=objects2save[objects2save %in% ls()], file="group.RData")
+
+cat("\n\n")
+
+
+cat("\tDONE\n")