yat  0.14.5pre
Public Member Functions | Friends | Related Functions | List of all members
theplu::yat::omic::DNA Class Reference

#include <yat/omic/DNA.h>

Inheritance diagram for theplu::yat::omic::DNA:

Public Member Functions

 DNA (void)
 Default Constructor. More...
 
 DNA (const DNA &)
 Copy Constructor.
 
 DNA (char c)
 
DNA complement (void) const
 
char get (void) const
 
DNAoperator&= (const DNA &rhs)
 
DNAoperator|= (const DNA &rhs)
 
DNAoperator^= (const DNA &rhs)
 
DNAoperator= (char c)
 assign from a char More...
 

Friends

bool operator== (const DNA &, const DNA &)
 

Related Functions

(Note that these are not member functions.)

std::string expand (const DNA &)
 
bool operator== (const DNA &lhs, const DNA &rhs)
 
std::ostream & operator<< (std::ostream &os, const DNA &dna)
 

Detailed Description

Class for DNA e.g. A, C, G, or T. Nucleotides can be overloaded e.g. 'A' | 'G' == 'R'. Null object (opposite to 'N') is denoted by space, ' '.

AA
TT
GG
CC
RG or A
YT or C
MA or C
KG or T
SG or C
WA or T
HA or C or T
BG or T or C
VG or C or A
DG or T or A
NA or C or T or G
' 'none
Since
New in yat 0.7

Constructor & Destructor Documentation

theplu::yat::omic::DNA::DNA ( void  )

Default Constructor.

Equivalent to DNA(' ').

theplu::yat::omic::DNA::DNA ( char  c)
explicit
Parameters
cmust be one of the following 16 characters, A, C, G, T, M, R, W, S, Y, K, B, D, H, V, N, or ' '.
Exceptions
std::invalid_argumentif c is not one of 16 allowed characters

Member Function Documentation

DNA theplu::yat::omic::DNA::complement ( void  ) const

Calculates complement, i.e., 'A' becomes 'T' and 'G' becomes 'C' etc. In case of combination the returned DNA will be the combination of all complements, i.e., 'R' becomes 'Y.

Returns
Complementary base
char theplu::yat::omic::DNA::get ( void  ) const
Returns
DNA as a character
DNA& theplu::yat::omic::DNA::operator&= ( const DNA rhs)

Modifies lhs and keeps those bases present on both sides, i.e., if lhs, for example, is 'R' and rhs is 'M' the overlap is 'A' so resulting lhs will be an 'A'.

As DNA inherits boost::operators<DNA> corresponding operator&(const DNA&, const DNA&) is also available.

DNA& theplu::yat::omic::DNA::operator= ( char  c)

assign from a char

Returns
resulting DNA
Since
New in yat 0.8
DNA& theplu::yat::omic::DNA::operator^= ( const DNA rhs)

Modifies lhs to a combination of bases that are present on one side (not both). If, for example, lhs is 'M' and rhs is 'A', resulting lhs will be 'C'.

As DNA inherits boost::operators<DNA> corresponding operator^(const DNA&, const DNA&) is also available.

DNA& theplu::yat::omic::DNA::operator|= ( const DNA rhs)

Modifies lhs to a combination of bases present on either side. If, for example, lhs is 'A' and rhs is 'C', resuting lhs will be 'M'.

As DNA inherits boost::operators<DNA> corresponding operator|(const DNA&, const DNA&) is also available.

Friends And Related Function Documentation

std::string expand ( const DNA )
related
Returns
a string of combinations of A, C, G, and T.
Since
New in yat 0.7
std::ostream & operator<< ( std::ostream &  os,
const DNA dna 
)
related

Outputs the DNA to os. Equivalent to os << dna.get().

Since
New in yat 0.7
bool operator== ( const DNA lhs,
const DNA rhs 
)
related
Returns
true if bases are the same, i.e., equivalent to lhs.get()==rhs.get()

As DNA is inherits boost::operators<DNA> corresponding operator!=(const DNA&, const DNA&) is also available.

Since
New in yat 0.7

The documentation for this class was generated from the following file:

Generated on Tue Sep 26 2017 02:33:30 for yat by  doxygen 1.8.5