Mercurial > repos > prog > lcmsmatching
diff MsXlsDb.R @ 6:b8f70d8216b3 draft
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit b3a4e34cf9356447ae3507cc6fe2ff6a1f24afbc-dirty
| author | prog |
|---|---|
| date | Mon, 27 Mar 2017 06:27:29 -0400 |
| parents | 45e985cd8e9e |
| children |
line wrap: on
line diff
--- a/MsXlsDb.R Thu Mar 16 08:15:11 2017 -0400 +++ b/MsXlsDb.R Mon Mar 27 06:27:29 2017 -0400 @@ -56,7 +56,7 @@ # GET MOLECULE IDS # #################### - MsXlsDb$methods( getMoleculeIds = function() { + MsXlsDb$methods( getMoleculeIds = function(max.results = NA_integer_) { # Init file list .self$.init.file.list() @@ -64,6 +64,10 @@ # Get IDs mol.ids <- as.integer(which( ! is.na(.self$.files))) + # Cut + if ( ! is.na(max.results) && length(mol.ids) > max.results) + mol.ids <- mol.ids[max.results, ] + return(mol.ids) }) @@ -801,6 +805,7 @@ mols <- .self$getMoleculeIds() results <- data.frame(id = integer(), col = character(), colrt = double(), stringsAsFactors = FALSE) + colnames(results) <- c(MSDB.TAG.MOLID, MSDB.TAG.COL, MSDB.TAG.COLRT) # Loop on all molecules for (molid in mols) {
