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"))] diff --git a/README.md b/README.md index e913a9c..a7c1735 100644 --- a/README.md +++ b/README.md @@ -21,8 +21,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") @@ -31,9 +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. + ## 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