Mercurial > repos > prog > lcmsmatching
comparison MsXlsDb.R @ 5:fb9c0409d85c draft
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit 608d9e59a0d2dcf85a037968ddb2c61137fb9bce
author | prog |
---|---|
date | Wed, 19 Apr 2017 10:00:05 -0400 |
parents | 20d69a062da3 |
children |
comparison
equal
deleted
inserted
replaced
4:b34c14151f25 | 5:fb9c0409d85c |
---|---|
54 | 54 |
55 #################### | 55 #################### |
56 # GET MOLECULE IDS # | 56 # GET MOLECULE IDS # |
57 #################### | 57 #################### |
58 | 58 |
59 MsXlsDb$methods( getMoleculeIds = function() { | 59 MsXlsDb$methods( getMoleculeIds = function(max.results = NA_integer_) { |
60 | 60 |
61 # Init file list | 61 # Init file list |
62 .self$.init.file.list() | 62 .self$.init.file.list() |
63 | 63 |
64 # Get IDs | 64 # Get IDs |
65 mol.ids <- as.integer(which( ! is.na(.self$.files))) | 65 mol.ids <- as.integer(which( ! is.na(.self$.files))) |
66 | |
67 # Cut | |
68 if ( ! is.na(max.results) && length(mol.ids) > max.results) | |
69 mol.ids <- mol.ids[max.results, ] | |
66 | 70 |
67 return(mol.ids) | 71 return(mol.ids) |
68 }) | 72 }) |
69 | 73 |
70 #################### | 74 #################### |
799 # Use all molecules if no list is provided | 803 # Use all molecules if no list is provided |
800 if (is.null(mols)) | 804 if (is.null(mols)) |
801 mols <- .self$getMoleculeIds() | 805 mols <- .self$getMoleculeIds() |
802 | 806 |
803 results <- data.frame(id = integer(), col = character(), colrt = double(), stringsAsFactors = FALSE) | 807 results <- data.frame(id = integer(), col = character(), colrt = double(), stringsAsFactors = FALSE) |
808 colnames(results) <- c(MSDB.TAG.MOLID, MSDB.TAG.COL, MSDB.TAG.COLRT) | |
804 | 809 |
805 # Loop on all molecules | 810 # Loop on all molecules |
806 for (molid in mols) { | 811 for (molid in mols) { |
807 no.col <- TRUE | 812 no.col <- TRUE |
808 for (c in col) { | 813 for (c in col) { |