Skip to content

Support for indels in vmatchPattern for XStringSets #128

@tomsing1

Description

@tomsing1

I think vmatchPattern doesn't support indels for XStringObjects, yet, as reported in this support thread. Hervé suggested to file an issue here, to keep it on the radar. I haven't found a corresponding issue yet, so here it is! (Apologies if I overlooked an existing issue.)

Reproducible example:

library(Biostrings)

subject <- DNAStringSet(
  c("GCTCTCTGCTCCTCCTGTTCGACAG", 
    "TCAGCCGCATCTTCTTTTGCGTCG", 
    "CCAGGTGAAGACGGGCGGAGA"))
pattern =   "AGACGGCGG"  # one G deleted

# with with.indels = FALSE, indels, no hits are reported
lengths(vmatchPattern(pattern, subject, with.indels = FALSE, max.mismatch = 1)) # 0 0 0

# with with.indels = TRUE, an error is raised
vmatchPattern(pattern, subject, with.indels = TRUE, max.mismatch = 1)
# Error in .XStringSet.vmatchPattern(pattern, subject, max.mismatch, min.mismatch,  : 
#  vmatchPattern() does not support indels yet

Session information

R version 4.5.1 (2025-06-13)
Platform: aarch64-apple-darwin20
Running under: macOS Sequoia 15.5

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.12.1

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: America/Los_Angeles
tzcode source: internal

attached base packages:
[1] stats4 stats graphics grDevices datasets utils methods base

other attached packages:
[1] Biostrings_2.76.0 GenomeInfoDb_1.44.1 XVector_0.48.0 IRanges_2.42.0 S4Vectors_0.46.0
[6] BiocGenerics_0.54.0 generics_0.1.4

loaded via a namespace (and not attached):
[1] R6_2.6.1 GenomeInfoDbData_1.2.14 UCSC.utils_1.4.0 renv_1.1.5
[5] compiler_4.5.1 httr_1.4.7 tools_4.5.1 BiocManager_1.30.26
[9] jsonlite_2.0.0 crayon_1.5.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions