changeset 15:1a9bbd4670e8 draft

planemo upload for repository https://github.com/workflow4metabolomics/xcms commit 92dd69e5b063aad05a9b2b75e21c78bfa46c4b94
author lecorguille
date Thu, 22 Dec 2016 05:59:20 -0500
parents 7c19176e1929
children f28041d2180a
files README.rst abims_xcms_xcmsSet.xml lib.r macros.xml
diffstat 4 files changed, 73 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/README.rst	Mon Nov 14 16:18:57 2016 -0500
+++ b/README.rst	Thu Dec 22 05:59:20 2016 -0500
@@ -2,6 +2,10 @@
 Changelog/News
 --------------
 
+**Version 2.0.10 - 22/12/2016**
+
+- BUGFIX: when having only one group (i.e. one folder of raw data) the BPC and TIC pdf files do not contain any graph
+
 **Version 2.0.9 - 06/07/2016**
 
 - UPGRADE: upgrate the xcms version from 1.44.0 to 1.46.0
@@ -50,4 +54,4 @@
 
 Planemo test using source env.sh: passed
 
-Planemo shed_test : passed
\ No newline at end of file
+Planemo shed_test : passed
--- a/abims_xcms_xcmsSet.xml	Mon Nov 14 16:18:57 2016 -0500
+++ b/abims_xcms_xcmsSet.xml	Thu Dec 22 05:59:20 2016 -0500
@@ -1,14 +1,14 @@
-<tool id="abims_xcms_xcmsSet" name="xcms.xcmsSet" version="2.0.9">
-    
+<tool id="abims_xcms_xcmsSet" name="xcms.xcmsSet" version="2.0.10">
+
     <description>Filtration and Peak Identification using xcmsSet function from xcms R package to preprocess LC/MS data for relative quantification and statistical analysis </description>
-    
+
     <macros>
         <import>macros.xml</import>
     </macros>
 
     <expand macro="requirements"/>
     <expand macro="stdio"/>
-    
+
     <command><![CDATA[
         @COMMAND_XCMS_SCRIPT@
         #if $inputs.input == "lib":
@@ -24,14 +24,14 @@
         ticspdf $ticsRawPdf
         bicspdf $bpcsRawPdf
 
-        ## profmethod $profmethod 
-        nSlaves \${GALAXY_SLOTS:-1} method $methods.method 
+        ## profmethod $profmethod
+        nSlaves \${GALAXY_SLOTS:-1} method $methods.method
         #if $methods.method == "centWave":
             ppm $methods.ppm
             peakwidth "c($methods.peakwidth)"
             #if $methods.options_scanrange.option == "show":
                 scanrange "c($methods.options_scanrange.scanrange)"
-            #end if 
+            #end if
             #if $methods.options_c.option == "show":
                 mzdiff $methods.options_c.mzdiff
                 snthresh $methods.options_c.snthresh
@@ -60,7 +60,7 @@
         #end if
         @COMMAND_LOG_EXIT@
     ]]></command>
-    
+
     <inputs>
 
         <conditional name="inputs">
@@ -73,13 +73,13 @@
              </when>
             <when value="lib">
                 <param name="library" type="text" size="40" label="Library directory name" help="The name of your directory containing all your data" >
-                <validator type="empty_field"/> 
+                <validator type="empty_field"/>
             </param>
                 </when>
 
         </conditional>
 
-       
+
 <!--
         <param name="profmethod" type="select" label="Method to use for profile generation (profmethod)" >
             <option value="bin" selected="true">bin</option>
@@ -107,13 +107,13 @@
                     </param>
                     <when value="show">
                         <param name="scanrange" type="text" value="" label="scanrange" help="scan range to process, for example (16,365)" >
-                            <validator type="empty_field"/> 
+                            <validator type="empty_field"/>
                         </param>
                     </when>
                     <when value="hide">
                     </when>
                 </conditional>
-                        
+
                 <conditional name="options_c">
                     <param name="option" type="select" label="Advanced options" >
                         <option value="show">show</option>
@@ -173,7 +173,7 @@
             </when>
         </conditional>
     </inputs>
-    
+
     <outputs>
         <data name="xsetRData" format="rdata.xcms.raw" label="xset.RData" />
         <data name="sampleMetadata" format="tabular" label="sampleMetadata.tsv" />
@@ -181,7 +181,7 @@
         <data name="bpcsRawPdf"   format="pdf" label="xset.BPCs_raw.pdf" />
         <data name="log" format="txt" label="xset.log.txt" />
     </outputs>
-    
+
     <tests>
         <!--<test>
             <param name="inputs|input" value="zip_file" />
@@ -239,7 +239,7 @@
             </output>
         </test>
     </tests>
