Main Page | Namespace List | Class List | Directories | File List | Namespace Members | Class Members | File Members

seq::Nucleotide Class Reference

A nucleotide, including support for ambiguity codes. More...

#include <Nucleotide.h>

List of all members.

Public Member Functions

 Nucleotide ()
 Create a nucleotide with value Nucleotide::N (any).
 Nucleotide (char c) throw (ParseException)
 Create a nucleotide by parsing a character.
char toChar () const
 Get the uppercase character representation for this nucleotide.
int intRep () const
 Get the internal representation.
bool operator== (const Nucleotide &other) const
 Are two nucleotides identical ?
bool operator!= (const Nucleotide &other) const
 Are two nucleotides different ?
bool isAmbiguity () const
 Is the nucleotide ambiguous ? Only A,C,G,T are considered non-ambiguous.
void sampleAmbiguity ()
 Replace the (ambiguos) nucleotide with a random non-ambigiuos nucleotide that is represented by the ambiguity symbol.
void nonAmbiguousNucleotides (std::vector< Nucleotide > &result) const
 Get all non ambiguous nucleotides represented by this nucleotide.
bool operator< (const Nucleotide other) const
 So that you can use it as a key for STL containers.

Static Public Member Functions

static Nucleotide fromRep (int rep)
 Create a nucleotide using the internal representation directly.

Static Public Attributes

Constants used in the internal representation.
See also:
intRep() and fromRep(int).


static const int NT_A = 0
static const int NT_C = 1
static const int NT_G = 2
static const int NT_T = 3
static const int NT_M = 4
static const int NT_R = 5
static const int NT_W = 6
static const int NT_S = 7
static const int NT_Y = 8
static const int NT_K = 9
static const int NT_V = 10
static const int NT_H = 11
static const int NT_D = 12
static const int NT_B = 13
static const int NT_N = 14
static const int NT_GAP = 15
Nucleotide constants.
static const Nucleotide A
static const Nucleotide C
static const Nucleotide G
static const Nucleotide T
static const Nucleotide M
static const Nucleotide R
static const Nucleotide W
static const Nucleotide S
static const Nucleotide Y
static const Nucleotide K
static const Nucleotide V
static const Nucleotide H
static const Nucleotide D
static const Nucleotide B
static const Nucleotide N
static const Nucleotide GAP


Detailed Description

A nucleotide, including support for ambiguity codes.

The nucleotide is represented internally using an integer representation. This may be helpful for e.g. indexing into a table. Therefore, it is possible to both retrieve this internal representation with intRep() and construct a Nucleotide from an internal representation directly with fromRep(int).


Constructor & Destructor Documentation

seq::Nucleotide::Nucleotide  ) 
 

Create a nucleotide with value Nucleotide::N (any).

seq::Nucleotide::Nucleotide char  c  )  throw (ParseException)
 

Create a nucleotide by parsing a character.

Accepted are the characters from the FASTA file definition.

See also:
toChar()


Member Function Documentation

static Nucleotide seq::Nucleotide::fromRep int  rep  )  [inline, static]
 

Create a nucleotide using the internal representation directly.

Only valid representations are accepted, see the NT_* constants. Illegal representations are fenced off by an assert() statement.

See also:
intRep()

int seq::Nucleotide::intRep  )  const [inline]
 

Get the internal representation.

See also:
fromRep(int)

bool seq::Nucleotide::isAmbiguity  )  const [inline]
 

Is the nucleotide ambiguous ? Only A,C,G,T are considered non-ambiguous.

See also:
sampleAmbiguity()

void seq::Nucleotide::nonAmbiguousNucleotides std::vector< Nucleotide > &  result  )  const
 

Get all non ambiguous nucleotides represented by this nucleotide.

bool seq::Nucleotide::operator!= const Nucleotide other  )  const [inline]
 

Are two nucleotides different ?

bool seq::Nucleotide::operator< const Nucleotide  other  )  const [inline]
 

So that you can use it as a key for STL containers.

bool seq::Nucleotide::operator== const Nucleotide other  )  const [inline]
 

Are two nucleotides identical ?

void seq::Nucleotide::sampleAmbiguity  ) 
 

Replace the (ambiguos) nucleotide with a random non-ambigiuos nucleotide that is represented by the ambiguity symbol.

See also:
isAmbiguity()

char seq::Nucleotide::toChar  )  const [inline]
 

Get the uppercase character representation for this nucleotide.

See also:
Nucleotide(char)


Member Data Documentation

const Nucleotide seq::Nucleotide::A [static]
 

const Nucleotide seq::Nucleotide::B [static]
 

const Nucleotide seq::Nucleotide::C [static]
 

const Nucleotide seq::Nucleotide::D [static]
 

const Nucleotide seq::Nucleotide::G [static]
 

const Nucleotide seq::Nucleotide::GAP [static]
 

const Nucleotide seq::Nucleotide::H [static]
 

const Nucleotide seq::Nucleotide::K [static]
 

const Nucleotide seq::Nucleotide::M [static]
 

const Nucleotide seq::Nucleotide::N [static]
 

const int seq::Nucleotide::NT_A = 0 [static]
 

const int seq::Nucleotide::NT_B = 13 [static]
 

const int seq::Nucleotide::NT_C = 1 [static]
 

const int seq::Nucleotide::NT_D = 12 [static]
 

const int seq::Nucleotide::NT_G = 2 [static]
 

const int seq::Nucleotide::NT_GAP = 15 [static]
 

const int seq::Nucleotide::NT_H = 11 [static]
 

const int seq::Nucleotide::NT_K = 9 [static]
 

const int seq::Nucleotide::NT_M = 4 [static]
 

const int seq::Nucleotide::NT_N = 14 [static]
 

const int seq::Nucleotide::NT_R = 5 [static]
 

const int seq::Nucleotide::NT_S = 7 [static]
 

const int seq::Nucleotide::NT_T = 3 [static]
 

const int seq::Nucleotide::NT_V = 10 [static]
 

const int seq::Nucleotide::NT_W = 6 [static]
 

const int seq::Nucleotide::NT_Y = 8 [static]
 

const Nucleotide seq::Nucleotide::R [static]
 

const Nucleotide seq::Nucleotide::S [static]
 

const Nucleotide seq::Nucleotide::T [static]
 

const Nucleotide seq::Nucleotide::V [static]
 

const Nucleotide seq::Nucleotide::W [static]
 

const Nucleotide seq::Nucleotide::Y [static]
 


The documentation for this class was generated from the following files:
Generated on Fri Jul 14 15:30:43 2006 for libseq by  doxygen 1.4.4