\HeaderA{AAString-class}{AAString objects}{AAString.Rdash.class}
\aliasA{AAString}{AAString-class}{AAString}
\aliasA{AA\_ALPHABET}{AAString-class}{AA.Rul.ALPHABET}
\aliasA{class:AAString}{AAString-class}{class:AAString}
\keyword{methods}{AAString-class}
\keyword{classes}{AAString-class}
\begin{Description}\relax
An AAString object allows efficient storage
and manipulation of a long amino acid sequence.
\end{Description}
\begin{Details}\relax
The AAString class is a direct \LinkA{XString}{XString} subclass
(with no additional slot).
Therefore all functions and methods described in the
\LinkA{XString}{XString} man page also work
with an AAString object (inheritance).

Unlike the \LinkA{BString}{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).
\end{Details}
\begin{Section}{The Amino Acid alphabet}
This alphabet contains all letters from the
Single-Letter Amino Acid Code (see \code{?\LinkA{AMINO\_ACID\_CODE}{AMINO.Rul.ACID.Rul.CODE}})
+ the stop (\code{"*"}), the gap (\code{"-"}) and the hard masking
(\code{"+"}) letters.
It is stored in the \code{AA\_ALPHABET} constant (character vector).
The \code{alphabet} method also returns
\code{AA\_ALPHABET} when applied to an AAString
object and is provided for convenience only.
\end{Section}
\begin{Section}{Constructor-like functions and generics}
In the code snippet below,
\code{x} can be a single string (character vector of length 1)
or a \LinkA{BString}{BString} object.

\describe{
\item[] \code{AAString(x="", start=1, nchar=NA)}:
Tries to convert \code{x} into an AAString object by reading
\code{nchar} letters starting at position \code{start} in \code{x}.

}
\end{Section}
\begin{Section}{Accessor methods}
In the code snippet below, \code{x} is an \LinkA{AAString}{AAString} object.

\describe{
\item[] \code{alphabet(x)}:
If \code{x} is an AAString object, then return the Amino Acid
alphabet (see above).
See the corresponding man pages when \code{x} is a
\LinkA{BString}{BString}, \LinkA{DNAString}{DNAString} or \LinkA{RNAString}{RNAString} object.

}
\end{Section}
\begin{Author}\relax
H. Pages
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{AMINO\_ACID\_CODE}{AMINO.Rul.ACID.Rul.CODE}},
\code{\LinkA{letter}{letter}},
\LinkA{XString-class}{XString.Rdash.class},
\code{\LinkA{alphabetFrequency}{alphabetFrequency}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
  AA_ALPHABET
  a <- AAString("MARKSLEMSIR*")
  length(a)
  alphabet(a)
\end{ExampleCode}
\end{Examples}

