From 063b9bd99110f2b1613fd586fdb24128b498fc77 Mon Sep 17 00:00:00 2001 From: TKMCheng <89597443+TKMarkCheng@users.noreply.github.com> Date: Sun, 5 Mar 2023 02:31:03 +0000 Subject: [PATCH] more accurate getPrevalence() DEL warning #81 --- R/getGenomicData.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/getGenomicData.R b/R/getGenomicData.R index aa08afe..e733140 100644 --- a/R/getGenomicData.R +++ b/R/getGenomicData.R @@ -44,9 +44,9 @@ getGenomicData <- function(query_url, location=NULL, cumulative=NULL, pangolin_l q <- c(q, paste0("pangolin_lineage=", pangolin_lineage, "&")) } if(!is.null(mutations)){ - check_cond <- grepl("[A-Za-z0-9]+:[A-Za-z][0-9]+[A-Za-z]", mutations) + check_cond <- grepl("[A-Za-z0-9]+:[A-Za-z][0-9]+[A-Za-z]|[A-Za-z0-9]+:DEL[0-9]+/[0-9]+", mutations) if(!all(check_cond)) - warning(paste0("Mutations should be specified in the format gene:mutation, like \"S:E484K\". The following mutations are not in the specified format: ", paste(mutations[!check_cond], collapse=", "))) + warning(paste0("Mutations should be specified in the format gene:mutation, like \"S:E484K\" or \"ORF1a:DEL3675/3677\". The following mutations are not in the specified format: ", paste(mutations[!check_cond], collapse=", "))) mutations <- paste(mutations, collapse=" AND ") q <- c(q, paste0("mutations=", mutations, "&")) }