countPatternInSeqs: Output total number of patterns found in the input sequences

View source: R/countPatternInSeqs.R

countPatternInSeqsR Documentation

Output total number of patterns found in the input sequences

Description

Output total number of patterns found in the input sequences

Usage

countPatternInSeqs(pattern, sequences)

Arguments

pattern

DNAstringSet object

sequences

a vector of sequences

Value

Total number of occurrence of the pattern in the sequences

Author(s)

Lihua Julie Zhu

See Also

summarizePatternInPeaks, translatePattern

Examples

  library(Biostrings)
  filepath = 
    system.file("extdata", "examplePattern.fa", package="ChIPpeakAnno")
  dict = readDNAStringSet(filepath = filepath, format="fasta", 
                          use.names=TRUE)
  sequences = c("ACTGGGGGGGGCCTGGGCCCCCAAAT", 
                "AAAAAACCCCTTTTGGCCATCCCGGGACGGGCCCAT", 
                "ATCGAAAATTTCC")
  countPatternInSeqs(pattern=dict[1], sequences=sequences)
  countPatternInSeqs(pattern=dict[2], sequences=sequences)
  pattern = DNAStringSet("ATNGMAA")
  countPatternInSeqs(pattern=pattern, sequences=sequences)


jianhong/ChIPpeakAnno documentation built on Nov. 1, 2024, 8:55 a.m.