diff Ms4TabSqlDb.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 e66bb061af06
children
line wrap: on
line diff
--- a/Ms4TabSqlDb.R	Sat Sep 03 17:02:01 2016 -0400
+++ b/Ms4TabSqlDb.R	Thu Mar 02 08:55:00 2017 -0500
@@ -266,7 +266,7 @@
 	#################
 	
 	# Returns a numeric vector of all masses stored inside the database.
-	Ms4TabSqlDb$methods( getMzValues = function(mode = NULL) {
+	Ms4TabSqlDb$methods( getMzValues = function(mode = NULL, max.results = NA_integer_) {
 
 		# Build request
 		select <- paste0("select distinct pk.mass as ", MSDB.TAG.MZTHEO)
@@ -274,6 +274,9 @@
 		where <- ""
 		if ( ! is.null(mode))
 			where <- paste0(" where ", if (mode == MSDB.TAG.POS) '' else 'not ', 'pk.ion_pos')
+		limit <- ""
+		if ( ! is.na(NA_integer_))
+			limit <- paste(" limit", max.results)
 
 		# Assemble request
 		request <- paste0(select, from, where, ';')