Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

RazorBack::Monomer_ Class Reference

Monomer_ : stores the legal 1- and 3-letter abbreviations for biomolecule monomers. More...

#include <Monomer.hh>

Collaboration diagram for RazorBack::Monomer_:

Collaboration graph
[legend]
List of all members.

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.


Detailed Description

Monomer_ : stores the legal 1- and 3-letter abbreviations for biomolecule monomers.

Amino acids and nucleotides are conveniently predefined.

Definition at line 33 of file Monomer.hh.


Member Typedef Documentation

typedef vector< Abbrev_ >::const_iterator RazorBack::Monomer_::Aciter_
 

iterator shorthand.

Definition at line 111 of file Monomer.hh.


Member Enumeration Documentation

enum RazorBack::Monomer_::Type_
 

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!

Enumeration values:
UNKNOWN  
USER  
PROT  
DNA  
RNA  
NUCL  

Definition at line 100 of file Monomer.hh.


Constructor & Destructor Documentation

RazorBack::Monomer_::Monomer_ ( int Mt = PROT ) [inline, explicit]
 

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.

RazorBack::Monomer_::Monomer_ ( const char * Codes ) [inline, explicit]
 

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.


Member Function Documentation

void RazorBack::Monomer_::set_alphabet ( int Mt )
 

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_().

void RazorBack::Monomer_::set_alphabet ( const char * Codes )
 

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.

const vector< Abbrev_ > & RazorBack::Monomer_::alphabet ( ) const [inline]
 

alphabet(): only const manipulations with the monomer list.

Definition at line 156 of file Monomer.hh.

Type_ RazorBack::Monomer_::type ( ) const [inline]
 

type(): only const access.

Definition at line 159 of file Monomer.hh.

bool RazorBack::Monomer_::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.

In particular, NUCL and RNA or NUCL and DNA are not equal.

bool RazorBack::Monomer_::operator!= ( const Monomer_ & M ) const [inline]
 

Definition at line 168 of file Monomer.hh.

bool RazorBack::Monomer_::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_ RazorBack::Monomer_::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.

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().

Aciter_ RazorBack::Monomer_::find ( const char * Ccc,
bool Nocase = false ) const
 

bool RazorBack::Monomer_::is_legal ( char C,
bool Nocase = false ) const [inline]
 

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.

bool RazorBack::Monomer_::is_legal ( const char * Ccc,
bool Nocase = false ) const [inline]
 

Definition at line 197 of file Monomer.hh.

const char * RazorBack::Monomer_::one_2_three ( char C,
bool Nocase = false ) const [inline]
 

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.

char RazorBack::Monomer_::three_2_one ( const char * Ccc,
bool Nocase = false ) const [inline]
 

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.


Member Data Documentation

vector< Abbrev_ > RazorBack::Monomer_::Alphabet<Abbrev_> [private]
 

all legal monomer types.

Definition at line 104 of file Monomer.hh.

Type_ RazorBack::Monomer_::Mtype [private]
 

symbolic const for monomer types.

Definition at line 105 of file Monomer.hh.


The documentation for this class was generated from the following file:
Generated at Wed Aug 21 09:33:45 2002 for The Razorback C++ Library: Bioinformatics by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001