alphabetFrequency {Biostrings} | R Documentation |
This function calculates the frequency of each letter in the (base) alphabet for a biological sequence.
alphabetFrequency(x, baseOnly=FALSE)
x |
A BString, DNAString, RNAString or BStringViews object. |
baseOnly |
TRUE or FALSE .
If TRUE , the returned vector only contains frequencies for the
letters in the "base" alphabet + the gap symbol
i.e. "A", "C", "G", "T" + "-" when x is a DNAString object
(or a BStringViews object with a DNAString subject),
and "U", "G", "C", "A" + "-" when x is a RNAString object
(or a BStringViews object with a RNAString subject).
When x is a BString object (or a BStringViews
object with a BString subject), then the baseOnly
argument is ignored.
|
An integer vector.
If x
is a DNAString or RNAString object
(or a BStringViews object with a DNAString
or RNAString subject), then the returned vector is named
with the letters in the alphabet.
If the baseOnly
argument is TRUE, then the returned vector
has an extra element named 'other'.
If x
is a BStringViews object, then the returned
vector contains the cumulated frequencies found in each view.
BString, DNAString, RNAString, BStringViews
data(yeastSEQCHR1) yeast1 <- DNAString(yeastSEQCHR1) alphabetFrequency(yeast1) alphabetFrequency(yeast1, baseOnly=TRUE)