scoreStrand {motifcounter} | R Documentation |
This function computes the per-position score in a given DNA strand.
scoreStrand(seq, pfm, bg)
seq |
A DNAString object |
pfm |
An R matrix that represents a position frequency matrix |
bg |
A Background object |
The function returns the per-position scores for the given strand. If the sequence is too short, it contains an empty vector.
Vector of scores on the given strand
# 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))) # Compute the per-position and per-strand scores motifcounter:::scoreStrand(seqs[[1]], motif, bg)