mems::CompactGappedAlignment< BaseType > Class Template Reference

The CompactGappedAlignment stores a gapped alignment as a bit-vector Rather than using one byte per aligned position, this class uses one bit, making particularly space efficient. More...

#include <CompactGappedAlignment.h>

List of all members.

Public Member Functions

CompactGappedAlignmentClone () const
template<class MatchType>  CompactGappedAlignment (MatchType &m)
 CompactGappedAlignment (std::vector< bitset_t > &aln_mat, gnSeqI alignment_length)
 CompactGappedAlignment (uint seq_count, gnSeqI align_length)
 CompactGappedAlignment ()
void CondenseGapColumns ()
 Eliminates any columns that contain only gap characters.

CompactGappedAlignmentCopy () const
void copyRange (CompactGappedAlignment &dest, gnSeqI left_column, gnSeqI length)
virtual void CropEnd (gnSeqI crop_amount)
virtual void CropLeft (gnSeqI crop_amount, uint seqI)
virtual void CropRight (gnSeqI crop_amount, uint seqI)
virtual void CropStart (gnSeqI crop_amount)
virtual void Free ()
const std::vector< bitset_t > & GetAlignment () const
 allows a peek at the data inside this alignment.

void GetAlignment (std::vector< bitset_t > &align_matrix) const
void GetColumn (gnSeqI col, std::vector< gnSeqI > &pos, std::vector< bool > &column) const
virtual void Invert ()
virtual bool IsGap (uint seq, gnSeqI col) const
 returns true if the given row,column of the alignment has a gap character

gnSeqI SeqPosToColumn (uint seq, int64 pos)
void SetAlignment (std::vector< bitset_t > &seq_align)
void SetAlignment (const std::vector< std::string > &seq_align)
void swap (CompactGappedAlignment &other)
void translate (CompactGappedAlignment &cga, uint cga_seq, uint my_seq, bool add_bits=true)
 translate a cga to a new coordinate system

bool validate () const
bool validate_bitcount () const

Protected Member Functions

void create_bitcount ()
gnSeqI SeqPosToColumn (gnSeqI pos, const bitset_t &bvec, const std::vector< size_t > &index) const
void swap (CompactGappedAlignment *other)

Protected Attributes

std::vector< bitset_talign_matrix
 aligned positions have true values, gaps are false

std::vector< std::vector<
size_t > > 
bcount


Detailed Description

template<class BaseType = AbstractGappedAlignment< HybridAbstractMatch<> >>
class mems::CompactGappedAlignment< BaseType >

The CompactGappedAlignment stores a gapped alignment as a bit-vector Rather than using one byte per aligned position, this class uses one bit, making particularly space efficient.

Definition at line 38 of file CompactGappedAlignment.h.


Constructor & Destructor Documentation

template<class BaseType = AbstractGappedAlignment< HybridAbstractMatch<> >>
mems::CompactGappedAlignment< BaseType >::CompactGappedAlignment  )  [inline]
 

Definition at line 41 of file CompactGappedAlignment.h.

Referenced by mems::CompactGappedAlignment< BaseType >::Clone(), and mems::CompactGappedAlignment< BaseType >::copyRange().

template<class BaseType>
mems::CompactGappedAlignment< BaseType >::CompactGappedAlignment uint  seq_count,
gnSeqI  align_length
 

Definition at line 216 of file CompactGappedAlignment.h.

References uint.

template<class BaseType>
mems::CompactGappedAlignment< BaseType >::CompactGappedAlignment std::vector< bitset_t > &  aln_mat,
gnSeqI  alignment_length
 

Definition at line 206 of file CompactGappedAlignment.h.

References mems::CompactGappedAlignment< BaseType >::create_bitcount(), and mems::CompactGappedAlignment< BaseType >::validate_bitcount().

template<class BaseType = AbstractGappedAlignment< HybridAbstractMatch<> >>
template<class MatchType>
mems::CompactGappedAlignment< BaseType >::CompactGappedAlignment MatchType &  m  )  [inline]
 

Definition at line 46 of file CompactGappedAlignment.h.

