diff --git a/DESCRIPTION b/DESCRIPTION index 8651a06..155c444 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: variantstring Type: Package Title: Functions for working with variant string format -Version: 1.8.3 +Version: 1.8.4 Authors@R: c( person("Bob", "Verity", email = "r.verity@imperial.ac.uk", role = c("aut", "cre")) ) diff --git a/R/main.R b/R/main.R index a7400f9..890d62c 100644 --- a/R/main.R +++ b/R/main.R @@ -859,12 +859,11 @@ subset_position <- function(position_string, variant_strings) { v_unique <- unique(variant_strings) l_unique <- mapply(function(x) { - df_diff <- anti_join(df_position, x, by = c("gene", "pos")) - if (nrow(df_diff) == 0) { - df_sub <- semi_join(x, df_position, by = c("gene", "pos")) - ret <- long_to_variant(list(df_sub)) - } else { + df_join <- inner_join(df_position, x, by = c("gene", "pos")) + if (nrow(df_join) == 0) { ret <- NA + } else { + ret <- long_to_variant(list(df_join)) } ret }, variant_to_long(v_unique), SIMPLIFY = FALSE) |> diff --git a/README.Rmd b/README.Rmd index 73d18d4..b240a12 100644 --- a/README.Rmd +++ b/README.Rmd @@ -27,7 +27,7 @@ Tools for working with *variant string format*, a convenient format for encoding You can install directly from Github: ```{r, eval=FALSE} -devtools::install_github(repo = "mrc-ide/variantstring@v1.8.3") +devtools::install_github(repo = "mrc-ide/variantstring@v1.8.4") ``` Note the use of the @ symbol to reference a specific tagged version. This is highly recommended as the package is still in development and backwards compatibility is not guaranteed. diff --git a/README.md b/README.md index 188f424..3c65455 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ other. You can install directly from Github: ``` r -devtools::install_github(repo = "mrc-ide/variantstring@v1.8.3") +devtools::install_github(repo = "mrc-ide/variantstring@v1.8.4") ``` Note the use of the @ symbol to reference a specific tagged version.