From ddfd6d7724c89adb9aa70f755d09a6a3db6a6247 Mon Sep 17 00:00:00 2001 From: Alexander Sandercock <39815775+alex-sandercock@users.noreply.github.com> Date: Wed, 21 May 2025 17:18:59 -0400 Subject: [PATCH 1/3] Update README.md --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 87fcdb2..7a4f653 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,13 @@ BIGr is an R package developed by [Breeding Insight](https://breedinginsight.org ## Installation -To install BIGr, you'll need to have `BiocManager` installed. +The stable version of BIGr is now available on CRAN. To install from the R terminal: +```R +install.packages("BIGr") +``` + +To install the development version of BIGr, you'll need to have `BiocManager` installed. Then, install from GitHub. ```R if (!require("BiocManager", quietly = TRUE)) install.packages("BiocManager") @@ -30,6 +35,8 @@ if (!require("BiocManager", quietly = TRUE)) BiocManager::install("Breeding-Insight/BIGr", dependencies = TRUE) library(BIGr) ``` +Note: This GitHub version of BIGr is in development. So, there could be bugs present, and the stable version of BIGr on CRAN should be viewed as more reliable. + ## Funding BIGr development is supported by [Breeding Insight](https://breedinginsight.org/), a USDA-funded initiative based at Cornell University. From 4e2701392519043a6ef54af84794a7a6bb31baa1 Mon Sep 17 00:00:00 2001 From: Alexander Sandercock <39815775+alex-sandercock@users.noreply.github.com> Date: Sat, 13 Dec 2025 20:40:16 -0500 Subject: [PATCH 2/3] Revise development note and funding information Updated funding source and note about BIGr development. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 08a21ba..a7c1735 100644 --- a/README.md +++ b/README.md @@ -36,11 +36,11 @@ if (!require("BiocManager", quietly = TRUE)) BiocManager::install("Breeding-Insight/BIGr", dependencies = TRUE) library(BIGr) ``` -Note: This GitHub version of BIGr is in development. So, there could be bugs present, and the stable version of BIGr on CRAN should be viewed as more reliable. +> Note: This GitHub version of BIGr is in development. So, there could be bugs present, and the stable version of BIGr on CRAN should be viewed as more reliable. ## Funding -BIGr development is supported by [Breeding Insight](https://breedinginsight.org/), a USDA-funded initiative based at Cornell University. +BIGr development is supported by [Breeding Insight](https://breedinginsight.org/), a USDA-funded initiative based at the University of Florida - IFAS. ## Citation From b4ec294e847349880e3a6cb5bb68671fbf8133d8 Mon Sep 17 00:00:00 2001 From: shbrainard Date: Fri, 19 Jun 2026 09:21:51 -0400 Subject: [PATCH 3/3] Fix madc2vcf_all() crash on off-target alleles with no remaining mismatches When add_others = TRUE, compare() computed other_ref_base/other_alt_base with substring() before checking that any mismatch positions remained. If an off-target ("Other") allele aligns to the reference with its only mismatch at the target SNP position, that position is removed and pos_ref_idx/pos_alt_idx become integer(0), so substring() errors with "invalid substring arguments" and the whole run aborts. Move the two substring() calls inside the existing 'if (length(pos_ref_idx) > 0)' guard, mirroring how the off-target Match alleles are already handled. Behavior is unchanged when mismatch positions remain; existing madc2vcf_all tests still pass. --- NEWS.md | 4 ++++ R/madc2vcf_all.R | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index 309fc13..a8e6e0d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# BIGr (development version) + +- Fixed `madc2vcf_all()` error "invalid substring arguments" that occurred with `add_others = TRUE` when an off-target ("Other") allele aligned to the reference with no mismatch positions remaining after the target SNP position was removed. The reference/alternate base lookups for off-target alleles are now guarded by the existing non-empty check, matching how the off-target Match alleles are already handled. + # BIGr 0.7.2 - Fixed manual text errors diff --git a/R/madc2vcf_all.R b/R/madc2vcf_all.R index e223977..83d2d60 100644 --- a/R/madc2vcf_all.R +++ b/R/madc2vcf_all.R @@ -652,10 +652,11 @@ compare <- function(one_tag, botloci, alignment_score_thr = 40, mi_df = NULL, ad pos_alt_idx <- pos_alt_idx[-rm_target_other] } } - other_ref_base <- substring(ref_seq, pos_ref_idx, pos_ref_idx) - other_alt_base <- substring(others_seq[j,]$AlleleSequence, pos_alt_idx, pos_alt_idx) # Cases found where the AltMatch is another alternative for the target SNP - they are discarted if(length(pos_ref_idx) >0){ + # Compute bases only when mismatch positions remain; substring() errors on integer(0) indices + other_ref_base <- substring(ref_seq, pos_ref_idx, pos_ref_idx) + other_alt_base <- substring(others_seq[j,]$AlleleSequence, pos_alt_idx, pos_alt_idx) # If Match sequences have N, do not consider as polymorphism if(any(!other_alt_base %in% c("A", "T", "C", "G"))) { other_ref_base <- other_ref_base[-which(!other_alt_base %in% c("A", "T", "C", "G"))]