References mems::CompactGappedAlignment< BaseType >::align_matrix, mems::CompactGappedAlignment< BaseType >::bcount, mems::CompactGappedAlignment< BaseType >::create_bitcount(), uint, and mems::CompactGappedAlignment< BaseType >::validate().


Member Function Documentation

template<class BaseType = AbstractGappedAlignment< HybridAbstractMatch<> >>
CompactGappedAlignment* mems::CompactGappedAlignment< BaseType >::Clone  )  const [inline]
 

Definition at line 67 of file CompactGappedAlignment.h.

References mems::CompactGappedAlignment< BaseType >::CompactGappedAlignment().

template<class BaseType>
void mems::CompactGappedAlignment< BaseType >::CondenseGapColumns  ) 
 

Eliminates any columns that contain only gap characters.

Definition at line 772 of file CompactGappedAlignment.h.

References mems::CompactGappedAlignment< BaseType >::align_matrix, and mems::CompactGappedAlignment< BaseType >::create_bitcount().

Referenced by mems::unalignIslands().

template<class BaseType>
CompactGappedAlignment< BaseType > * mems::CompactGappedAlignment< BaseType >::Copy  )  const
 

Definition at line 127 of file CompactGappedAlignment.h.

References mems::m_allocateAndCopy().

Referenced by mems::ProgressiveAligner::constructLcbTrackingMatches(), mems::ProgressiveAligner::ConstructSuperIntervalFromMSA(), mems::detectAndApplyBackbone(), mems::ProgressiveAligner::extractAlignment(), mems::HssArrayToCga(), mems::makeAllPairwiseGenomeHSS(), mems::ProgressiveAligner::translateGappedCoordinates(), and mems::unalignIslands().

template<class BaseType>
void mems::CompactGappedAlignment< BaseType >::copyRange CompactGappedAlignment< BaseType > &  dest,
gnSeqI  left_column,
gnSeqI  length
 

Definition at line 675 of file CompactGappedAlignment.h.

References mems::CompactGappedAlignment< BaseType >::align_matrix, mems::bitset_t, mems::CompactGappedAlignment< BaseType >::CompactGappedAlignment(), mems::CompactGappedAlignment< BaseType >::create_bitcount(), mems::CompactGappedAlignment< BaseType >::GetColumn(), mems::CompactGappedAlignment< BaseType >::SetAlignment(), uint, and mems::CompactGappedAlignment< BaseType >::validate().

Referenced by mems::ProgressiveAligner::constructLcbTrackingMatches(), and mems::HssArrayToCga().

template<class BaseType>
void mems::CompactGappedAlignment< BaseType >::create_bitcount  )  [protected]
 

Definition at line 273 of file CompactGappedAlignment.h.

References mems::CompactGappedAlignment< BaseType >::align_matrix, mems::CompactGappedAlignment< BaseType >::bcount, mems::bitset_t, mems::INDEX_INTERVAL, and uint.

Referenced by mems::CompactGappedAlignment< BaseType >::CompactGappedAlignment(), mems::CompactGappedAlignment< BaseType >::CondenseGapColumns(), mems::CompactGappedAlignment< BaseType >::copyRange(), mems::CompactGappedAlignment< BaseType >::CropEnd(), mems::CompactGappedAlignment< BaseType >::CropStart(), mems::CompactGappedAlignment< BaseType >::Invert(), mems::CompactGappedAlignment< BaseType >::SetAlignment(), and mems::CompactGappedAlignment< BaseType >::translate().

template<class BaseType>
void mems::CompactGappedAlignment< BaseType >::CropEnd gnSeqI  crop_amount  )  [virtual]
 

Definition at line 537 of file CompactGappedAlignment.h.

References mems::CompactGappedAlignment< BaseType >::align_matrix, mems::CompactGappedAlignment< BaseType >::create_bitcount(), mems::CompactGappedAlignment< BaseType >::GetColumn(), uint, and mems::CompactGappedAlignment< BaseType >::validate().

Referenced by mems::CompactGappedAlignment< BaseType >::CropLeft(), and mems::CompactGappedAlignment< BaseType >::CropRight().

template<class BaseType>
void mems::CompactGappedAlignment< BaseType >::CropLeft gnSeqI  crop_amount,
uint  seqI
[virtual]
 

