AAString-class {Biostrings} | R Documentation |
A AAString
object allows efficient storage
and manipulation of a long amino acid sequence.
The AAString
class derives directly from the
BString
class (with no additional slot).
All functions and methods described in the
BString
man page also work
with a AAString
object (inheritance).
Unlike a BString
object that allows storage
of any non-empty string (based on a single-byte character set)
a AAString
object can only store a non-empty string
based on the AAString alphabet (see below).
This alphabet contains all letters from the
Single-Letter Amino Acid Code (see AMINO_ACID_CODE
)
+ the stop letter "*"
.
It is stored in the AA_ALPHABET
constant (character vector).
The alphabet
method also returns
AA_ALPHABET
when applied to a AAString
object and is provided for convenience only.
In the code snippet below,
src
can be a character vector
or a BString
(or derived) object.
AAString(src)
:
Tries to convert src
into an AAString
object.
src
can be a single string (character vector of length 1)
or a BString object.
In the code snippets below,
x
must be a BString
(or derived) object.
alphabet(x)
:
If x
is of class AAString
, return the AAString
alphabet (see above).
See the corresponding man pages when x
is of class
BString
, DNAString
or RNAString
.
H. Pages
AMINO_ACID_CODE
,
subBString
,
letter
,
BString-class,
BStringViews-class
AA_ALPHABET a <- AAString("MARKSLEMSIR*") length(a) alphabet(a)