diff MsPeakForestDb.R @ 2:20d69a062da3 draft

planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8
author prog
date Thu, 02 Mar 2017 08:55:00 -0500
parents 253d531a0193
children f61ce21ed17c
line wrap: on
line diff
--- a/MsPeakForestDb.R	Sat Sep 03 17:02:01 2016 -0400
+++ b/MsPeakForestDb.R	Thu Mar 02 08:55:00 2017 -0500
@@ -229,7 +229,7 @@
 	# GET MZ VALUES #
 	#################
 	
-	MsPeakForestDb$methods( getMzValues = function(mode = NULL) {
+	MsPeakForestDb$methods( getMzValues = function(mode = NULL, max.results = NA_integer_) {
 
 		# Query params
 		params <- NULL
@@ -239,6 +239,10 @@
 		# Get MZ valuels
 		mz <- .self$.get.url(url = 'spectra/lcms/peaks/list-mz', params = params)
 
+		# Apply cut-off
+		if ( ! is.na(max.results))
+			mz <- mz[1:max.results]
+
 		return(mz)
 	})