From 0145afece7ae647d2bb7d12efe471248bb1132be Mon Sep 17 00:00:00 2001 From: Pavel Vychyk Date: Tue, 10 Dec 2024 11:58:07 +0100 Subject: [PATCH] added warning message with all taxa ids which are not in the local database --- R/createTaxonomyMatrix.R | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/R/createTaxonomyMatrix.R b/R/createTaxonomyMatrix.R index 347d293d..58d04b4d 100644 --- a/R/createTaxonomyMatrix.R +++ b/R/createTaxonomyMatrix.R @@ -117,8 +117,20 @@ getTaxonomyInfo <- function(inputTaxa = NULL, currentNCBIinfo = NULL) { tmp <- list() outList <- list() k <- 1 + missingTaxa <- setdiff(inputTaxa, currentNCBIinfo$ncbiID) + if (length(missingTaxa) > 0) { + warning( + cat(length(missingTaxa), + "id(s) missed in currentNCBIinfo, check taxon database: ", + paste(missingTaxa, collapse = ", ") + ) + ) + } for (refID in inputTaxa) { # get info for this taxon + if (refID %in% missingTaxa) { + next + } refEntry <- currentNCBIinfo[currentNCBIinfo$ncbiID == refID, ] lastID <- refEntry$parentID inputTaxaInfo <- refEntry