changeset 3:f61ce21ed17c draft

planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit 476a081c0da66822f4e77070f5ce59d9f14511f4-dirty
author prog
date Thu, 02 Mar 2017 11:07:56 -0500
parents 20d69a062da3
children b34c14151f25
files MsPeakForestDb.R lcmsmatching.xml
diffstat 2 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/MsPeakForestDb.R	Thu Mar 02 08:55:00 2017 -0500
+++ b/MsPeakForestDb.R	Thu Mar 02 11:07:56 2017 -0500
@@ -260,13 +260,15 @@
 
 		# Build result data frame
 		results <- data.frame(MSDB.TAG.MOLID = character(), MSDB.TAG.MOLNAMES = character(), MSDB.TAG.MZTHEO = numeric(), MSDB.TAG.COMP = character(), MSDB.TAG.ATTR = character())
-		for (x in spectra)
-			results <- rbind(results, data.frame(MSDB.TAG.MOLID = vapply(x$source$listOfCompounds, function(c) as.character(c$id), FUN.VALUE = ''),
-			                                     MSDB.TAG.MOLNAMES = vapply(x$source$listOfCompounds, function(c) paste(c$names, collapse = MSDB.MULTIVAL.FIELD.SEP), FUN.VALUE = ''),
-												 MSDB.TAG.MZTHEO = as.numeric(x$theoricalMass),
-												 MSDB.TAG.COMP = as.character(x$composition),
-												 MSDB.TAG.ATTR = as.character(x$attribution),
-												 stringsAsFactors = FALSE))
+		for (x in spectra) {
+			if ('source' %in% names(x) && is.list(x$source))
+				results <- rbind(results, data.frame(MSDB.TAG.MOLID = vapply(x$source$listOfCompounds, function(c) as.character(c$id), FUN.VALUE = ''),
+				                                     MSDB.TAG.MOLNAMES = vapply(x$source$listOfCompounds, function(c) paste(c$names, collapse = MSDB.MULTIVAL.FIELD.SEP), FUN.VALUE = ''),
+													 MSDB.TAG.MZTHEO = as.numeric(x$theoricalMass),
+													 MSDB.TAG.COMP = as.character(x$composition),
+													 MSDB.TAG.ATTR = as.character(x$attribution),
+													 stringsAsFactors = FALSE))
+		}
 
 		# RT search
 		if ( ! is.null(rt.low) && ! is.null(rt.high)) {
--- a/lcmsmatching.xml	Thu Mar 02 08:55:00 2017 -0500
+++ b/lcmsmatching.xml	Thu Mar 02 11:07:56 2017 -0500
@@ -1,4 +1,4 @@
-<tool id="lcmsmatching" name="LC/MS matching" version="3.1.7" profile="16.01">
+<tool id="lcmsmatching" name="LC/MS matching" version="3.1.8" profile="16.01">
 
 	<description>Annotation of MS peaks using matching on a spectra database.</description>