Skip to content

Commit

Permalink
problem with APNI "genera" fixed
Browse files Browse the repository at this point in the history
4 phrase names in APNI where the first word was a "family" and there were mistakenly ending up as genus names when resources loaded; caught by test failure
  • Loading branch information
ehwenk committed Feb 6, 2024
1 parent cb8d2d6 commit e5776fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions R/load_taxonomic_resources.R
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ load_taxonomic_resources <-
) %>%
dplyr::filter(taxon_rank %in% c("genus")) %>%
dplyr::filter(!canonical_name %in% taxonomic_resources$APC$canonical_name) %>%
dplyr::filter(!stringr::str_detect(stringr::word(genus, 1), "aceae$")) %>%
dplyr::mutate(taxonomic_dataset = "APNI") %>%
dplyr::distinct(canonical_name, .keep_all = TRUE)

Expand Down
4 changes: 2 additions & 2 deletions R/match_taxa.R
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,8 @@ match_taxa <- function(
return(taxa)

# match_02c: Genus-level resolution
# Fuzzy matches of APC known genera for names where the final "word" is `sp` or `spp` and
# there isn't an exact match to an APC known genus name.
# Fuzzy matches of APC synonymous genera for names where the final "word" is `sp` or `spp` and
# there isn't an exact match to an APC synonymous genus name.
# Aligned name includes identifier to indicate `genus sp.` refers to a specific species (or infra-specific taxon), associated with a specific dataset/location.
i <-
stringr::str_detect(taxa$tocheck$cleaned_name, "[:space:]sp\\.$") &
Expand Down

0 comments on commit e5776fa

Please sign in to comment.