Entering edit mode
Using the exclude argument seems to break BSgenome::vmatchPattern
:
# vmatchPattern on full BSgenome works fine:
pattern <- 'GTAACGGCAGACTTCTCCAC'
bs <- BSgenome.Hsapiens.UCSC.hg38::BSgenome.Hsapiens.UCSC.hg38
results <- BSgenome::vmatchPattern(
pattern, bs, min.mismatch=0, max.mismatch=3)
results[GenomicRanges::seqnames(results)=='chr11']
GRanges object with 8 ranges and 0 metadata columns:
seqnames ranges strand
<Rle> <IRanges> <Rle>
[1] chr11 5226984-5227003 +
[2] chr11 5269853-5269872 +
[3] chr11 59369899-59369918 +
[4] chr11 72402607-72402626 +
[5] chr11 91170709-91170728 +
[6] chr11 108624292-108624311 +
[7] chr11 132892225-132892244 +
[8] chr11 87142523-87142542 -
-------
seqinfo: 455 sequences from an unspecified genome
# But using the `exlude` argument seems to break it:
require(magrittr)
excl <- sprintf('chr%s', c(as.character(1:22), 'X', 'Y', 'M')) %>% setdiff('chr11')
results <- BSgenome::vmatchPattern(
pattern, bs, min.mismatch=0, max.mismatch=3, exclude=excl)
GRanges object with 0 ranges and 0 metadata columns:
seqnames ranges strand
<Rle> <IRanges> <Rle>
-------
seqinfo: 455 sequences from an unspecified genome