Skip to content

Commit b539746

Browse files
bug fix
1 parent 523f176 commit b539746

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

R/parsers.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,9 @@ parse_unite_general <- function(input = NULL, file = NULL, include_seqs = TRUE)
471471

472472
# Remove unneeded columns
473473
output$data$tax_data$input <- NULL
474-
output$data$tax_data$tax_string <- NULL
474+
if ("tax_string" %in% names( output$data$tax_data)) {
475+
output$data$tax_data$tax_string <- NULL
476+
}
475477

476478
# Add sequences
477479
if (include_seqs) {

R/remove_ambiguous.R

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@
66
#' placeholders for unknown taxa (e.g. "unknown ...").
77
#' @param uncultured If \code{TRUE}, include names that suggest they are
88
#' assigned to uncultured organisms (e.g. "uncultured ...").
9+
#' @param regex If \code{TRUE}, includes regex syntax to make matching things like spaces more robust.
910
#' @param case_variations If \code{TRUE}, include variations of letter case.
1011
#'
1112
#' @export
12-
ambiguous_synonyms <- function(unknown = TRUE, uncultured = TRUE, case_variations = FALSE) {
13+
ambiguous_synonyms <- function(unknown = TRUE, uncultured = TRUE, regex = TRUE, case_variations = FALSE) {
1314
unknown_syns <- c(
1415
'unknown',
1516
'unidentified',
1617
'incertae sedis',
1718
'ambiguous',
18-
'ambiguous_taxa',
19+
'ambiguous taxa',
1920
'unassigned',
2021
'possible',
2122
'putative'
@@ -37,6 +38,9 @@ ambiguous_synonyms <- function(unknown = TRUE, uncultured = TRUE, case_variation
3738
capitalize(output),
3839
toupper(output))
3940
}
41+
if (regex) {
42+
output <- gsub(output, pattern = ' ', replacement = '[_ -]+')
43+
}
4044
return(output)
4145
}
4246

man/ambiguous_synonyms.Rd

Lines changed: 8 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)