Egglib 2.1.11
C++ library reference manual
Classes | Public Member Functions | List of all members
Consensus Class Reference

Generates consensus sequences. More...

#include <Consensus.hpp>

Public Member Functions

 Consensus ()
 Constructor. More...
 
virtual ~Consensus ()
 Destructor. More...
 
void setMissing (char)
 Sets the character interpreted as missing (default: ?)
 
void setDisagreement (char)
 Sets the character used to point to disagreements (default: Z)
 
bool check_sequences (Align &align)
 Checks all the characters.
 
Align consensus (Align &align, char separator='_', bool rigorous=true)
 Reduces the sequence alignment by making consensus sequences. More...
 
const std::vector< std::string > & firstSequenceNames ()
 First name of consensed pairs.
 
const std::vector< std::string > & secondSequenceNames ()
 Second names of consensed pairs.
 
const std::vector< std::string > & roots ()
 Root names of consensed pairs.
 
const std::vector< int > & consistentPositions ()
 Number of consistent positions for all consensed pairs.
 
const std::vector< int > & complementaryPositions ()
 Number of complementary positions for all consensed pairs.
 
const std::vector< int > & uninformativePositions ()
 Number of uninformative positions for all consensed pairs.
 
const std::vector< int > & ambiguousPositions ()
 Number of ambiguous positions for all consensed pairs.
 
const std::vector< int > & atLeastPartiallyResolvedAmbiguities ()
 Number of at least partially resolved ambiguities for all consensed pairs.
 
const std::vector< std::vector< int > > & inconsistentPositions ()
 Vector of inconsistent positions ofr all consensed pairs.
 

Detailed Description

Generates consensus sequences.

A consensus is generated when two sequences have the same name, ignoring everything after the first separator character (by default, "_"). Hence, the names "foo", "foo_goo" and "foo_third" will be treated as identical and the root will be "foo". The root will be used to name the resulting sequence. Note that the class works only for DNA sequences.

Symbol convention:

Other symbols will be treated as ? (lowercase are supported).

Rigorous (alias liberal or strong) mode:

Otherwise:

Note that the feedback of inconsistent characters in the outcome is not garanteed. In fact, (A + A + G) will result in R (as expected) but (A + G + A) will result in A, masking the problem. However, the position will indeed be counted as inconsistent.

Not rigorous (conservative/weak) mode:

Iterative process of consensus:

A transparent interface gives access to the data for all steps of the consensus process, as vectors that covers all pairs (including intermediate steps of the iterative procedure described above) as well as singleton sequences. For the latter, the second name is not filled and all counts are set to 0. Note also that the name of such singleton sequence is shortened to the separator as well.

Constructor & Destructor Documentation

Consensus ( )

Constructor.

virtual ~Consensus ( )
inlinevirtual

Destructor.

Member Function Documentation

Align consensus ( Align align,
char  separator = '_',
bool  rigorous = true 
)

Reduces the sequence alignment by making consensus sequences.

Parameters
alignthe original alignment.
separatorthe character used to separated the root name of sequences to the variable part, as in (for the default value: "sequence_read1".
rigorousconsensus mode.
Returns
An Align instance with duplicated sequences consensed.

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

Hosted by 
Get EggLib at SourceForge.net. Fast, secure and Free Open Source software downloads