Mercurial > repos > prog > lcmsmatching
comparison Ms4TabSqlDb.R @ 1:45e985cd8e9e draft
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
| author | prog |
|---|---|
| date | Tue, 31 Jan 2017 05:27:24 -0500 |
| parents | 3afe41d3e9e7 |
| children |
comparison
equal
deleted
inserted
replaced
| 0:3afe41d3e9e7 | 1:45e985cd8e9e |
|---|---|
| 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 |