-    
+
     <help><![CDATA[
 
 @HELP_AUTHORS@
@@ -267,7 +267,7 @@
 ========================= ================= ======= =========
 Name                      output file       format  parameter
 ========================= ================= ======= =========
-NA                        NA                zip     NA       
+NA                        NA                zip     NA
 ========================= ================= ======= =========
 
 
@@ -291,7 +291,7 @@
 
 ------
 
-.. class:: infomark 
+.. class:: infomark
 
 The output file is an xset.RData file. You can continue your analysis using it in **xcms.group** tool.
 
@@ -371,7 +371,7 @@
 
 **Matched Filter**
 
-    | One parameter to consider is the Gaussian model peak width used for matched filtration,an integral part of the peak detection algorithm. 
+    | One parameter to consider is the Gaussian model peak width used for matched filtration,an integral part of the peak detection algorithm.
     | For a discussion of how model peak width affects the signal to noise ratio, see Danielsson et al. (2002).
 
 
@@ -409,10 +409,10 @@
 xset.RData: rdata.xcms.raw format
 
     | Rdata file that is necessary in the second step of the workflow "xcms.group".
-    
+
 ------
 
-.. class:: infomark 
+.. class:: infomark
 
 The output file is an xset.RData file. You can continue your analysis using it in **xcms.group** tool.
 
@@ -432,7 +432,7 @@
 
     | Method -> **matchedFilter**
     | step   -> **0.01**
-    | fwhm   -> **4** 
+    | fwhm   -> **4**
     | Advanced option -> **show**
     | max: -> **50**
     | snthresh -> **1**
@@ -475,9 +475,13 @@
 Changelog/News
 --------------
 
+**Version 2.0.10 - 22/12/2016**
+
+- BUGFIX: when having only one group (i.e. one folder of raw data) the BPC and TIC pdf files do not contain any graph
+
 **Version 2.0.9 - 06/07/2016**
 
-- UPGRADE: upgrate the xcms version from 1.44.0 to 1.46.0
+- UPGRADE: upgrade the xcms version from 1.44.0 to 1.46.0
 
 **Version 2.0.8 - 06/04/2016**
 
--- a/lib.r	Mon Nov 14 16:18:57 2016 -0500
+++ b/lib.r	Thu Dec 22 05:59:20 2016 -0500
@@ -1,9 +1,12 @@
-# lib.r version="2.0.1"
+# lib.r version="2.3"
 #Authors ABiMS TEAM
 #Lib.r for Galaxy Workflow4Metabo
-#version 2.2
+#version 2.3
 #Based on lib.r 2.1
 #Modifications made by Guitton Yann 
+#2.3 Note
+#correction for empty PDF when only 1 class
+#2.2 Note
 #correct bug in Base Peak Chromatogram (BPC) option, not only TIC when scanrange used in xcmsSet
 #Note if scanrange is used a warning is prompted in R console but do not stop PDF generation
 
@@ -114,7 +117,25 @@
     legend("topright",paste(basename(files[c(classnames[[k]],classnames[[l]])])), col = colvect, lty = lty, pch = pch)
 
   }#end length ==2
+  
+  #case where only one class
+  if (length(class)==1){
+    k=1
+		ylim = range(sapply(TIC, function(x) range(x[,2])))
+    colvect<-NULL
+    plot(0, 0, type="n", xlim = xlim/60, ylim = ylim, main = paste("Base Peak Chromatograms \n","BPCs_",class[k], sep=""), xlab = "Retention Time (min)", ylab = "BPC")
 
+    for (j in 1:length(classnames[[k]])) {
+      tic <- TIC[[classnames[[k]][j]]]
+      # points(tic[,1]/60, tic[,2], col = cols[i], pch = pch[i], type="l")
+      points(tic[,1]/60, tic[,2], col = cols[classnames[[k]][j]], pch = pch[classnames[[k]][j]], type="l")
+      colvect<-append(colvect,cols[classnames[[k]][j]])
+    }
+      
+    legend("topright",paste(basename(files[c(classnames[[k]])])), col = colvect, lty = lty, pch = pch)
+
+  }#end length ==1
+                        
   dev.off() #pdf(pdfname,w=16,h=10)
 
   invisible(TIC)
@@ -219,6 +240,25 @@
     legend("topright",paste(basename(files[c(classnames[[k]],classnames[[l]])])), col = colvect, lty = lty, pch = pch)
 
   }#end length ==2
+    
+  #case where only one class
+  if (length(class)==1){
+	  k=1
+	  ylim = range(sapply(TIC, function(x) range(x[,2])))
+				
+	  plot(0, 0, type="n", xlim = xlim/60, ylim = ylim, main = paste("Total Ion Chromatograms \n","TICs_",class[k], sep=""), xlab = "Retention Time (min)", ylab = "TIC")
+    colvect<-NULL
+		for (j in 1:length(classnames[[k]])) {
+      tic <- TIC[[classnames[[k]][j]]]
+			# points(tic[,1]/60, tic[,2], col = cols[i], pch = pch[i], type="l")
+			points(tic[,1]/60, tic[,2], col = cols[classnames[[k]][j]], pch = pch[classnames[[k]][j]], type="l")
+      colvect<-append(colvect,cols[classnames[[k]][j]])
+	  }
+		
+		legend("topright",paste(basename(files[c(classnames[[k]])])), col = colvect, lty = lty, pch = pch)
+	  
+	}#end length ==1
+                        
   dev.off() #pdf(pdfname,w=16,h=10)
 
   invisible(TIC)
--- a/macros.xml	Mon Nov 14 16:18:57 2016 -0500
+++ b/macros.xml	Thu Dec 22 05:59:20 2016 -0500
@@ -2,7 +2,6 @@
 <macros>
     <xml name="requirements">
         <requirements>
-            <requirement type="package" version="3.1.2">R</requirement>
             <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>