comparison 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
comparison
equal deleted inserted replaced
1:253d531a0193 2:20d69a062da3
264 ################# 264 #################
265 # GET MZ VALUES # 265 # GET MZ VALUES #
266 ################# 266 #################
267 267
268 # Returns a numeric vector of all masses stored inside the database. 268 # Returns a numeric vector of all masses stored inside the database.
269 Ms4TabSqlDb$methods( getMzValues = function(mode = NULL) { 269 Ms4TabSqlDb$methods( getMzValues = function(mode = NULL, max.results = NA_integer_) {
270 270
271 # Build request 271 # Build request
272 select <- paste0("select distinct pk.mass as ", MSDB.TAG.MZTHEO) 272 select <- paste0("select distinct pk.mass as ", MSDB.TAG.MZTHEO)
273 from <- " from peaklist as pk" 273 from <- " from peaklist as pk"
274 where <- "" 274 where <- ""
275 if ( ! is.null(mode)) 275 if ( ! is.null(mode))
276 where <- paste0(" where ", if (mode == MSDB.TAG.POS) '' else 'not ', 'pk.ion_pos') 276 where <- paste0(" where ", if (mode == MSDB.TAG.POS) '' else 'not ', 'pk.ion_pos')
277 limit <- ""
278 if ( ! is.na(NA_integer_))
279 limit <- paste(" limit", max.results)
277 280
278 # Assemble request 281 # Assemble request
279 request <- paste0(select, from, where, ';') 282 request <- paste0(select, from, where, ';')
280 283
281 # Run request 284 # Run request