Definition at line 582 of file CompactGappedAlignment.h.

References mems::CompactGappedAlignment< BaseType >::align_matrix, mems::CompactGappedAlignment< BaseType >::bcount, mems::CompactGappedAlignment< BaseType >::CropEnd(), mems::CompactGappedAlignment< BaseType >::CropStart(), mems::CompactGappedAlignment< BaseType >::SeqPosToColumn(), uint, and mems::CompactGappedAlignment< BaseType >::validate().

template<class BaseType>
void mems::CompactGappedAlignment< BaseType >::CropRight gnSeqI  crop_amount,
uint  seqI
[virtual]
 

Definition at line 614 of file CompactGappedAlignment.h.

References mems::CompactGappedAlignment< BaseType >::align_matrix, mems::CompactGappedAlignment< BaseType >::bcount, mems::CompactGappedAlignment< BaseType >::CropEnd(), mems::CompactGappedAlignment< BaseType >::CropStart(), mems::CompactGappedAlignment< BaseType >::SeqPosToColumn(), uint, and mems::CompactGappedAlignment< BaseType >::validate().

template<class BaseType>
void mems::CompactGappedAlignment< BaseType >::CropStart gnSeqI  crop_amount  )  [virtual]
 

Definition at line 485 of file CompactGappedAlignment.h.

References mems::CompactGappedAlignment< BaseType >::align_matrix, mems::CompactGappedAlignment< BaseType >::create_bitcount(), mems::CompactGappedAlignment< BaseType >::GetColumn(), uint, and mems::CompactGappedAlignment< BaseType >::validate().

Referenced by mems::CompactGappedAlignment< BaseType >::CropLeft(), and mems::CompactGappedAlignment< BaseType >::CropRight().

template<class BaseType>
void mems::CompactGappedAlignment< BaseType >::Free  )  [virtual]
 

Definition at line 133 of file CompactGappedAlignment.h.

References mems::m_free().

Referenced by mems::ProgressiveAligner::extractAlignment(), mems::HssArrayToCga(), and mems::ProgressiveAligner::translateGappedCoordinates().

template<class BaseType = AbstractGappedAlignment< HybridAbstractMatch<> >>
const std::vector< bitset_t >& mems::CompactGappedAlignment< BaseType >::GetAlignment  )  const [inline]
 

allows a peek at the data inside this alignment.

don't change it or the CompactGappedAlignment will become corrupt

Definition at line 86 of file CompactGappedAlignment.h.

References mems::CompactGappedAlignment< BaseType >::align_matrix.

template<class BaseType>
void mems::CompactGappedAlignment< BaseType >::GetAlignment std::vector< bitset_t > &  align_matrix  )  const
 

Definition at line 259 of file CompactGappedAlignment.h.

Referenced by mems::ProgressiveAligner::constructLcbTrackingMatches(), and mems::ProgressiveAligner::extractAlignment().

template<class BaseType>
void mems::CompactGappedAlignment< BaseType >::GetColumn gnSeqI  col,
std::vector< gnSeqI > &  pos,
std::vector< bool > &  column
const
 

Definition at line 649 of file CompactGappedAlignment.h.

References mems::CompactGappedAlignment< BaseType >::align_matrix, mems::CompactGappedAlignment< BaseType >::bcount, mems::INDEX_INTERVAL, and uint.

Referenced by mems::CompactGappedAlignment< BaseType >::copyRange(), mems::CompactGappedAlignment< BaseType >::CropEnd(), mems::CompactGappedAlignment< BaseType >::CropStart(), and mems::writeBackboneSeqCoordinates().

template<class BaseType>
void mems::CompactGappedAlignment< BaseType >::Invert  )  [virtual]
 

Definition at line 464 of file CompactGappedAlignment.h.

References mems::CompactGappedAlignment< BaseType >::align_matrix, mems::bitset_t, mems::CompactGappedAlignment< BaseType >::create_bitcount(), uint, and mems::CompactGappedAlignment< BaseType >::validate().

Referenced by mems::ProgressiveAligner::constructLcbTrackingMatches(), and mems::ProgressiveAligner::ConstructSuperIntervalFromMSA().

