Description Usage Arguments Details Value Examples
View source: R/count_wrapper.R
This function counts the number of motif hits that are found in a given set of DNA sequences.
1 | numMotifHits(seqs, pfm, bg, singlestranded = FALSE)
|
seqs |
A DNAStringSet or DNAString object |
pfm |
An R matrix that represents a position frequency matrix |
bg |
A Background object |
singlestranded |
Boolean that indicates whether a single strand or both strands shall be scanned for motif hits. Default: singlestranded = FALSE. |
Optionally, it can be used to count motif hits on one or both strands, respectively.
A list containing
Number of individual sequences
Vector of individual sequence lengths
Vector of the number of hits in each individual sequence
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # Load sequences
seqfile = system.file("extdata", "seq.fasta", package = "motifcounter")
seqs = Biostrings::readDNAStringSet(seqfile)
# Load background
bg = readBackground(seqs, 1)
# Load motif
motiffile = system.file("extdata", "x31.tab", package = "motifcounter")
motif = t(as.matrix(read.table(motiffile)))
# Count motif hits both strands
noc = motifcounter:::numMotifHits(seqs, motif, bg)
noc$numofhits
# Count motif hits on a single strand
noc = motifcounter:::numMotifHits(seqs, motif, bg, singlestranded = TRUE)
noc$numofhits
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.