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

Changeset 12:15646e937936 (2017-04-07)
Previous changeset 11:91311aa08cdc (2017-01-30) Next changeset 13:c934dd5c49a9 (2017-11-29)
Commit message:
planemo upload for repository https://github.com/workflow4metabolomics/xcms commit a6f5f18b3d6130f7d7fbb9f2df856838c6217797
modified:
README.rst
abims_xcms_xcmsSet.xml
lib.r
macros.xml
xcms.r
added:
destinations_input_type.py
job_conf.xml.sample
static/images/xcms_xcmsset_workflow.png
test-data/HU_neg_017.mzXML
test-data/MM14.mzML
test-data/MM8.mzML
removed:
Makefile
planemo_test.sh
static/images/XCMS_Galaxy_workflow.png
tool_dependencies.xml
b
diff -r 91311aa08cdc -r 15646e937936 Makefile
--- a/Makefile Mon Jan 30 08:52:59 2017 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
[
@@ -1,23 +0,0 @@
-# USAGE: make [install|clean]
-
-# -------- VARIABLE --------
-
-OBJ=xcms_set.tgz
-DEP=abims_xcms_xcmsSet.xml tool_dependencies.xml repository_dependencies.xml static test-data
-
-
-# ------------------------
-
-all: $(OBJ)
-
-$(OBJ): $(DEP)
- tar --exclude=".svn" -zchf $@ $^
-
-# ------------------------
-
-install: $(OBJ)
- mv *.tgz ~
-
-clean:
- rm *.tgz
-
b
diff -r 91311aa08cdc -r 15646e937936 README.rst
--- a/README.rst Mon Jan 30 08:52:59 2017 -0500
+++ b/README.rst Fri Apr 07 07:35:01 2017 -0400
[
@@ -1,7 +1,33 @@
+Job Dynamic Destination Mapping
+-------------------------------
+
+**Why**
+
+xcmsSet wrapper allow both individual file and zip file which can contain several samples.
+Thus, it can be interesting to adjust the number of thread according to the input type.
+For example: 1 thread for a single mzXML or NetCDF file and 8 threads for a zip file.
+
+**What**
+
+The [Dynamic Destination Mapping](https://galaxyproject.org/admin/config/jobs/#dynamic-destination-mapping) allow Galaxy to choose a destination at runtime based on factors such as the job inputs, user submitting the job, cluster status, etc...
+
+**How**
+
+ - The file `destinations_input_type.py` (shiped with this tool) must be place in `lib/galaxy/jobs/rules/`
+ - The `job_conf.xml` must be inspired by the `job_conf.xml.sample` shiped with this tool
+ - The final destination names must match between the `job_conf.xml` and the `destinations_input_type.py`
+ - Restart Galaxy
+
 
 Changelog/News
 --------------
 
+**Version 2.1.0 - 22/02/2017**
+
+- NEW: The W4M tools will be able now to take as input a single file. It will allow to submit in parallel several files and merge them afterward using "xcms.xcmsSet Merger" before "xcms.group".
+
+- BUGFIX: the default value of "matchedFilter" -> "Step size to use for profile generation" which was of 0.01 have been changed to fix with the XMCS default values to 0.1
+
 **Version 2.0.11 - 22/12/2016**
 
 - BUGFIX: propose scanrange for all methods
@@ -49,13 +75,3 @@
 - IMPROVEMENT: new datatype/dataset formats (rdata.xcms.raw, rdata.xcms.group, rdata.xcms.retcor ...) will facilitate the sequence of tools and so avoid incompatibility errors.
 
 - IMPROVEMENT: parameter labels have changed to facilitate their reading.
-
-
-Test Status
------------
-
-Planemo test using conda: passed
-
-Planemo test using source env.sh: passed
-
-Planemo shed_test : passed
b
diff -r 91311aa08cdc -r 15646e937936 abims_xcms_xcmsSet.xml
--- a/abims_xcms_xcmsSet.xml Mon Jan 30 08:52:59 2017 -0500
+++ b/abims_xcms_xcmsSet.xml Fri Apr 07 07:35:01 2017 -0400
[
b'@@ -1,5 +1,4 @@\n-<tool id="abims_xcms_xcmsSet" name="xcms.xcmsSet" version="2.0.11">\n-\n+<tool id="abims_xcms_xcmsSet" name="xcms.xcmsSet" version="2.1.0">\n     <description>Filtration and Peak Identification using xcmsSet function from xcms R package to preprocess LC/MS data for relative quantification and statistical analysis </description>\n \n     <macros>\n@@ -11,18 +10,19 @@\n \n     <command><![CDATA[\n         @COMMAND_XCMS_SCRIPT@\n-        #if $inputs.input == "lib":\n-            library $__app__.config.user_library_import_dir/$__user_email__/$inputs.library\n-        #elif $inputs.input == "zip_file":\n-            zipfile $inputs.zip_file\n+\n+        #if $input.is_of_type("mzxml") or $input.is_of_type("mzml") or $input.is_of_type("mzdata") or $input.is_of_type("netcdf"):\n+            singlefile_galaxyPath \'$input\' singlefile_sampleName \'$input.name\'\n+        #else\n+            zipfile \'$input\'\n         #end if\n \n         xfunction xcmsSet\n \n-        xsetRdataOutput $xsetRData\n-        sampleMetadataOutput $sampleMetadata\n-        ticspdf $ticsRawPdf\n-        bicspdf $bpcsRawPdf\n+        xsetRdataOutput \'$xsetRData\'\n+        sampleMetadataOutput \'$sampleMetadata\'\n+        ticspdf \'$ticsRawPdf\'\n+        bicspdf \'$bpcsRawPdf\'\n \n \n         #if $options_scanrange.option == "show":\n@@ -48,9 +48,8 @@\n                 ## sigma "$methods.options_m.sigma"\n                 max $methods.options_m.max\n                 snthresh $methods.options_m.snthresh\n-                ## mzdiff $methods.options_m.mzdiff\n                 steps $methods.options_m.steps\n-                ## sleep $methods.options_m.sleep\n+                mzdiff $methods.options_m.mzdiff\n             #end if\n         #elif $methods.method == "MSW":\n             snthr $methods.snthr\n@@ -65,21 +64,7 @@\n \n     <inputs>\n \n-        <conditional name="inputs">\n-            <param name="input" type="select" label="Choose your inputs method" >\n-                <option value="zip_file" selected="true">Zip file from your history containing your chromatograms</option>\n-                <option value="lib" >Library directory name</option>\n-            </param>\n-            <when value="zip_file">\n-                <param name="zip_file" type="data" format="no_unzip.zip,zip" label="Zip file" />\n-             </when>\n-            <when value="lib">\n-                <param name="library" type="text" size="40" label="Library directory name" help="The name of your directory containing all your data" >\n-                <validator type="empty_field"/>\n-            </param>\n-                </when>\n-\n-        </conditional>\n+        <param name="input" type="data" format="mzxml,mzml,mzdata,netcdf,no_unzip.zip,zip" 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 \n         <conditional name="options_scanrange">\n             <param name="option" type="select" label="Scan range option " >\n@@ -103,7 +88,6 @@\n             <option value="binlinbase">binlinbase</option>\n             <option value="intlin">intlin</option>\n         </param>\n-        <param name="nSlaves" type="integer" value="9" label="MPI-slaves CPU" help="number of MPI-slaves to use for parallel peak detection" />\n -->\n         <conditional name="methods">\n             <param name="method" type="select" label="Extraction method for peaks detection" help="[method] See the help section below">\n@@ -116,7 +100,7 @@\n             <when value="centWave">\n                 <param name="ppm" type="integer" value="25" label="Max tolerated ppm m/z deviation in consecutive scans in ppm" help="[ppm]" />\n                 <param name="peakwidth" type="text" value="20,50" label="Min,Max peak width in seconds" help="[peakwidth]" />\n-                \n+\n                 <conditional name="options_c">\n                     <param name="option" type="select" label="Advanced options" >\n       '..b'ds|method" value="centWave" />\n+            <param name="methods|ppm" value="25" />\n+            <param name="methods|peakwidth" value="20,50" />\n+            <output name="log">\n+                <assert_contents>\n+                    <has_text text="object with 1 samples" />\n+                    <has_text text="Time range: 3.5-1139.1 seconds (0.1-19 minutes)" />\n+                    <has_text text="Mass range: 57.9756-556.8128 m/z" />\n+                    <has_text text="Peaks: 380 (about 380 per sample)" />\n+                    <has_text text="Peak Groups: 0" />\n+                    <has_text text="Sample classes: ." />\n+                </assert_contents>\n+            </output>\n+        </test>\n+        <test>\n+            <param name="input" value="MM14.mzML"  ftype="mzxml" />\n+            <param name="methods|method" value="centWave" />\n+            <param name="methods|ppm" value="56" />\n+            <param name="methods|peakwidth" value="5.275,13.5" />\n+            <output name="log">\n+                <assert_contents>\n+                    <has_text text="object with 1 samples" />\n+                    <has_text text="Time range: 271-307.3 seconds (4.5-5.1 minutes)" />\n+                    <has_text text="Mass range: 117.0357-936.7059 m/z" />\n+                    <has_text text="Peaks: 222 (about 222 per sample)" />\n+                    <has_text text="Peak Groups: 0" />\n+                    <has_text text="Sample classes: ." />\n+                </assert_contents>\n+            </output>\n+        </test>\n     </tests>\n \n     <help><![CDATA[\n@@ -289,7 +366,7 @@\n \n **Example of a metabolomic workflow**\n \n-.. image:: XCMS_Galaxy_workflow.png\n+.. image:: xcms_xcmsset_workflow.png\n \n \n ------\n@@ -306,21 +383,23 @@\n Input files\n -----------\n \n-+---------------------------+------------+\n-| Parameter : num + label   |   Format   |\n-+===========================+============+\n-| 1 : Choose your inputs    |   zip      |\n-+---------------------------+------------+\n++---------------------------+----------------------------------+\n+| Parameter : num + label   |   Format                         |\n++===========================+==================================+\n+| OR : Zip file             |   zip                            |\n++---------------------------+----------------------------------+\n+| OR : Single file          |   mzXML, mzML, mzData, netCDF    |\n++---------------------------+----------------------------------+\n \n **Choose your inputs**\n \n You have two methods for your inputs:\n \n-    | Zip file (recommended): You can put a zip file containing your inputs: myinputs.zip (containing all your conditions as sub-directories).\n-    | library folder: You must specify the name of your "library" (folder) created within your space project (for example: /projet/externe/institut/login/galaxylibrary/yourlibrary). Your library must contain all your conditions as sub-directories.\n+    | Single file (recommended): You can put a single file as input. That way, you will be able to launch several xcmsSet in parallel and use "xcms.xcmsSet Merger" before "xcms.group"\n+    | Zip file: You can put a zip file containing your inputs: myinputs.zip (containing all your conditions as sub-directories).\n \n-Steps for creating the zip file\n--------------------------------\n+Zip file: Steps for creating the zip file\n+-----------------------------------------\n \n **Step1: Creating your directory and hierarchize the subdirectories**\n \n@@ -478,6 +557,12 @@\n Changelog/News\n --------------\n \n+**Version 2.1.0 - 22/02/2017**\n+\n+- NEW: The W4M tools will be able now to take as input a single file. It will allow to submit in parallel several files and merge them afterward using "xcms.xcmsSet Merger" before "xcms.group".\n+\n+- BUGFIX: the default value of "matchedFilter" -> "Step size to use for profile generation" which was of 0.01 have been changed to fix with the XMCS default values to 0.1\n+\n **Version 2.0.11 - 22/12/2016**\n \n - BUGFIX: propose scanrange for all methods\n'
b
diff -r 91311aa08cdc -r 15646e937936 destinations_input_type.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/destinations_input_type.py Fri Apr 07 07:35:01 2017 -0400
[
@@ -0,0 +1,23 @@
+from galaxy.jobs import JobDestination
+import logging
+import os
+
+'''
+This file must be placed in lib/galaxy/jobs/rules/
+'''
+
+def input_type(job):
+    '''
+    This function checks the input file format/extension and decide which destination in the job_conf.xml using
+     - If it's a zip file, we will launch the job in multi-thread mode (-pe thread 8)
+     - If it's an individual file (mzxml, mzml, mzdata or netcdf), the job will use for instance (-pe thread 1)
+    '''
+    log = logging.getLogger(__name__)
+    inp_data = dict( [ ( da.name, da.dataset ) for da in job.input_datasets ] )
+    inp_data.update( [ ( da.name, da.dataset ) for da in job.input_library_datasets ] )
+    input_extension = inp_data[ "input" ].extension
+    log.debug("The input extension is %s" % input_extension)
+    if input_extension in ["mzxml","mzml","mzdata","netcdf"]:
+        return 'thread1-men_free10'
+    else: # zip file
+        return 'thread4-men_free10'
b
diff -r 91311aa08cdc -r 15646e937936 job_conf.xml.sample
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/job_conf.xml.sample Fri Apr 07 07:35:01 2017 -0400
b
@@ -0,0 +1,36 @@
+<?xml version="1.0"?>
+<!-- A sample job config that explicitly configures job running the way it is configured by default (if there is no explicit config). -->
+<job_conf>
+    <plugins>
+        <plugin id="local" type="runner" load="galaxy.jobs.runners.local:LocalJobRunner" workers="4"/>
+        <plugin id="sge" load="galaxy.jobs.runners.drmaa:DRMAAJobRunner" type="runner"/>
+        <plugin id="dynamic" type="runner" >
+            <param id="rules_module">galaxy.jobs.rules</param>
+        </plugin>
+    </plugins>
+    <handlers>
+        <handler id="main"/>
+    </handlers>
+    <destinations default="sge_default">
+        <destination id="local" runner="local"/>
+        <destination id="sge_default" runner="sge">
+             <param id="nativeSpecification">-V -w n -q galaxy.q</param>
+        </destination>
+        
+        <destination id="thread1-men_free10" runner="sge">
+             <param id="nativeSpecification">-V -w n -q galaxy.q -pe thread 1 -R y -l mem_free=10G </param>
+        </destination>
+        <destination id="thread4-men_free10" runner="sge">
+            <param id="nativeSpecification">-V -w n -q galaxy.q -pe thread 4 -R y -l mem_free=10G </param>
+        </destination>
+
+        <destination id="python_destination_input_type" runner="dynamic">
+            <param id="type">python</param>
+            <param id="function">input_type</param>
+        </destination>
+    </destinations>
+    <tools>
+        <tool destination="python_destination_input_type" id="abims_xcms_xcmsSet" />
+        <tool destination="local" id="upload1"/>
+    </tools>
+</job_conf>
b
diff -r 91311aa08cdc -r 15646e937936 lib.r
--- a/lib.r Mon Jan 30 08:52:59 2017 -0500
+++ b/lib.r Fri Apr 07 07:35:01 2017 -0400
[
b'@@ -27,168 +27,165 @@\n \n #@author G. Le Corguille\n #This function format ions identifiers\n-formatIonIdentifiers <- function(dataData, numDigitsRT=0, numDigitsMZ=0) {\n-    return(make.unique(paste0("M",round(dataData[,"mz"],numDigitsMZ),"T",round(dataData[,"rt"],numDigitsRT))))\n+formatIonIdentifiers <- function(variableMetadata, numDigitsRT=0, numDigitsMZ=0) {\n+    splitDeco = strsplit(as.character(variableMetadata$name),"_")\n+    idsDeco = sapply(splitDeco, function(x) { deco=unlist(x)[2]; if (is.na(deco)) return ("") else return(paste0("_",deco)) })\n+    namecustom = make.unique(paste0("M",round(variableMetadata[,"mz"],numDigitsMZ),"T",round(variableMetadata[,"rt"],numDigitsRT),idsDeco))\n+    variableMetadata=cbind(name=variableMetadata$name, namecustom=namecustom, variableMetadata[,!(colnames(variableMetadata) %in% c("name"))])\n+    return(variableMetadata)\n }\n \n #@author G. Le Corguille\n # value: intensity values to be used into, maxo or intb\n getPeaklistW4M <- function(xset, intval="into",convertRTMinute=F,numDigitsMZ=4,numDigitsRT=0,variableMetadataOutput,dataMatrixOutput) {\n-    groups <- xset@groups\n-    values <- groupval(xset, "medret", value=intval)\n-    \n-    # renamming of the column rtmed to rt to fit with camera peaklist function output\n-    colnames(groups)[colnames(groups)=="rtmed"] <- "rt"\n-    colnames(groups)[colnames(groups)=="mzmed"] <- "mz"\n-    \n-    ids <- formatIonIdentifiers(groups, numDigitsRT=numDigitsRT, numDigitsMZ=numDigitsMZ)\n-    groups = RTSecondToMinute(groups, convertRTMinute)\n+    variableMetadata_dataMatrix = peakTable(xset, method="medret", value=intval)\n+    variableMetadata_dataMatrix = cbind(name=groupnames(xset),variableMetadata_dataMatrix)\n+\n+    dataMatrix = variableMetadata_dataMatrix[,(make.names(colnames(variableMetadata_dataMatrix)) %in% c("name", make.names(sampnames(xset))))]\n \n-    rownames(groups) = ids\n-    rownames(values) = ids\n+    variableMetadata = variableMetadata_dataMatrix[,!(make.names(colnames(variableMetadata_dataMatrix)) %in% c(make.names(sampnames(xset))))]\n+    variableMetadata = RTSecondToMinute(variableMetadata, convertRTMinute)\n+    variableMetadata = formatIonIdentifiers(variableMetadata, numDigitsRT=numDigitsRT, numDigitsMZ=numDigitsMZ)\n \n-    #@TODO: add "name" as the first column name\n-    #colnames(groups)[1] = "name"\n-    #colnames(values)[1] = "name"\n-\n-    write.table(groups, file=variableMetadataOutput,sep="\\t",quote=F,row.names = T,col.names = NA)\n-    write.table(values, file=dataMatrixOutput,sep="\\t",quote=F,row.names = T,col.names = NA)\n+    write.table(variableMetadata, file=variableMetadataOutput,sep="\\t",quote=F,row.names=F)\n+    write.table(dataMatrix, file=dataMatrixOutput,sep="\\t",quote=F,row.names=F)\n }\n \n #@author Y. Guitton\n getBPC <- function(file,rtcor=NULL, ...) {\n-  object <- xcmsRaw(file)\n-  sel <- profRange(object, ...)\n-  cbind(if (is.null(rtcor)) object@scantime[sel$scanidx] else rtcor ,xcms:::colMax(object@env$profile[sel$massidx,sel$scanidx,drop=FALSE]))\n-  #plotChrom(xcmsRaw(file), base=T)\n+    object <- xcmsRaw(file)\n+    sel <- profRange(object, ...)\n+    cbind(if (is.null(rtcor)) object@scantime[sel$scanidx] else rtcor ,xcms:::colMax(object@env$profile[sel$massidx,sel$scanidx,drop=FALSE]))\n+    #plotChrom(xcmsRaw(file), base=T)\n }\n \n #@author Y. Guitton\n getBPCs <- function (xcmsSet=NULL, pdfname="BPCs.pdf",rt=c("raw","corrected"), scanrange=NULL) {\n-  cat("Creating BIC pdf...\\n")\n+    cat("Creating BIC pdf...\\n")\n \n-  if (is.null(xcmsSet)) {\n-    cat("Enter an xcmsSet \\n")\n-    stop()\n-  } else {\n-    files <- filepaths(xcmsSet)\n-  }\n+    if (is.null(xcmsSet)) {\n+        cat("Enter an xcmsSet \\n")\n+        stop()\n+    } else {\n+        files <- filepaths(xcmsSet)\n+    }\n \n-  class<-as.vector(levels(xcmsSet@phenoData[,1])) #sometime phenoData have more than 1 column use first as class\n+    phenoDataClass<-as.vector(levels(xcmsSet@phenoData[,1])) #sometime phenoData have more than 1 column use first as class\n \n-  classnam'..b'as.matrix(md5sum(files)))\n+}\n+\n+\n+# This function get the raw file path from the arguments\n+getRawfilePathFromArguments <- function(singlefile, zipfile, listArguments) {    \n+    if (!is.null(listArguments[["zipfile"]]))           zipfile = listArguments[["zipfile"]]\n+    if (!is.null(listArguments[["zipfilePositive"]]))   zipfile = listArguments[["zipfilePositive"]]\n+    if (!is.null(listArguments[["zipfileNegative"]]))   zipfile = listArguments[["zipfileNegative"]]\n+\n+    if (!is.null(listArguments[["singlefile_galaxyPath"]])) {\n+        singlefile_galaxyPaths = listArguments[["singlefile_galaxyPath"]];\n+        singlefile_sampleNames = listArguments[["singlefile_sampleName"]]\n+    }\n+    if (!is.null(listArguments[["singlefile_galaxyPathPositive"]])) {\n+        singlefile_galaxyPaths = listArguments[["singlefile_galaxyPathPositive"]];\n+        singlefile_sampleNames = listArguments[["singlefile_sampleNamePositive"]]\n+    }\n+    if (!is.null(listArguments[["singlefile_galaxyPathNegative"]])) {\n+        singlefile_galaxyPaths = listArguments[["singlefile_galaxyPathNegative"]];\n+        singlefile_sampleNames = listArguments[["singlefile_sampleNameNegative"]]\n+    }\n+    if (exists("singlefile_galaxyPaths")){\n+        singlefile_galaxyPaths = unlist(strsplit(singlefile_galaxyPaths,","))\n+        singlefile_sampleNames = unlist(strsplit(singlefile_sampleNames,","))\n \n-  library(tools)\n+        singlefile=NULL\n+        for (singlefile_galaxyPath_i in seq(1:length(singlefile_galaxyPaths))) {\n+            singlefile_galaxyPath=singlefile_galaxyPaths[singlefile_galaxyPath_i]\n+            singlefile_sampleName=singlefile_sampleNames[singlefile_galaxyPath_i]\n+            singlefile[[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+\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+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+            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+                print(error_message); stop(error_message)\n+            }\n \n-  #cat("\\n\\n")\n+            file.symlink(singlefile_galaxyPath,singlefile_sampleName)\n+        }\n+        directory = "."\n+\n+    }\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+            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 \n-  return(as.matrix(md5sum(files)))\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+\n+        cat("files_root_directory\\t",directory,"\\n")\n+\n+    }\n+    return (directory)\n }\n'
b
diff -r 91311aa08cdc -r 15646e937936 macros.xml
--- a/macros.xml Mon Jan 30 08:52:59 2017 -0500
+++ b/macros.xml Fri Apr 07 07:35:01 2017 -0400
[
@@ -7,6 +7,11 @@
             <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" />
@@ -20,41 +25,101 @@
     <token name="@COMMAND_LOG_EXIT@">
         ;
         return=\$?;
-        mv log.txt $log;
-        cat $log;
+        mv log.txt '$log';
+        cat '$log';
         sh -c "exit \$return"
     </token>
 
     <!-- zipfile load for planemo test -->
 
-    <token name="@COMMAND_ZIPFILE_LOAD@">
-        #if $zipfile_load_conditional.zipfile_load_select == "yes":
-            #if $zipfile_load_conditional.zip_file:
-                zipfile $zipfile_load_conditional.zip_file
+    <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="zipfile_load">
-        <conditional name="zipfile_load_conditional">
-            <param name="zipfile_load_select" type="select" label="Resubmit your zip file" help="Use only if you get a message which say that your original zip file have been deleted on the server." >
-                <option value="no" >no need</option>
-                <option value="yes">yes</option>
-            </param>
-            <when value="no">
+    <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>
+    </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>
+
+    <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>
+
+    <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>
+
+    <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="yes">
-                <param name="zip_file" type="data" format="no_unzip.zip,zip" label="Zip file" />
-            </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 
+**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
 
b
diff -r 91311aa08cdc -r 15646e937936 planemo_test.sh
--- a/planemo_test.sh Mon Jan 30 08:52:59 2017 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
[
@@ -1,31 +0,0 @@
-# Example of planemo command to launch test
-
-
-# -- Use of installed package environments
-# after having installing package on a local galaxy instance
-source /w/galaxy/dev/shed_tools_tool_dependency_dir/R/3.1.2/iuc/package_r_3_1_2/1ca39eb16186/env.sh
-source /w/galaxy/dev/shed_tools_tool_dependency_dir/bioconductor-xcms/1.44.0/lecorguille/package_bioconductor_xcms_1_44_0/0c38f7d43e08/env.sh
-planemo test --install_galaxy
-
-#All 2 test(s) executed passed.
-#abims_xcms_xcmsSet[0]: passed
-#abims_xcms_xcmsSet[1]: passed
-
-
-# -- Use of conda dependencies
-planemo conda_init --conda_prefix /tmp/mc
-planemo conda_install --conda_prefix /tmp/mc . 
-planemo test --install_galaxy --conda_prefix /tmp/mc --conda_dependency_resolution
-
-#All 2 test(s) executed passed.
-#abims_xcms_xcmsSet[0]: passed
-#abims_xcms_xcmsSet[1]: passed
-
-
-# -- Use of shed_test
-planemo shed_test --install_galaxy  -t testtoolshed
-
-#All 2 test(s) executed passed.
-#testtoolshed.g2.bx.psu.edu/repos/lecorguille/xcms_group/abims_xcms_xcmsset/2.0.8[0]: passed
-#testtoolshed.g2.bx.psu.edu/repos/lecorguille/xcms_group/abims_xcms_xcmsset/2.0.8[1]: passed
-
b
diff -r 91311aa08cdc -r 15646e937936 static/images/XCMS_Galaxy_workflow.png
b
Binary file static/images/XCMS_Galaxy_workflow.png has changed
b
diff -r 91311aa08cdc -r 15646e937936 static/images/xcms_xcmsset_workflow.png
b
Binary file static/images/xcms_xcmsset_workflow.png has changed
b
diff -r 91311aa08cdc -r 15646e937936 test-data/HU_neg_017.mzXML
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/HU_neg_017.mzXML Fri Apr 07 07:35:01 2017 -0400
b
b'@@ -0,0 +1,40676 @@\n+<?xml version="1.0" encoding="ISO-8859-1"?>\n+<mzXML xmlns="http://sashimi.sourceforge.net/schema_revision/mzXML_3.2"\n+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\n+       xsi:schemaLocation="http://sashimi.sourceforge.net/schema_revision/mzXML_3.2 http://sashimi.sourceforge.net/schema_revision/mzXML_3.2/mzXML_idx_3.2.xsd">\n+  <msRun scanCount="2032" startTime="PT0.7297S" endTime="PT1139.62S">\n+    <parentFile fileName="file://Y:/439020_Metabolomic database/Etienne/sacuri-rawToCentroid/HU_neg_017.RAW"\n+                fileType="RAWData"\n+                fileSha1="b632da6cfb9a0c328b718b0018f2765f91f78058"/>\n+    <msInstrument id="IC1">\n+      <msManufacturer category="msManufacturer" value="Thermo Scientific"/>\n+      <msModel category="msModel" value="LTQ Orbitrap Discovery"/>\n+      <msIonisation category="msIonisation" value="electrospray ionization"/>\n+      <msMassAnalyzer category="msMassAnalyzer" value="orbitrap"/>\n+      <msDetector category="msDetector" value="inductive detector"/>\n+      <software type="acquisition" name="Xcalibur" version="2.4 SP1"/>\n+    </msInstrument>\n+    <msInstrument id="IC2">\n+      <msManufacturer category="msManufacturer" value="Thermo Scientific"/>\n+      <msModel category="msModel" value="LTQ Orbitrap Discovery"/>\n+      <msIonisation category="msIonisation" value="electrospray ionization"/>\n+      <msMassAnalyzer category="msMassAnalyzer" value="radial ejection linear ion trap"/>\n+      <msDetector category="msDetector" value="electron multiplier"/>\n+      <software type="acquisition" name="Xcalibur" version="2.4 SP1"/>\n+    </msInstrument>\n+    <dataProcessing centroided="1">\n+      <software type="conversion" name="ProteoWizard" version="2.2.3214"/>\n+      <processingOperation name="Conversion to mzML"/>\n+      <software type="processing" name="ProteoWizard" version="2.2.3214"/>\n+      <comment>Thermo/Xcalibur peak picking</comment>\n+    </dataProcessing>\n+    <scan num="1"\n+          scanEvent="1"\n+          scanType="FULL"\n+          centroided="1"\n+          msLevel="1"\n+          peaksCount="261"\n+          polarity="-"\n+          retentionTime="PT0.7297S"\n+          lowMz="50.37678527832"\n+          highMz="988.846313476563"\n+          basePeakMz="91.003402709961"\n+          basePeakIntensity="7.4043e06"\n+          totIonCurrent="1.4156879e07"\n+          msInstrumentID="IC1">\n+      <peaks compressedLen="0"\n+             precision="32"\n+             byteOrder="network"\n+             pairOrder="m/z-int">QkmB1EYkeTFCSi0tRj1WgUJPB5FGG+JOQlEhykZXbuVCUSr3RjEpEUJZZ7FGLDTdQlmQVkY+AhFCWt1RRmYqlEJh+xBGJPtqQmIVLkY/+Z9CaLTqRkYK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DD+5VRnrVNUMRUxVGZqrPQxLJLEZxZQBDFQozRlcuVkMV5VRGQrr6QxkcGEZEGLhDGn7wRoBNEUMgnbtGQB6zQyDXZEaCooZDI7eJRjYK80MplqhIQtLGQyowzUZThOZDKoqERj8IZUMrbnNGXcOaQy5REEZ3RihDLlQ3RlMHY0MyDOBG4OCxQzL6JUfSjj5DMvuYRqqqXEM1pOJGSUHyQzWmY0aSbFZDONC1Rjkt30M40j9GT+d9Qzs0qUZkNmdDPRHuRkxuQEM9E79GPaWzQz0UrkaKXmVDPRXDRoG6GUM+7XpHClq'..b'>\n+    <offset id="1936">8321679</offset>\n+    <offset id="1937">8325507</offset>\n+    <offset id="1938">8329629</offset>\n+    <offset id="1939">8333778</offset>\n+    <offset id="1940">8337794</offset>\n+    <offset id="1941">8342314</offset>\n+    <offset id="1942">8346334</offset>\n+    <offset id="1943">8350164</offset>\n+    <offset id="1944">8354024</offset>\n+    <offset id="1945">8357413</offset>\n+    <offset id="1946">8361484</offset>\n+    <offset id="1947">8365619</offset>\n+    <offset id="1948">8369373</offset>\n+    <offset id="1949">8373240</offset>\n+    <offset id="1950">8376845</offset>\n+    <offset id="1951">8380832</offset>\n+    <offset id="1952">8384597</offset>\n+    <offset id="1953">8388202</offset>\n+    <offset id="1954">8392210</offset>\n+    <offset id="1955">8396218</offset>\n+    <offset id="1956">8400142</offset>\n+    <offset id="1957">8404161</offset>\n+    <offset id="1958">8408181</offset>\n+    <offset id="1959">8412275</offset>\n+    <offset id="1960">8416228</offset>\n+    <offset id="1961">8419928</offset>\n+    <offset id="1962">8423733</offset>\n+    <offset id="1963">8427883</offset>\n+    <offset id="1964">8431890</offset>\n+    <offset id="1965">8435778</offset>\n+    <offset id="1966">8439679</offset>\n+    <offset id="1967">8443540</offset>\n+    <offset id="1968">8447368</offset>\n+    <offset id="1969">8451472</offset>\n+    <offset id="1970">8455366</offset>\n+    <offset id="1971">8459482</offset>\n+    <offset id="1972">8463445</offset>\n+    <offset id="1973">8466899</offset>\n+    <offset id="1974">8470375</offset>\n+    <offset id="1975">8474329</offset>\n+    <offset id="1976">8478292</offset>\n+    <offset id="1977">8482311</offset>\n+    <offset id="1978">8486190</offset>\n+    <offset id="1979">8490282</offset>\n+    <offset id="1980">8494279</offset>\n+    <offset id="1981">8498429</offset>\n+    <offset id="1982">8502130</offset>\n+    <offset id="1983">8506138</offset>\n+    <offset id="1984">8510402</offset>\n+    <offset id="1985">8514103</offset>\n+    <offset id="1986">8518079</offset>\n+    <offset id="1987">8521959</offset>\n+    <offset id="1988">8526065</offset>\n+    <offset id="1989">8529767</offset>\n+    <offset id="1990">8533572</offset>\n+    <offset id="1991">8537549</offset>\n+    <offset id="1992">8541099</offset>\n+    <offset id="1993">8545161</offset>\n+    <offset id="1994">8549437</offset>\n+    <offset id="1995">8553554</offset>\n+    <offset id="1996">8557680</offset>\n+    <offset id="1997">8561812</offset>\n+    <offset id="1998">8565704</offset>\n+    <offset id="1999">8569458</offset>\n+    <offset id="2000">8573468</offset>\n+    <offset id="2001">8576943</offset>\n+    <offset id="2002">8580716</offset>\n+    <offset id="2003">8584521</offset>\n+    <offset id="2004">8588670</offset>\n+    <offset id="2005">8592678</offset>\n+    <offset id="2006">8596431</offset>\n+    <offset id="2007">8600504</offset>\n+    <offset id="2008">8604460</offset>\n+    <offset id="2009">8608234</offset>\n+    <offset id="2010">8611935</offset>\n+    <offset id="2011">8615872</offset>\n+    <offset id="2012">8619944</offset>\n+    <offset id="2013">8623580</offset>\n+    <offset id="2014">8627546</offset>\n+    <offset id="2015">8631632</offset>\n+    <offset id="2016">8635685</offset>\n+    <offset id="2017">8639609</offset>\n+    <offset id="2018">8643566</offset>\n+    <offset id="2019">8647116</offset>\n+    <offset id="2020">8651092</offset>\n+    <offset id="2021">8655537</offset>\n+    <offset id="2022">8659215</offset>\n+    <offset id="2023">8663287</offset>\n+    <offset id="2024">8667509</offset>\n+    <offset id="2025">8671434</offset>\n+    <offset id="2026">8675303</offset>\n+    <offset id="2027">8679292</offset>\n+    <offset id="2028">8683321</offset>\n+    <offset id="2029">8686894</offset>\n+    <offset id="2030">8690755</offset>\n+    <offset id="2031">8694679</offset>\n+    <offset id="2032">8698507</offset>\n+  </index>\n+  <indexOffset>8702736</indexOffset>\n+  <sha1>f1abac9e079de2df593083d41093052be5696a06</sha1>\n+</mzXML>\n'
b
diff -r 91311aa08cdc -r 15646e937936 test-data/MM14.mzML
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/MM14.mzML Fri Apr 07 07:35:01 2017 -0400
b
b'@@ -0,0 +1,3667 @@\n+<?xml version="1.0" encoding="ISO-8859-1"?>\n+<mzML xmlns="http://psi.hupo.org/ms/mzml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://psi.hupo.org/ms/mzml http://psidev.info/files/ms/mzML/xsd/mzML1.1.0.xsd" accession="" version="1.1">\n+\t<cvList count="2">\n+\t\t<cv id="MS" fullName="Proteomics Standards Initiative Mass Spectrometry Ontology" URI="http://psidev.cvs.sourceforge.net/*checkout*/psidev/psi/psi-ms/mzML/controlledVocabulary/psi-ms.obo"/>\n+\t\t<cv id="UO" fullName="Unit Ontology" URI="http://obo.cvs.sourceforge.net/obo/obo/ontology/phenotype/unit.obo"/>\n+\t</cvList>\n+\t<fileDescription>\n+\t\t<fileContent>\n+\t\t\t<cvParam cvRef="MS" accession="MS:1000294" name="mass spectrum" />\n+\t\t</fileContent>\n+\t\t<sourceFileList count="1">\n+\t\t\t<sourceFile id="sf_ru_0" name="analysis.baf" location="MM14_20uM_2-A%2c4_01_1745.d/">\n+\t\t\t\t<cvParam cvRef="MS" accession="MS:1000569" name="SHA-1" value="" />\n+\t\t\t\t<cvParam cvRef="MS" accession="MS:1000564" name="PSI mzData file" />\n+\t\t\t<cvParam cvRef="MS" accession="MS:1000824" name="no nativeID format" />\n+\t\t\t</sourceFile>\n+\t\t</sourceFileList>\n+\t\t<contact>\n+\t\t\t<cvParam cvRef="MS" accession="MS:1000586" name="contact name" value="Customer, Bruker" />\n+\t\t\t<cvParam cvRef="MS" accession="MS:1000590" name="contact organization" value="" />\n+\t\t</contact>\n+\t</fileDescription>\n+\t<sampleList count="1">\n+\t\t<sample id="sa_0" name="MM14_20uM">\n+\t\t\t<cvParam cvRef="MS" accession="MS:1000004" name="sample mass" value="0"  unitAccession="UO:0000021" unitName="gram" unitCvRef="UO" />\n+\t\t\t<cvParam cvRef="MS" accession="MS:1000005" name="sample volume" value="0" unitAccession="UO:0000098" unitName="milliliter" unitCvRef="UO" />\n+\t\t\t<cvParam cvRef="MS" accession="MS:1000006" name="sample concentration" value="0" unitAccession="UO:0000175" unitName="gram per liter" unitCvRef="UO" />\n+\t\t</sample>\n+\t</sampleList>\n+\t<softwareList count="3">\n+\t\t<software id="so_in_0" version="" >\n+\t\t\t<cvParam cvRef="MS" accession="MS:1000799" name="custom unreleased software tool" value="" />\n+\t\t</software>\n+\t\t<software id="so_dp_0" version="1.3.3" >\n+\t\t\t<cvParam cvRef="MS" accession="MS:1000717" name="CompassXport" />\n+\t\t</software>\n+\t\t<software id="so_dp_1" version="1.4" >\n+\t\t\t<cvParam cvRef="MS" accession="MS:1000756" name="FileConverter" />\n+\t\t</software>\n+\t</softwareList>\n+\t<instrumentConfigurationList count="1">\n+\t\t<instrumentConfiguration id="ic_0">\n+\t\t\t<cvParam cvRef="MS" accession="MS:1000031" name="instrument model" />\n+\t\t\t<componentList count="3">\n+\t\t\t\t<source order="0">\n+\t\t\t\t\t<cvParam cvRef="MS" accession="MS:1000073" name="electrospray ionization" />\n+\t\t\t\t</source>\n+\t\t\t\t<analyzer order="0">\n+\t\t\t\t\t<cvParam cvRef="MS" accession="MS:1000014" name="accuracy" value="0" unitAccession="UO:0000169" unitName="parts per million" unitCvRef="UO" />\n+\t\t\t\t\t<cvParam cvRef="MS" accession="MS:1000022" name="TOF Total Path Length" value="0" unitAccession="UO:0000008" unitName="meter" unitCvRef="UO" />\n+\t\t\t\t\t<cvParam cvRef="MS" accession="MS:1000024" name="final MS exponent" value="0" />\n+\t\t\t\t\t<cvParam cvRef="MS" accession="MS:1000025" name="magnetic field strength" value="0" unitAccession="UO:0000228" unitName="tesla" unitCvRef="UO" />\n+\t\t\t\t\t<cvParam cvRef="MS" accession="MS:1000443" name="mass analyzer type" />\n+\t\t\t\t</analyzer>\n+\t\t\t\t<detector order="0">\n+\t\t\t\t\t<cvParam cvRef="MS" accession="MS:1000028" name="detector resolution" value="0" />\n+\t\t\t\t\t<cvParam cvRef="MS" accession="MS:1000029" name="sampling frequency" value="0" unitAccession="UO:0000106" unitName="hertz" unitCvRef="UO" />\n+\t\t\t\t\t<cvParam cvRef="MS" accession="MS:1000026" name="detector type" />\n+\t\t\t\t</detector>\n+\t\t\t</componentList>\n+\t\t\t<softwareRef ref="so_in_0" />\n+\t\t</instrumentConfiguration>\n+\t</instrumentConfigurationList>\n+\t<dataProcessingList count="1">\n+\t\t<dataProcessing id="dp_ru_0">\n+\t\t\t<processingMethod order="0" softwareRef="so_dp_0">\n+\t\t\t\t<cvParam cvRef="MS" accession="MS:1000034" name="charge deconvolution" />\n+\t\t\t\t<cvP'..b'IBUQAAAAAAAAENAAAAAAAAAOUAAAAAAAAA6QAAAAAAAwFNAAAAAAACAQUAAAAAAAAA8QAAAAAAAADVAAAAAAAAAPkAAAAAAAABEQAAAAAAAAD9AAAAAAAAANkAAAAAAAAA8QAAAAAAAgEdAAAAAAAAAO0AAAAAAAABJQAAAAAAAADhAAAAAAAAAN0AAAAAAAAA5QAAAAAAAADVAAAAAAACAREAAAAAAAABFQAAAAAAAgEhAAAAAAAAAOkAAAAAAAAA1QAAAAAAAAEJAAAAAAAAANkAAAAAAAAA9QAAAAAAAADdAAAAAAAAAU0AAAAAAAAA8QAAAAAAAADtAAAAAAAAAP0AAAAAAAABFQAAAAAAAADVAAAAAAAAAP0AAAAAAAABDQAAAAAAAADtAAAAAAAAAOEAAAAAAAIBAQAAAAAAAADhAAAAAAAAAPUAAAAAAAAA3QAAAAA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ADxAAAAAAACAQEAAAAAAAAA3QAAAAAAAADVAAAAAAAAAQUAAAAAAAAA9QAAAAAAAAEFAAAAAAACAQ0AAAAAAAIBAQAAAAAAAgEFAAAAAAAAAREAAAAAAAAA3QAAAAAAAADxAAAAAAAAAN0AAAAAAAAA4QAAAAAAAADxAAAAAAAAAPUAAAAAAAAA8QAAAAAAAADlAAAAAAAAAOUAAAAAAAAA3QAAAAAAAgEBA</binary>\n+\t\t\t\t\t</binaryDataArray>\n+\t\t\t\t</binaryDataArrayList>\n+\t\t\t</spectrum>\n+\t\t</spectrumList>\n+\t</run>\n+</mzML>\n\\ No newline at end of file\n'
b
diff -r 91311aa08cdc -r 15646e937936 test-data/MM8.mzML
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/MM8.mzML Fri Apr 07 07:35:01 2017 -0400
b
b'@@ -0,0 +1,6207 @@\n+<?xml version="1.0" encoding="ISO-8859-1"?>\r\n+<mzML xmlns="http://psi.hupo.org/ms/mzml" xsi:schemaLocation="http://psi.hupo.org/ms/mzml http://psidev.info/files/ms/mzML/xsd/mzML1.1.0.xsd" version="1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r\n+<cvList count="2">\r\n+<cv id="MS" fullName="Proteomics Standards Initiative Mass Spectrometry Vocabularies" version="2.26.0" URI="http://psidev.cvs.sourceforge.net/*checkout*/psidev/psi/psi-ms/mzML/controlledVocabulary/psi-ms.obo"/>\r\n+<cv id="UO" fullName="unit" version="1.20" URI="http://obo.cvs.sourceforge.net/*checkout*/obo/obo/ontology/phenotype/unit.obo?revision=1.20"/>\r\n+</cvList>\r\n+<fileDescription>\r\n+<fileContent>\r\n+<cvParam cvRef="MS" accession="MS:1000579" name="MS1 spectrum"/>\r\n+<cvParam cvRef="MS" accession="MS:1000127" name="centroid spectrum"/>\r\n+</fileContent>\r\n+<sourceFileList count="1">\r\n+<sourceFile id="sourceFile" location="Z:/tmp/bruker/MM8_2-F%2c1_01_5950.d" name="analysis.baf">\r\n+<cvParam cvRef="MS" accession="MS:1000772" name="Bruker BAF nativeID format"/>\r\n+<cvParam cvRef="MS" accession="MS:1000815" name="Bruker BAF file"/>\r\n+<cvParam cvRef="MS" accession="MS:1000569" name="SHA-1" value="7ade07ca5f336a6e8378bd0ba9992528b1c766b5"/>\r\n+</sourceFile>\r\n+</sourceFileList>\r\n+<contact>\r\n+<cvParam cvRef="MS" accession="MS:1000586" name="contact name" value="Bruker Customer"/>\r\n+<cvParam cvRef="MS" accession="MS:1000590" name="contact organization" value=""/>\r\n+</contact>\r\n+</fileDescription>\r\n+<sampleList count="1">\r\n+<sample id="sample" name="MM8">\r\n+</sample>\r\n+</sampleList>\r\n+<softwareList count="2">\r\n+<software id="exportSoftware" version="3.0.0">\r\n+<cvParam cvRef="MS" accession="MS:1000717" name="CompassXport"/>\r\n+</software>\r\n+<software id="instrumentSoftware" version="2.3.40.0">\r\n+<cvParam cvRef="MS" accession="MS:1000692" name="Bruker software"/>\r\n+<userParam name="AcquisitionProgram" value="micrOTOFcontrol"/>\r\n+</software>\r\n+</softwareList>\r\n+<instrumentConfigurationList count="1">\r\n+<instrumentConfiguration id="instrument">\r\n+<cvParam cvRef="MS" accession="MS:1000703" name="micrOTOF-Q"/>\r\n+<componentList count="3">\r\n+<source order="1">\r\n+<cvParam cvRef="MS" accession="MS:1000073" name="electrospray ionization"/>\r\n+</source>\r\n+<analyzer order="2">\r\n+<cvParam cvRef="MS" accession="MS:1000081" name="quadrupole"/>\r\n+</analyzer>\r\n+<detector order="3">\r\n+<cvParam cvRef="MS" accession="MS:1000253" name="electron multiplier"/>\r\n+</detector>\r\n+</componentList>\r\n+<softwareRef ref="instrumentSoftware"/>\r\n+</instrumentConfiguration>\r\n+</instrumentConfigurationList>\r\n+<dataProcessingList count="1">\r\n+<dataProcessing id="exportation">\r\n+<processingMethod order="1" softwareRef="instrumentSoftware">\r\n+<cvParam cvRef="MS" accession="MS:1000035" name="peak picking"/>\r\n+</processingMethod>\r\n+<processingMethod order="2" softwareRef="exportSoftware">\r\n+<cvParam cvRef="MS" accession="MS:1000544" name="Conversion to mzML"/>\r\n+<cvParam cvRef="MS" accession="MS:1000747" name="completion time" value="2010-12-14T14:45:43"/>\r\n+</processingMethod>\r\n+</dataProcessing>\r\n+</dataProcessingList>\r\n+<run id="run" defaultInstrumentConfigurationRef="instrument" startTimeStamp="2008-09-01T09:48:37.296+01:00">\r\n+<spectrumList count="198" defaultDataProcessingRef="exportation">\r\n+<spectrum index="0" id="scan=1" defaultArrayLength="1743">\r\n+<cvParam cvRef="MS" accession="MS:1000130" name="positive scan"/>\r\n+<cvParam cvRef="MS" accession="MS:1000579" name="MS1 spectrum"/>\r\n+<cvParam cvRef="MS" accession="MS:1000127" name="centroid spectrum"/>\r\n+<cvParam cvRef="MS" accession="MS:1000285" name="total ion current" value="97322.00000000"/>\r\n+<cvParam cvRef="MS" accession="MS:1000504" name="base peak m/z" value="144.04999210" unitCvRef="MS" unitAccession="MS:1000040" unitName="m/z"/>\r\n+<cvParam cvRef="MS" accession="MS:1000505" name="base peak intensity" value="7250.00000000" unitCvRef="MS" unitAccession="MS:1000131" unitName="number of counts"/>\r\n+<cvParam cvRef="MS" acces'..b'27lBEZSzm8cBlFrq/i5UWr+WzNWqZHrWVD6lpuK1nHhpNBtN0WTNcbwdw2eCv/B3BSEJQ=</binary>\r\n+</binaryDataArray>\r\n+<binaryDataArray encodedLength="3452">\r\n+<cvParam cvRef="MS" accession="MS:1000574" name="zlib compression"/>\r\n+<cvParam cvRef="MS" accession="MS:1000515" name="intensity array" value="" unitCvRef="MS" unitAccession="MS:1000131" unitName="number of counts"/>\r\n+<cvParam cvRef="MS" accession="MS:1000521" name="32-bit float"/>\r\n+<binary>eNpdmU1oY9cVxx9FC7UVQQsVRDHUJVq4RRS1FUUEF6z7FGqKF4ZqoYUXXnThwCwMNcWLoQgzGGOGwZghmKGYwYRBTIfwMEMrwhAeZQiP0AYRuhChC9FFEaGER1eilNJ3/X5/7sksLu9D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2bviXbhNjpxNzVm7oiL70NTb+khke7ExuanredfOfzNzoXDRnJuZPzDmZ4TEzuCb9r+t4Zs6bviHHtP9/ja3WDg==</binary>\r\n+</binaryDataArray>\r\n+</binaryDataArrayList>\r\n+</spectrum>\r\n+</spectrumList>\r\n+</run>\r\n+</mzML>\r\n'
b
diff -r 91311aa08cdc -r 15646e937936 tool_dependencies.xml
--- a/tool_dependencies.xml Mon Jan 30 08:52:59 2017 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
b
@@ -1,9 +0,0 @@
-<?xml version="1.0"?>
-<tool_dependency>
-    <package name="R" version="3.1.2">
-        <repository changeset_revision="4d2fd1413b56" name="package_r_3_1_2" owner="iuc" toolshed="https://toolshed.g2.bx.psu.edu" />
-    </package>
-    <package name="bioconductor-xcms" version="1.46.0">
-        <repository changeset_revision="779207ed5674" name="package_bioconductor_xcms_1_46_0" owner="lecorguille" toolshed="https://toolshed.g2.bx.psu.edu" />
-    </package>
-</tool_dependency>
b
diff -r 91311aa08cdc -r 15646e937936 xcms.r
--- a/xcms.r Mon Jan 30 08:52:59 2017 -0500
+++ b/xcms.r Fri Apr 07 07:35:01 2017 -0400
[
b'@@ -15,8 +15,8 @@\n #pkgs=c("xcms","batch")\n pkgs=c("parallel","BiocGenerics", "Biobase", "Rcpp", "mzR", "xcms","snow","batch")\n for(pkg in pkgs) {\n-  suppressPackageStartupMessages( stopifnot( library(pkg, quietly=TRUE, logical.return=TRUE, character.only=TRUE)))\n-  cat(pkg,"\\t",as.character(packageVersion(pkg)),"\\n",sep="")\n+    suppressPackageStartupMessages( stopifnot( library(pkg, quietly=TRUE, logical.return=TRUE, character.only=TRUE)))\n+    cat(pkg,"\\t",as.character(packageVersion(pkg)),"\\n",sep="")\n }\n source_local <- function(fname){ argv <- commandArgs(trailingOnly = FALSE); base_dir <- dirname(substring(argv[grep("--file=", argv)], 8)); source(paste(base_dir, fname, sep="/")) }\n cat("\\n\\n");\n@@ -38,7 +38,7 @@\n \n #image is an .RData file necessary to use xset variable given by previous tools\n if (!is.null(listArguments[["image"]])){\n-  load(listArguments[["image"]]); listArguments[["image"]]=NULL\n+    load(listArguments[["image"]]); listArguments[["image"]]=NULL\n }\n \n #Import the different functions\n@@ -61,110 +61,67 @@\n \n xsetRdataOutput = paste(thefunction,"RData",sep=".")\n if (!is.null(listArguments[["xsetRdataOutput"]])){\n-  xsetRdataOutput = listArguments[["xsetRdataOutput"]]; listArguments[["xsetRdataOutput"]]=NULL\n+    xsetRdataOutput = listArguments[["xsetRdataOutput"]]; listArguments[["xsetRdataOutput"]]=NULL\n }\n \n #saving the specific parameters\n rplotspdf = "Rplots.pdf"\n if (!is.null(listArguments[["rplotspdf"]])){\n-  rplotspdf = listArguments[["rplotspdf"]]; listArguments[["rplotspdf"]]=NULL\n+    rplotspdf = listArguments[["rplotspdf"]]; listArguments[["rplotspdf"]]=NULL\n }\n sampleMetadataOutput = "sampleMetadata.tsv"\n if (!is.null(listArguments[["sampleMetadataOutput"]])){\n-  sampleMetadataOutput = listArguments[["sampleMetadataOutput"]]; listArguments[["sampleMetadataOutput"]]=NULL\n+    sampleMetadataOutput = listArguments[["sampleMetadataOutput"]]; listArguments[["sampleMetadataOutput"]]=NULL\n }\n variableMetadataOutput = "variableMetadata.tsv"\n if (!is.null(listArguments[["variableMetadataOutput"]])){\n-  variableMetadataOutput = listArguments[["variableMetadataOutput"]]; listArguments[["variableMetadataOutput"]]=NULL\n+    variableMetadataOutput = listArguments[["variableMetadataOutput"]]; listArguments[["variableMetadataOutput"]]=NULL\n }\n dataMatrixOutput = "dataMatrix.tsv"\n if (!is.null(listArguments[["dataMatrixOutput"]])){\n-  dataMatrixOutput = listArguments[["dataMatrixOutput"]]; listArguments[["dataMatrixOutput"]]=NULL\n+    dataMatrixOutput = listArguments[["dataMatrixOutput"]]; listArguments[["dataMatrixOutput"]]=NULL\n }\n if (!is.null(listArguments[["convertRTMinute"]])){\n-  convertRTMinute = listArguments[["convertRTMinute"]]; listArguments[["convertRTMinute"]]=NULL\n+    convertRTMinute = listArguments[["convertRTMinute"]]; listArguments[["convertRTMinute"]]=NULL\n }\n if (!is.null(listArguments[["numDigitsMZ"]])){\n-  numDigitsMZ = listArguments[["numDigitsMZ"]]; listArguments[["numDigitsMZ"]]=NULL\n+    numDigitsMZ = listArguments[["numDigitsMZ"]]; listArguments[["numDigitsMZ"]]=NULL\n }\n if (!is.null(listArguments[["numDigitsRT"]])){\n   numDigitsRT = listArguments[["numDigitsRT"]]; listArguments[["numDigitsRT"]]=NULL\n }\n if (!is.null(listArguments[["intval"]])){\n-  intval = listArguments[["intval"]]; listArguments[["intval"]]=NULL\n+    intval = listArguments[["intval"]]; listArguments[["intval"]]=NULL\n }\n \n if (thefunction %in% c("xcmsSet","retcor")) {\n-  ticspdf = listArguments[["ticspdf"]]; listArguments[["ticspdf"]]=NULL\n-  bicspdf = listArguments[["bicspdf"]]; listArguments[["bicspdf"]]=NULL\n-}\n-\n-#necessary to unzip .zip file uploaded to Galaxy\n-#thanks to .zip file it\'s possible to upload many file as the same time conserving the tree hierarchy of directories\n-\n-\n-if (!is.null(listArguments[["zipfile"]])){\n-  zipfile= listArguments[["zipfile"]]; listArguments[["zipfile"]]=NULL\n-}\n-\n-if (!is.null(listArguments[["library"]])){\n-  directory=listArguments[["library"]]; listArguments[["library"]]'..b'set), listArguments)\n }\n \n cat("\\n\\n")\n@@ -172,8 +129,6 @@\n \n \n \n-\n-\n # ----- MAIN PROCESSING INFO -----\n cat("\\tMAIN PROCESSING INFO\\n")\n \n@@ -181,12 +136,12 @@\n #Verification of a group step before doing the fillpeaks job.\n \n if (thefunction == "fillPeaks") {\n-  res=try(is.null(groupnames(xset)))\n-  if (class(res) == "try-error"){\n-    error<-geterrmessage()\n-    write(error, stderr())\n-    stop("You must always do a group step after a retcor. Otherwise it won\'t work for the fillpeaks step")\n-  }\n+    res=try(is.null(groupnames(xset)))\n+    if (class(res) == "try-error"){\n+        error<-geterrmessage()\n+        write(error, stderr())\n+        stop("You must always do a group step after a retcor. Otherwise it won\'t work for the fillpeaks step")\n+    }\n \n }\n \n@@ -194,7 +149,7 @@\n #dev.new(file="Rplots.pdf", width=16, height=12)\n pdf(file=rplotspdf, width=16, height=12)\n if (thefunction == "group") {\n-  par(mfrow=c(2,2))\n+    par(mfrow=c(2,2))\n }\n #else if (thefunction == "retcor") {\n #try to change the legend display\n@@ -208,6 +163,11 @@\n cat("\\t\\tCOMPUTE\\n")\n xset = do.call(thefunction, listArguments)\n \n+# check if there are no peaks\n+if (nrow(peaks(xset)) == 0) {\n+    stop("No peaks were detected. You should review your settings")\n+}\n+\n \n cat("\\n\\n")\n \n@@ -215,40 +175,38 @@\n \n if (thefunction  == "xcmsSet") {\n \n-  #transform the files absolute pathways into relative pathways\n-  xset@filepaths<-sub(paste(getwd(),"/",sep="") ,"", xset@filepaths)\n+    #transform the files absolute pathways into relative pathways\n+    xset@filepaths<-sub(paste(getwd(),"/",sep="") ,"", xset@filepaths)\n+    if(exists("zipfile") && !is.null(zipfile) && (zipfile!="")) {\n \n-  if(exists("zipfile") && (zipfile!="")) {\n+        #Modify the samples names (erase the path)\n+        for(i in 1:length(sampnames(xset))){\n \n-    #Modify the samples names (erase the path)\n-    for(i in 1:length(sampnames(xset))){\n+            sample_name=unlist(strsplit(sampnames(xset)[i], "/"))\n+            sample_name=sample_name[length(sample_name)]\n+            sample_name= unlist(strsplit(sample_name,"[.]"))[1]\n+            sampnames(xset)[i]=sample_name\n \n-      sample_name=unlist(strsplit(sampnames(xset)[i], "/"))\n-      sample_name=sample_name[length(sample_name)]\n-      sample_name= unlist(strsplit(sample_name,"[.]"))[1]\n-      sampnames(xset)[i]=sample_name\n+        }\n \n     }\n \n-  }\n-\n }\n \n # -- TIC --\n if (thefunction == "xcmsSet") {\n-  cat("\\t\\tGET TIC GRAPH\\n")\n-  sampleNamesList = getSampleMetadata(xcmsSet=xset, sampleMetadataOutput=sampleMetadataOutput)\n-  getTICs(xcmsSet=xset, pdfname=ticspdf,rt="raw")\n-  getBPCs(xcmsSet=xset,rt="raw",pdfname=bicspdf)\n+    cat("\\t\\tGET TIC GRAPH\\n")\n+    sampleNamesList = getSampleMetadata(xcmsSet=xset, sampleMetadataOutput=sampleMetadataOutput)\n+    getTICs(xcmsSet=xset, pdfname=ticspdf,rt="raw")\n+    getBPCs(xcmsSet=xset,rt="raw",pdfname=bicspdf)\n } else if (thefunction == "retcor") {\n-  cat("\\t\\tGET TIC GRAPH\\n")\n-  getTICs(xcmsSet=xset, pdfname=ticspdf,rt="corrected")\n-  getBPCs(xcmsSet=xset,rt="corrected",pdfname=bicspdf)\n+    cat("\\t\\tGET TIC GRAPH\\n")\n+    getTICs(xcmsSet=xset, pdfname=ticspdf,rt="corrected")\n+    getBPCs(xcmsSet=xset,rt="corrected",pdfname=bicspdf)\n }\n \n-if (thefunction == "fillPeaks") {\n-  cat("\\t\\tGET THE PEAK LIST\\n")\n-  getPeaklistW4M(xset,intval,convertRTMinute,numDigitsMZ,numDigitsRT,variableMetadataOutput,dataMatrixOutput)\n+if ((thefunction == "group" || thefunction == "fillPeaks") && exists("intval")) {\n+    getPeaklistW4M(xset,intval,convertRTMinute,numDigitsMZ,numDigitsRT,variableMetadataOutput,dataMatrixOutput)\n }\n \n \n@@ -262,7 +220,7 @@\n \n \n #saving R data in .Rdata file to save the variables used in the present tool\n-objects2save = c("xset","zipfile","listOFlistArguments","md5sumList","sampleNamesList")\n+objects2save = c("xset","zipfile","singlefile","listOFlistArguments","md5sumList","sampleNamesList")\n save(list=objects2save[objects2save %in% ls()], file=xsetRdataOutput)\n \n cat("\\n\\n")\n'