template<class BaseType>
bool mems::CompactGappedAlignment< BaseType >::IsGap uint  seq,
gnSeqI  col
const [virtual]
 

returns true if the given row,column of the alignment has a gap character

Definition at line 265 of file CompactGappedAlignment.h.

References mems::CompactGappedAlignment< BaseType >::align_matrix, and uint.

template<class BaseType>
gnSeqI mems::CompactGappedAlignment< BaseType >::SeqPosToColumn gnSeqI  pos,
const bitset_t bvec,
const std::vector< size_t > &  index
const [protected]
 

Definition at line 331 of file CompactGappedAlignment.h.

References mems::bitset_t, and mems::INDEX_INTERVAL.

template<class BaseType>
gnSeqI mems::CompactGappedAlignment< BaseType >::SeqPosToColumn uint  seq,
int64  pos
 

Definition at line 321 of file CompactGappedAlignment.h.

References mems::CompactGappedAlignment< BaseType >::align_matrix, mems::CompactGappedAlignment< BaseType >::bcount, and uint.

Referenced by mems::CompactGappedAlignment< BaseType >::CropLeft(), mems::CompactGappedAlignment< BaseType >::CropRight(), and mems::CompactGappedAlignment< BaseType >::translate().

template<class BaseType>
void mems::CompactGappedAlignment< BaseType >::SetAlignment std::vector< bitset_t > &  seq_align  ) 
 

Definition at line 245 of file CompactGappedAlignment.h.

References mems::CompactGappedAlignment< BaseType >::align_matrix, mems::CompactGappedAlignment< BaseType >::bcount, mems::CompactGappedAlignment< BaseType >::create_bitcount(), std::swap(), and mems::CompactGappedAlignment< BaseType >::validate_bitcount().

template<class BaseType>
void mems::CompactGappedAlignment< BaseType >::SetAlignment const std::vector< std::string > &  seq_align  ) 
 

Definition at line 222 of file CompactGappedAlignment.h.

References mems::CompactGappedAlignment< BaseType >::align_matrix, mems::CompactGappedAlignment< BaseType >::bcount, mems::bitset_t, and mems::CompactGappedAlignment< BaseType >::create_bitcount().

Referenced by mems::ProgressiveAligner::constructLcbTrackingMatches(), mems::ProgressiveAligner::ConstructSuperIntervalFromMSA(), mems::CompactGappedAlignment< BaseType >::copyRange(), mems::ProgressiveAligner::extractAlignment(), and mems::GenericIntervalList< MatchType >::ReadStandardAlignmentCompact().

template<class BaseType = AbstractGappedAlignment< HybridAbstractMatch<> >>
void mems::CompactGappedAlignment< BaseType >::swap CompactGappedAlignment< BaseType > *  other  )  [inline, protected]
 

Definition at line 110 of file CompactGappedAlignment.h.

References mems::CompactGappedAlignment< BaseType >::align_matrix, mems::CompactGappedAlignment< BaseType >::bcount, and std::swap().

template<class BaseType = AbstractGappedAlignment< HybridAbstractMatch<> >>
void mems::CompactGappedAlignment< BaseType >::swap CompactGappedAlignment< BaseType > &  other  )  [inline]
 

Definition at line 106 of file CompactGappedAlignment.h.

Referenced by std::swap().

template<class BaseType>
void mems::CompactGappedAlignment< BaseType >::translate CompactGappedAlignment< BaseType > &  cga,
uint  cga_seq,
uint  my_seq,
bool  add_bits = true
 

translate a cga to a new coordinate system

Definition at line 348 of file CompactGappedAlignment.h.

References mems::CompactGappedAlignment< BaseType >::align_matrix, mems::CompactGappedAlignment< BaseType >::bcount, mems::bitset_t, mems::CompactGappedAlignment< BaseType >::create_bitcount(), mems::CompactGappedAlignment< BaseType >::SeqPosToColumn(), uint, and mems::CompactGappedAlignment< BaseType >::validate().

Referenced by mems::ProgressiveAligner::constructLcbTrackingMatches(), and mems::ProgressiveAligner::translateGappedCoordinates().

