Skip to content

Commit

Permalink
Merge pull request #98 from ropensci/97-cant-manually-specify-cox1-as…
Browse files Browse the repository at this point in the history
…-database

fix b_get_db
  • Loading branch information
salix-d authored Jun 13, 2023
2 parents acff4da + c6c9186 commit dc46f3b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions R/utils_assert.R
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,14 @@ b_validate <- function(x, choices, name){
}
}
b_get_db <- function(x){
x <- tolower(x)
if (b_detect(x, '^pub(lic)?$|_public$'))
opts <- list(case_insensitive = TRUE)
if (b_detect(x, '^COX[1I]$', opts_regex = opts))
"COX1"
else if (b_detect(x, '^pub(lic)?$|_public$', opts_regex = opts))
"COX1_SPECIES_PUBLIC"
else if (b_detect(x, '^spe(cies)?$|_species$'))
else if (b_detect(x, '^spe(cies)?$|_species$', opts_regex = opts))
"COX1_SPECIES"
else if (b_detect(x, '^(cox1_)?(l640)?bp$'))
else if (b_detect(x, '^(cox[1I]_)?(l640)?bp$', opts_regex = opts))
"COX1_L640bp"
else
x
Expand Down

0 comments on commit dc46f3b

Please sign in to comment.