R/find_polyN.R

Defines functions find_polyN

## extract polyA or polyT
find_polyN  = function(subject, pattern="AAAAAAAAAA",max.mismatch=1L) {
    if(!is(pattern,"DNAString")) { pattern = DNAString(pattern) }

    IRanges::reduce(vmatchPattern_direct(pattern, subject,
            max.mismatch=max.mismatch, min.mismatch=0L, with.indels=TRUE,
            fixed=c(TRUE,TRUE),algo="auto"))
}
czhu/R_nanopore documentation built on Dec. 19, 2021, 7:10 p.m.