From cedbba88e6f1b5b7e931bcc2e55489b6b0d1c7e9 Mon Sep 17 00:00:00 2001 From: Bob Verity Date: Tue, 2 Dec 2025 21:52:07 +0000 Subject: [PATCH 1/2] bugfix in subset_position - causing duplication when applied to hets --- R/main.R | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/R/main.R b/R/main.R index 890d62c..99fcf14 100644 --- a/R/main.R +++ b/R/main.R @@ -859,11 +859,14 @@ subset_position <- function(position_string, variant_strings) { v_unique <- unique(variant_strings) l_unique <- mapply(function(x) { - df_join <- inner_join(df_position, x, by = c("gene", "pos")) - if (nrow(df_join) == 0) { + + df_intersect <- x |> + filter(gene %in% df_position$gene) |> + filter(pos %in% df_position$pos) + if (nrow(df_intersect) == 0) { ret <- NA } else { - ret <- long_to_variant(list(df_join)) + ret <- long_to_variant(list(df_intersect)) } ret }, variant_to_long(v_unique), SIMPLIFY = FALSE) |> From ce13c78b9eb0c7891f18d8a18ce9f5056989bff9 Mon Sep 17 00:00:00 2001 From: Bob Verity Date: Tue, 2 Dec 2025 21:52:52 +0000 Subject: [PATCH 2/2] updated version num --- DESCRIPTION | 2 +- README.Rmd | 2 +- README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 155c444..8e0381e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: variantstring Type: Package Title: Functions for working with variant string format -Version: 1.8.4 +Version: 1.8.5 Authors@R: c( person("Bob", "Verity", email = "r.verity@imperial.ac.uk", role = c("aut", "cre")) ) diff --git a/README.Rmd b/README.Rmd index b240a12..9602936 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.4") +devtools::install_github(repo = "mrc-ide/variantstring@v1.8.5") ``` 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 3c65455..2d39791 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.4") +devtools::install_github(repo = "mrc-ide/variantstring@v1.8.5") ``` Note the use of the @ symbol to reference a specific tagged version.