patternMatrix(pattern, windows, genome = NULL, min.score = 0.8,
asPercentage = FALSE, cores = 1)\S4method{patternMatrix}{character,DNAStringSet}(pattern, windows,
asPercentage, cores)
\S4method{patternMatrix}{character,GRanges,BSgenome}(pattern, windows, genome,
cores)
\S4method{patternMatrix}{matrix,DNAStringSet}(pattern, windows,
min.score, asPercentage,
cores)
\S4method{patternMatrix}{matrix,GRanges,BSgenome}(pattern, windows, genome,
min.score, asPercentage,
cores)
\S4method{patternMatrix}{list,DNAStringSet}(pattern, windows,
min.score, asPercentage,
cores)
\S4method{patternMatrix}{list,GRanges,BSgenome}(pattern, windows, genome,
min.score, asPercentage,
cores)
GRanges
object or DNAStringSet
object
that have equal width of ranges or sequences.BSgenome
objectpatternMatrix
returns scores themselves (default).scoreMatrix
object or a scoreMatrixList
objectpatternMatrix
is based on functions from the seqPattern package:
getPatternOccurrenceList function to find position of pattern that is a character vector in
a list of sequences (a DNAStringSet object)
and adapted function motifScanHits to find pattern that is a PWM matrix
in sequences (a DNAStringSet object).If cores > 1 is provided then for every window occurrence of pattern is counted in paralallel.
ScoreMatrix
, ScoreMatrixList
library(Biostrings)
# consensus sequence of the ctcf motif
motif = "CCGCGNGGNGGCAG"
# Creates 10 random DNA sequences
seqs = sapply(1:10,
function(x) paste(sample(c("A","T","G","C"), 180, replace=TRUE), collapse=""))
windows = DNAStringSet(seqs)
p = patternMatrix(pattern=motif, windows=windows, min.score=0.8)
p
Run the code above in your browser using DataLab