changeset 53:70574a6381ea

small fixes
author pieter.lukasse@wur.nl
date Thu, 11 Dec 2014 14:09:27 +0100
parents 5b1adc49700d
children 10f3cb998c4e
files metaMS_cmd_annotate.r metams_lcms_annotate.xml metams_lcms_pick_and_group.xml static/images/metaMS_annotate.png static/images/metaMS_pick_align_camera.png
diffstat 5 files changed, 69 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/metaMS_cmd_annotate.r	Thu Dec 11 10:26:17 2014 +0100
+++ b/metaMS_cmd_annotate.r	Thu Dec 11 14:09:27 2014 +0100
@@ -10,13 +10,16 @@
 ## output file names, e.g. "E:/Rworkspace/metaMS/data/out.txt"
 args.outAnnotationTable <- args[4]
 
+args.mass_error_function <- args[5]
+if (args.mass_error_function == "0")
+	args.mass_error_function <- NULL
 ## report files
-args.htmlReportFile <- args[5]
-args.htmlReportFile.files_path <- args[6]
+args.htmlReportFile <- args[6]
+args.htmlReportFile.files_path <- args[7]
 
-if (length(args) == 7)
+if (length(args) == 8)
 {
-	args.outLogFile <- args[7]
+	args.outLogFile <- args[8]
 	# suppress messages:
 	# Send all STDERR to STDOUT using sink() see http://mazamascience.com/WorkingWithData/?p=888
 	msg <- file(args.outLogFile, open="wt")
@@ -43,7 +46,7 @@
 			
 			# Just to highlight: if you want to use more than one 
 			# trigger runLC: 
-			LC <- runLC(xset=xsetData, settings = tempEnv[["customMetaMSsettings"]], DB = tempEnv[[testDB[1]]]$DB, nSlaves=20, returnXset = TRUE)
+			LC <- runLC(xset=xsetData, settings = tempEnv[["customMetaMSsettings"]], DB = tempEnv[[testDB[1]]]$DB, errf=args.mass_error_function, nSlaves=20, returnXset = TRUE)
 			
 			# write out runLC annotation results:
 			write.table(LC$PeakTable, args.outAnnotationTable, sep="\t", row.names=FALSE)
@@ -52,7 +55,7 @@
 			cat("\nConstructed DB info===============:\n")
 			str(tempEnv[[testDB[1]]]$Info)
 			cat("\nConstructed DB table===============:\n") 
-			if (length(args) == 7)
+			if (length(args) == 8)
 			{
 				write.table(tempEnv[[testDB[1]]]$DB, args.outLogFile, append=TRUE, row.names=FALSE)
 				write.table(tempEnv[[testDB[1]]]$Reftable, args.outLogFile, sep="\t", append=TRUE, row.names=FALSE)
--- a/metams_lcms_annotate.xml	Thu Dec 11 10:26:17 2014 +0100
+++ b/metams_lcms_annotate.xml	Thu Dec 11 14:09:27 2014 +0100
@@ -9,6 +9,11 @@
 	    $xsetData
 	    $customMetaMSsettings
 	    $outputFile 
+	    #if $mzTol.mzTolType == "fixed"  
+			0
+		#else
+            "$mzTol.mass_error_function"
+		#end if
 	    $htmlReportFile
 	    $htmlReportFile.files_path
 	    $outputLog
@@ -20,13 +25,31 @@
 	
 	<param name="xsetData" type="data" format="rdata" label="xcmsSet data file (xset RDATA)" help="E.g. output data file resulting from METAMS 'feature picking, aligning and grouping' run"/>
 	
-	<param name="protocolName" type="text" size="30" label="protocolName" value="Synapt.QTOF.RP" help="protocolName"/>
+	<param name="protocolName" type="text" size="30" label="protocolName" value="e.g. Synapt.QTOF.RP" 
+		help="Choose a name to give for the specific settings in the parameters below"/>
+	
+	<param name="rtdiff" type="float" size="10" value="1.5" label="rtdiff" help="(Annotation) Allowed rt difference (in minutes)"/>
 	
-	<param name="rtdiff" type="float" size="10" value="1.5" label="rtdiff" help="rtdiff"/>
-	<param name="rtval" type="float" size="10" value="0.1" label="rtval" help="rtval" />
-	<param name="mzdiff" type="float" size="10" value="0.005" label="mzdiff" help="mzdiff" />
-	<param name="match2DB_ppm" type="float" size="10" value="5.0" label="ppm" help="ppm" />
-	<param name="minfeat" type="integer" size="10" value="2" label="minfeat" help="minfeat" />
+	<conditional name="mzTol">
+		<param name="mzTolType" type="select" size="30" label="(Annotation) m/z tolerance type">
+			<option value="fixed" selected="true">Fixed tolerance</option>
+			<option value="adaptive" >Adaptive tolerance</option>
+		</param>
+		<when value="fixed">
+			<param name="mzdiff" type="float" size="10" value="0.005" label="mzdiff" help="(Annotation) Fixed mass tolerance" />
+		</when>
+		<when value="adaptive">
+			<param name="ppm" type="float" size="10" value="5.0" label="ppm" help="(Annotation) Tolerance in ppm" />
+			<param name="mass_error_function" type="text" area="true" size="3x70" label="(Annotation) Mass error function"/>
+		</when>
+	</conditional>
+
+	<param name="rtval" type="float" size="10" value="0.1" label="(max)rtval" help="(Validation) Group items are clustered once more with hierarchical clustering ('complete' method)
+	          based on their rt distances. Here one can specify the rt threshold for removing the items that have too diverging rt (the ones with rt difference 
+	          larger than rtval). " />
+	<param name="minfeat" type="integer" size="10" value="2" label="minfeat" 
+	           help="(Validation) Threshold for the minimum number of features a 
+	           cluster/group should have (after rtval filtering above). Other clusters/groups are filtered out." />
 	
 </inputs>
 <configfiles>
@@ -38,8 +61,11 @@
 metaSetting(customMetaMSsettings, "match2DB") &lt;- list(
             rtdiff = ${rtdiff},
             rtval = ${rtval},
-            mzdiff = ${mzdiff},
-            ppm = ${match2DB_ppm},
+		#if $mzTol.mzTolType == "fixed"  
+			mzdiff = ${mzTol.mzdiff},
+		#else
+            ppm = ${mzTol.ppm},
+		#end if
             minfeat = ${minfeat})</configfile>
 
 </configfiles>
@@ -58,27 +84,32 @@
 
 .. class:: infomark
   
-Runs metaMS process for LC/MS feature annotation. 
-The figure below shows the main parts of the metaMS process.
-This tool related to the last step of this process. 
+Runs metaMS process for LC/MS feature annotation based on matching to an existing 'standards' DB.  
+The figure below shows the main parts of this metaMS process.
 
-.. image:: $PATH_TO_IMAGES/metaMS.png 
+.. image:: $PATH_TO_IMAGES/metaMS_annotate.png 
 
 
-From CAMERA documentation: 
+.. class:: infomark
 
-.. image:: $PATH_TO_IMAGES/CAMERA_results.png 
-
-**References**
+The implemented annotation strategy can be broken down in the following steps:
 
-If you use this Galaxy tool in work leading to a scientific publication please
-cite the following papers:
+1. *Feature wise Annotation:* Each feature detected by runLC is matched against the database. If
+the mass error function is provided, the appropriate m/z tolerance is calculated, otherwise a fixed
+tolerance is used (mzdiff). The retention time tolerance is fixed and should be selected on the
+bases of the characteristics of each chromatographic method (rtdiff). Multiple annotations - i.e.
+features which are associated to more than one compound - are possible. This outcome does not
+indicate a problem per se, but is an inherent drawback of co-elution.
 
-Wehrens, R.; Weingart, G.; Mattivi, F. (2014). 
-metaMS: an open-source pipeline for GC-MS-based untargeted metabolomics. 
-Journal of chromatography B: biomedical sciences and applications, 996 (1): 109-116. 
-doi: 10.1016/j.jchromb.2014.02.051 
-handle: http://hdl.handle.net/10449/24012
+2. *Annotation Validation:* The annotated features are organized in 'pseudospectra' collecting all
+the experimental features which are assigned to a specific compound. A specific annotation is
+confirmed only if more than minfeat features which differ in retention time less than rtval are
+present in a pseudospectrum. As a general rule rtval should be narrower than rtdiff. The
+latter, indeed, accounts for shifts in retention time between the injection of the standards and the
+metabolomics experiment under investigation. This time can be rather long, considering that the
+standards are not commonly re-analyzed each time. On the other hand, rtval represents the shift
+between the ions of the same compound within the same batch of injections and therefore it has
+only to account for the smaller shifts occurring during peak picking and alignment.
 
 
   </help>
--- a/metams_lcms_pick_and_group.xml	Thu Dec 11 10:26:17 2014 +0100
+++ b/metams_lcms_pick_and_group.xml	Thu Dec 11 14:09:27 2014 +0100
@@ -269,10 +269,14 @@
 Runs metaMS process for LC/MS feature feature picking, aligning and grouping. 
 This part of the metaMS process makes use of the XCMS and CAMERA tools and algorithms.
 CAMERA is used for automatic deconvolution/annotation of LC/ESI-MS data.
-The figure below shows the main parts of the metaMS process. 
+The figure below shows the main parts of the metaMS process wrapped by this tool. 
+
+.. image:: $PATH_TO_IMAGES/metaMS_pick_align_camera.png 
 
-.. image:: $PATH_TO_IMAGES/metaMS.png 
 
+From CAMERA documentation: 
+
+.. image:: $PATH_TO_IMAGES/CAMERA_results.png 
 
 **References**
 
Binary file static/images/metaMS_annotate.png has changed
Binary file static/images/metaMS_pick_align_camera.png has changed