alphabetFrequency {Biostrings}R Documentation

function to calculate the frequency of letters in a biological sequence

Description

Given an object of class "BioString" representing a biological sequence, this function calculates the frequency of each letter in the (base) alphabet for the "BioString" object.

Usage

alphabetFrequency(x, baseOnly = TRUE)

Arguments

x An object of class "BioString".
baseOnly A logical value. If TRUE, the frequency table only contains the letters in the base alphabet for x.

Value

An integer vector with names same as the letters in the alphabet. If the base alphabet is used for the frequency counts, there is an extra element with name 'Others' and it is the number of letters in the string which are not in the base alphabet. Usually, a non-zero entry here means that the string contains some letters from a pattern alphabet.

Author(s)

Saikat DebRoy

See Also

BioString-class, BioAlphabet-class, BioPatternAlphabet-class

Examples

data(yeastSEQCHR1)
yeast1 <- DNAString(yeastSEQCHR1)
alphabetFrequency(yeast1)
alphabetFrequency(yeast1, baseOnly=FALSE)

[Package Biostrings version 1.4.0 Index]