template<class BaseType>
bool mems::CompactGappedAlignment< BaseType >::validate  )  const
 

Definition at line 139 of file CompactGappedAlignment.h.

References mems::CompactGappedAlignment< BaseType >::align_matrix, mems::debug_cga, uint, and mems::CompactGappedAlignment< BaseType >::validate_bitcount().

Referenced by mems::CompactGappedAlignment< BaseType >::CompactGappedAlignment(), mems::CompactGappedAlignment< BaseType >::copyRange(), mems::CompactGappedAlignment< BaseType >::CropEnd(), mems::CompactGappedAlignment< BaseType >::CropLeft(), mems::CompactGappedAlignment< BaseType >::CropRight(), mems::CompactGappedAlignment< BaseType >::CropStart(), mems::ProgressiveAligner::FixLeftEnds(), mems::CompactGappedAlignment< BaseType >::Invert(), and mems::CompactGappedAlignment< BaseType >::translate().

template<class BaseType>
bool mems::CompactGappedAlignment< BaseType >::validate_bitcount  )  const
 

Definition at line 294 of file CompactGappedAlignment.h.

References mems::CompactGappedAlignment< BaseType >::align_matrix, mems::CompactGappedAlignment< BaseType >::bcount, mems::debug_cga, mems::INDEX_INTERVAL, and uint.

Referenced by mems::CompactGappedAlignment< BaseType >::CompactGappedAlignment(), mems::CompactGappedAlignment< BaseType >::SetAlignment(), and mems::CompactGappedAlignment< BaseType >::validate().


Member Data Documentation

template<class BaseType = AbstractGappedAlignment< HybridAbstractMatch<> >>
std::vector< bitset_t > mems::CompactGappedAlignment< BaseType >::align_matrix [protected]
 

aligned positions have true values, gaps are false

Definition at line 116 of file CompactGappedAlignment.h.

Referenced by mems::CompactGappedAlignment< BaseType >::CompactGappedAlignment(), mems::CompactGappedAlignment< BaseType >::CondenseGapColumns(), mems::CompactGappedAlignment< BaseType >::copyRange(), mems::CompactGappedAlignment< BaseType >::create_bitcount(), mems::CompactGappedAlignment< BaseType >::CropEnd(), mems::CompactGappedAlignment< BaseType >::CropLeft(), mems::CompactGappedAlignment< BaseType >::CropRight(), mems::CompactGappedAlignment< BaseType >::CropStart(), mems::CompactGappedAlignment< BaseType >::GetAlignment(), mems::CompactGappedAlignment< BaseType >::GetColumn(), mems::CompactGappedAlignment< BaseType >::Invert(), mems::CompactGappedAlignment< BaseType >::IsGap(), mems::CompactGappedAlignment< BaseType >::SeqPosToColumn(), mems::CompactGappedAlignment< BaseType >::SetAlignment(), mems::CompactGappedAlignment< BaseType >::swap(), mems::CompactGappedAlignment< BaseType >::translate(), mems::CompactGappedAlignment< BaseType >::validate(), and mems::CompactGappedAlignment< BaseType >::validate_bitcount().

template<class BaseType = AbstractGappedAlignment< HybridAbstractMatch<> >>
std::vector< std::vector< size_t > > mems::CompactGappedAlignment< BaseType >::bcount [protected]
 

Definition at line 117 of file CompactGappedAlignment.h.

Referenced by mems::CompactGappedAlignment< BaseType >::CompactGappedAlignment(), mems::CompactGappedAlignment< BaseType >::create_bitcount(), mems::CompactGappedAlignment< BaseType >::CropLeft(), mems::CompactGappedAlignment< BaseType >::CropRight(), mems::CompactGappedAlignment< BaseType >::GetColumn(), mems::CompactGappedAlignment< BaseType >::SeqPosToColumn(), mems::CompactGappedAlignment< BaseType >::SetAlignment(), mems::CompactGappedAlignment< BaseType >::swap(), mems::CompactGappedAlignment< BaseType >::translate(), and mems::CompactGappedAlignment< BaseType >::validate_bitcount().


The documentation for this class was generated from the following file:
Generated on Fri Mar 14 06:01:39 2008 for libMems by doxygen 1.3.6