comparison 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
comparison
equal deleted inserted replaced
1:253d531a0193 2:20d69a062da3
227 227
228 ################# 228 #################
229 # GET MZ VALUES # 229 # GET MZ VALUES #
230 ################# 230 #################
231 231
232 MsPeakForestDb$methods( getMzValues = function(mode = NULL) { 232 MsPeakForestDb$methods( getMzValues = function(mode = NULL, max.results = NA_integer_) {
233 233
234 # Query params 234 # Query params
235 params <- NULL 235 params <- NULL
236 if ( ! is.null(mode)) 236 if ( ! is.null(mode))
237 params <- c(params, mode = if (mode == MSDB.TAG.POS) 'positive' else 'negative') 237 params <- c(params, mode = if (mode == MSDB.TAG.POS) 'positive' else 'negative')
238 238
239 # Get MZ valuels 239 # Get MZ valuels
240 mz <- .self$.get.url(url = 'spectra/lcms/peaks/list-mz', params = params) 240 mz <- .self$.get.url(url = 'spectra/lcms/peaks/list-mz', params = params)
241
242 # Apply cut-off
243 if ( ! is.na(max.results))
244 mz <- mz[1:max.results]
241 245
242 return(mz) 246 return(mz)
243 }) 247 })
244 248
245 ############################## 249 ##############################