AAString-class {Biostrings}R Documentation

AAString objects

Description

An AAString object allows efficient storage and manipulation of a long amino acid sequence.

Details

The AAString class is a direct XString subtype (with no additional slot). Therefore all functions and methods described in the XString man page also work with an AAString object (inheritance).

Unlike the BString container that allows storage of any single string (based on a single-byte character set) the AAString container can only store a string based on the Amino Acid alphabet (see below).

The Amino Acid alphabet

This alphabet contains all letters from the Single-Letter Amino Acid Code (see ?AMINO_ACID_CODE) + the stop ("*"), the gap ("-") and the hard masking ("+") letters. It is stored in the AA_ALPHABET constant (character vector). The alphabet method also returns AA_ALPHABET when applied to an AAString object and is provided for convenience only.

Constructor-like functions and generics

In the code snippet below, x can be a single string (character vector of length 1) or a BString object.

AAString(x, start=1, nchar=NA, check=TRUE): Tries to convert x into an AAString object by reading nchar letters starting at position start in x.

Accessor methods

In the code snippet below, x is an AAString object.

alphabet(x): If x is an AAString object, then return the Amino Acid alphabet (see above). See the corresponding man pages when x is a BString, DNAString or RNAString object.

Author(s)

H. Pages

See Also

AMINO_ACID_CODE, letter, XString-class, alphabetFrequency

Examples

  AA_ALPHABET
  a <- AAString("MARKSLEMSIR*")
  length(a)
  alphabet(a)

[Package Biostrings version 2.10.22 Index]