#include <Monomer.hh>
Collaboration diagram for RazorBack::Monomer_:
Public Types | |
typedef vector<Abbrev_>::const_iterator | Aciter_ |
iterator shorthand. | |
enum | Type_ { UNKNOWN = 0, USER = 1, PROT = 2, DNA = 4, RNA = 8, NUCL = 12 } |
Type_: symbolic constants for a few popular monomer types. More... | |
Public Methods | |
Monomer_ (int Mt=PROT) | |
Inits to hold the alphabet for some predefined type. More... | |
Monomer_ (const char *Codes) | |
Inits to hold the user-defined alphabet Codes. More... | |
void | set_alphabet (int Mt) |
set_alphabet(Mt): sets the alphabet to one of the predefined monomer types as indicated by Mt. More... | |
void | set_alphabet (const char *Codes) |
set_alphabet(Codes): sets the alphabet to contain the abbreviations listed in Codes. More... | |
const vector<Abbrev_>& | alphabet () const |
alphabet(): only const manipulations with the monomer list. | |
Type_ | type () const |
type(): only const access. | |
bool | operator== (const Monomer_ &M) const |
==: two monomer objects are considered equal either if both are of type USER and their alphabets are the same, or if they have the same type. More... | |
bool | operator!= (const Monomer_ &M) const |
bool | contains (const Monomer_ &M, bool Nocase) const |
contains(M, Nocase): returns true if all the monomers in M can be found in the calling object, false otherwise. | |
Aciter_ | find (char C, bool Nocase=false) const |
find(C, Nocase), find(Ccc, Nocase): tries to find the 1-letter (C) or 3-letter (Ccc) abbreviation in the calling object. More... | |
Aciter_ | find (const char *Ccc, bool Nocase=false) const |
bool | is_legal (char C, bool Nocase=false) const |
is_legal(C, Nocase), is_legal(Ccc, Nocase): return true if C or Ccc are "legal" abbreviations of a monomer. More... | |
bool | is_legal (const char *Ccc, bool Nocase=false) const |
const char* | one_2_three (char C, bool Nocase=false) const |
one_2_three(C, Nocase): returns the 3-letter abbrev. More... | |
char | three_2_one (const char *Ccc, bool Nocase=false) const |
three_2_one(Ccc, Nocase): the inverse of one_2_three(C, Nocase). More... | |
Private Attributes | |
vector<Abbrev_> | Alphabet |
all legal monomer types. | |
Type_ | Mtype |
symbolic const for monomer types. |
Amino acids and nucleotides are conveniently predefined.
Definition at line 33 of file Monomer.hh.
|
iterator shorthand.
Definition at line 111 of file Monomer.hh. |
|
Type_: symbolic constants for a few popular monomer types. Here is the list of the accepted 1-letter symbols, first the unambiguous codes, then the allowed ambiguous codes:- PROT=ACDEFGHIKLMNPQRSTVWY, B=(D|N), Z=(E|Q), X=any, *=end DNA=ACGT, R=(A|G), Y=(C|T), (N|X)=any RNA=ACGU, R=(A|G), Y=(C|U), (N|X)=any NUCL=ACGTU, R=(A|G), Y=(C|T|U), (N|X)=any USER is user-defined, NUCL==DNA|RNA. Some routines may depend on UNKNOWN==0: do not change! Definition at line 100 of file Monomer.hh. |
|
Inits to hold the alphabet for some predefined type. USER is illegal here, PROT (the default) will be used instead. Definition at line 119 of file Monomer.hh. |
|
Inits to hold the user-defined alphabet Codes. For the Codes string format, see set_alphabet(Codes). Definition at line 130 of file Monomer.hh. |
|
set_alphabet(Mt): sets the alphabet to one of the predefined monomer types as indicated by Mt. If Mt==USER or UNKNOWN, no action is taken and a warning is printed. Referenced by Monomer_(). |
|
set_alphabet(Codes): sets the alphabet to contain the abbreviations listed in Codes. The format of Codes: 4 chars per monomer type, first the 1-letter code, then the 3-letter code like "AAlaBAsxCCys...". Nothing is done and warnings are printed if Codes is NULL, empty string or its length is not a multiple of 4. On success, the Mtype of the calling object is set to USER. |
|
alphabet(): only const manipulations with the monomer list.
Definition at line 156 of file Monomer.hh. |
|
type(): only const access.
Definition at line 159 of file Monomer.hh. |
|
==: two monomer objects are considered equal either if both are of type USER and their alphabets are the same, or if they have the same type. In particular, NUCL and RNA or NUCL and DNA are not equal. |
|
Definition at line 168 of file Monomer.hh. |
|
contains(M, Nocase): returns true if all the monomers in M can be found in the calling object, false otherwise.
|
|
find(C, Nocase), find(Ccc, Nocase): tries to find the 1-letter (C) or 3-letter (Ccc) abbreviation in the calling object. If Nocase==true, then a case-insensitive match is enough. Returns a const iterator to the abbreviation if found, or Alphabet.end() if not found. Referenced by is_legal(), one_2_three(), and three_2_one(). |
|
|
|
is_legal(C, Nocase), is_legal(Ccc, Nocase): return true if C or Ccc are "legal" abbreviations of a monomer. If Nocase==true, then a case-insensitive match is enough. Definition at line 193 of file Monomer.hh. |
|
Definition at line 197 of file Monomer.hh. |
|
one_2_three(C, Nocase): returns the 3-letter abbrev. corresponding to C if C is legal depending on Nocase (when true, then case-insensitive match is OK), or NULL if C is illegal. Definition at line 208 of file Monomer.hh. |
|
three_2_one(Ccc, Nocase): the inverse of one_2_three(C, Nocase). Returns '\0' if Ccc is illegal. Definition at line 219 of file Monomer.hh. |
|
all legal monomer types.
Definition at line 104 of file Monomer.hh. |
|
symbolic const for monomer types.
Definition at line 105 of file Monomer.hh. |