mems::MatchProjectionAdapter Class Reference

MatchProjectionAdapter is a wrapper around an AbstractMatch that effectively projects a multi-match to a subset match. More...

#include <MatchProjectionAdapter.h>

Inheritance diagram for mems::MatchProjectionAdapter:

Inheritance graph
[legend]
Collaboration diagram for mems::MatchProjectionAdapter:

Collaboration graph
[legend]
List of all members.

Public Member Functions

gnSeqI AlignmentLength () const
 Returns the total length of this alignment in columns.

MatchProjectionAdapterClone () const
MatchProjectionAdapterCopy () const
 creates a copy of this using a boost::pool::fast_pool_allocator

void CropEnd (gnSeqI crop_amount)
 Deprecated: Use CropLeft and CropRight instead Removes the last crop_amount base pairs from the end of the match.

void CropLeft (gnSeqI crop_amount, uint seqI)
 Crop this match from the left Removes the first crop_amount positions from the left side of the match.

void CropRight (gnSeqI crop_amount, uint seqI)
 Crop this match from the right Removes the last crop_amount positions from the right side of the match.

void CropStart (gnSeqI crop_amount)
 Deprecated: Use CropLeft and CropRight instead Removes the first crop_amount base pairs from the beginning of the match.

uint FirstStart () const
 Returns the index of the first sequence this match occurs in.

void Free ()
 frees storage used by this object in a boost::pool::fast_pool_allocator

void GetAlignment (std::vector< mems::bitset_t > &align_matrix) const
void GetColumn (gnSeqI col, std::vector< gnSeqI > &pos, std::vector< bool > &column) const
 Given an alignment column index, this function returns the corresponding sequence coordinates and whether each sequence is aligned in that column If a given sequence is not represented in the requested column, the position returned in pos should be that of the first nucleotide to the left of the requested column.

void Invert ()
 Inverts the coordinates of this match.

bool IsGap (uint seqI, gnSeqI col) const
 returns true if the given row,column of the alignment has a gap character

gnSeqI LeftEnd (uint seqI) const
 Returns the left end coordinate of this match at the seqI'th matching position/sequence.

gnSeqI Length (uint seqI) const
 Returns the length of this match.

 MatchProjectionAdapter (const MatchProjectionAdapter &mpa)
 MatchProjectionAdapter (mems::AbstractMatch *match, const std::vector< size_t > &projection)
 MatchProjectionAdapter ()
void MoveEnd (int64 move_amount)
 Shift the left-end coordinates in reverse oriented positions by a given amount.

void MoveStart (int64 move_amount)
 Shift the left-end coordinates in forward oriented positions by a given amount.

uint Multiplicity () const
 Returns the multiplicity of the match.

MatchProjectionAdapteroperator= (const MatchProjectionAdapter &mpa)
orientation Orientation (uint seqI) const
 Returns the orientation of this match at the startI'th matching position/sequence, either AbstractMatch::forward or AbstractMatch::reverse.

uint SeqCount () const
 Returns the number of sequences in the alignment which contains this match.

void SetLeftEnd (uint seqI, gnSeqI start)
 sets the left end coordinate of this match in the seqI'th matching position/sequence

void SetLength (gnSeqI len, uint seqI)
 Sets the length of this match to.

void SetOrientation (uint seqI, orientation o)
 sets the relative orientation of this match in the seqI'th matching position/sequence

void SetStart (uint seqI, int64 start)
 Deprecated: use SetLeftEnd() and SetOrientation instead Sets the start in sequence.

int64 Start (uint startI) const
 Deprecated: use LeftEnd() and Orientation() instead.

uint UsedSeq (uint seqI) const
 Returns the id of the i-th defined sequence in this match.

 ~MatchProjectionAdapter ()

Public Attributes

mems::AbstractMatchm
std::vector< size_t > seq

Detailed Description

MatchProjectionAdapter is a wrapper around an AbstractMatch that effectively projects a multi-match to a subset match.

The adapter class forwards most function calls to the original match class, to which it stores a pointer. Use of non-const functions results in undefined state.

Definition at line 26 of file MatchProjectionAdapter.h.


Constructor & Destructor Documentation

mems::MatchProjectionAdapter::MatchProjectionAdapter  )  [inline]
 

Definition at line 29 of file MatchProjectionAdapter.h.

References m.

Referenced by Clone().

mems::MatchProjectionAdapter::MatchProjectionAdapter mems::AbstractMatch match,
const std::vector< size_t > &  projection
[inline]
 

Definition at line 30 of file MatchProjectionAdapter.h.

References mems::AbstractMatch::Copy(), m, and seq.

mems::MatchProjectionAdapter::MatchProjectionAdapter const MatchProjectionAdapter mpa  )  [inline]
 

Definition at line 36 of file MatchProjectionAdapter.h.

References mems::AbstractMatch::Copy(), m, and seq.

mems::MatchProjectionAdapter::~MatchProjectionAdapter  )  [inline]
 

Definition at line 45 of file MatchProjectionAdapter.h.

References mems::AbstractMatch::Free(), and m.


Member Function Documentation

gnSeqI mems::MatchProjectionAdapter::AlignmentLength  )  const [inline, virtual]
 

Returns the total length of this alignment in columns.

Implements mems::AbstractMatch.

Definition at line 96 of file MatchProjectionAdapter.h.

References mems::AbstractMatch::AlignmentLength(), and m.

MatchProjectionAdapter* mems::MatchProjectionAdapter::Clone  )  const [inline]
 

Definition at line 51 of file MatchProjectionAdapter.h.

References MatchProjectionAdapter().

MatchProjectionAdapter* mems::MatchProjectionAdapter::Copy  )  const [inline, virtual]
 

creates a copy of this using a boost::pool::fast_pool_allocator

Implements mems::AbstractMatch.

Definition at line 54 of file MatchProjectionAdapter.h.

References mems::m_allocateAndCopy().

Referenced by mems::projectIntervalList().

void mems::MatchProjectionAdapter::CropEnd gnSeqI  crop_amount  )  [inline, virtual]
 

Deprecated: Use CropLeft and CropRight instead Removes the last crop_amount base pairs from the end of the match.

Implements mems::AbstractMatch.

Definition at line 99 of file MatchProjectionAdapter.h.

References mems::AbstractMatch::CropEnd(), and m.

void mems::MatchProjectionAdapter::CropLeft gnSeqI  crop_amount,
uint  seqI
[inline, virtual]
 

Crop this match from the left Removes the first crop_amount positions from the left side of the match.

Implements mems::AbstractMatch.

Definition at line 100 of file MatchProjectionAdapter.h.

References mems::AbstractMatch::CropLeft(), m, seq, and uint.

void mems::MatchProjectionAdapter::CropRight gnSeqI  crop_amount,
uint  seqI
[inline, virtual]
 

Crop this match from the right Removes the last crop_amount positions from the right side of the match.

Implements mems::AbstractMatch.

Definition at line 101 of file MatchProjectionAdapter.h.

References mems::AbstractMatch::CropRight(), m, seq, and uint.

void mems::MatchProjectionAdapter::CropStart gnSeqI  crop_amount  )  [inline, virtual]
 

Deprecated: Use CropLeft and CropRight instead Removes the first crop_amount base pairs from the beginning of the match.

Implements mems::AbstractMatch.

Definition at line 98 of file MatchProjectionAdapter.h.

References mems::AbstractMatch::CropStart(), and m.

uint mems::MatchProjectionAdapter::FirstStart  )  const [inline, virtual]
 

Returns the index of the first sequence this match occurs in.

Implements mems::AbstractMatch.

Definition at line 95 of file MatchProjectionAdapter.h.

References uint.

void mems::MatchProjectionAdapter::Free  )  [inline, virtual]
 

frees storage used by this object in a boost::pool::fast_pool_allocator

Implements mems::AbstractMatch.

Definition at line 59 of file MatchProjectionAdapter.h.

References mems::m_free().

void mems::MatchProjectionAdapter::GetAlignment std::vector< mems::bitset_t > &  align_matrix  )  const [inline]
 

Definition at line 102 of file MatchProjectionAdapter.h.

References mems::AbstractMatch::GetAlignment(), m, and seq.

void mems::MatchProjectionAdapter::GetColumn gnSeqI  col,
std::vector< gnSeqI > &  pos,
std::vector< bool > &  column
const [inline, virtual]
 

Given an alignment column index, this function returns the corresponding sequence coordinates and whether each sequence is aligned in that column If a given sequence is not represented in the requested column, the position returned in pos should be that of the first nucleotide to the left of the requested column.

If no nucleotides exist to the left of the requested column, then a NO_MATCH is returned in pos for that sequence.

Implements mems::AbstractMatch.

Definition at line 110 of file MatchProjectionAdapter.h.

References mems::AbstractMatch::GetColumn(), m, and seq.

void mems::MatchProjectionAdapter::Invert  )  [inline, virtual]
 

Inverts the coordinates of this match.

Implements mems::AbstractMatch.

Definition at line 97 of file MatchProjectionAdapter.h.

References mems::AbstractMatch::Invert(), and m.

bool mems::MatchProjectionAdapter::IsGap uint  seqI,
gnSeqI  col
const [inline, virtual]
 

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

Implements mems::AbstractMatch.

Definition at line 122 of file MatchProjectionAdapter.h.

References mems::AbstractMatch::IsGap(), m, seq, and uint.

gnSeqI mems::MatchProjectionAdapter::LeftEnd uint  seqI  )  const [inline, virtual]
 

Returns the left end coordinate of this match at the seqI'th matching position/sequence.

Implements mems::AbstractMatch.

Definition at line 80 of file MatchProjectionAdapter.h.

References mems::AbstractMatch::LeftEnd(), m, seq, and uint.

gnSeqI mems::MatchProjectionAdapter::Length uint  seqI  )  const [inline, virtual]
 

Returns the length of this match.

Implements mems::AbstractMatch.

Definition at line 76 of file MatchProjectionAdapter.h.

References mems::AbstractMatch::Length(), m, seq, and uint.

void mems::MatchProjectionAdapter::MoveEnd int64  move_amount  )  [inline, virtual]
 

Shift the left-end coordinates in reverse oriented positions by a given amount.

Implements mems::AbstractMatch.

Definition at line 85 of file MatchProjectionAdapter.h.

References m, and mems::AbstractMatch::MoveEnd().

void mems::MatchProjectionAdapter::MoveStart int64  move_amount  )  [inline, virtual]
 

Shift the left-end coordinates in forward oriented positions by a given amount.

Implements mems::AbstractMatch.

Definition at line 84 of file MatchProjectionAdapter.h.

References m, and mems::AbstractMatch::MoveStart().

uint mems::MatchProjectionAdapter::Multiplicity  )  const [inline, virtual]
 

Returns the multiplicity of the match.

e.g. the number of sequences this match occurs in

Implements mems::AbstractMatch.

Definition at line 86 of file MatchProjectionAdapter.h.

References mems::AbstractMatch::LeftEnd(), m, seq, and uint.

MatchProjectionAdapter& mems::MatchProjectionAdapter::operator= const MatchProjectionAdapter mpa  )  [inline]
 

Definition at line 64 of file MatchProjectionAdapter.h.

References mems::AbstractMatch::Copy(), mems::AbstractMatch::Free(), m, and seq.

orientation mems::MatchProjectionAdapter::Orientation uint  seqI  )  const [inline, virtual]
 

Returns the orientation of this match at the startI'th matching position/sequence, either AbstractMatch::forward or AbstractMatch::reverse.

Implements mems::AbstractMatch.

Definition at line 81 of file MatchProjectionAdapter.h.

References m, mems::AbstractMatch::Orientation(), seq, and uint.

uint mems::MatchProjectionAdapter::SeqCount  )  const [inline, virtual]
 

Returns the number of sequences in the alignment which contains this match.

Implements mems::AbstractMatch.

Definition at line 94 of file MatchProjectionAdapter.h.

References seq, and uint.

void mems::MatchProjectionAdapter::SetLeftEnd uint  seqI,
gnSeqI  start
[inline, virtual]
 

sets the left end coordinate of this match in the seqI'th matching position/sequence

Implements mems::AbstractMatch.

Definition at line 82 of file MatchProjectionAdapter.h.

References m, seq, mems::AbstractMatch::SetLeftEnd(), and uint.

void mems::MatchProjectionAdapter::SetLength gnSeqI  len,
uint  seqI
[inline, virtual]
 

Sets the length of this match to.

Parameters:
len 

Implements mems::AbstractMatch.

Definition at line 77 of file MatchProjectionAdapter.h.

References m, seq, mems::AbstractMatch::SetLength(), and uint.

void mems::MatchProjectionAdapter::SetOrientation uint  seqI,
orientation  o
[inline, virtual]
 

sets the relative orientation of this match in the seqI'th matching position/sequence

Implements mems::AbstractMatch.

Definition at line 83 of file MatchProjectionAdapter.h.

References m, seq, mems::AbstractMatch::SetOrientation(), and uint.

void mems::MatchProjectionAdapter::SetStart uint  seqI,
int64  start
[inline, virtual]
 

Deprecated: use SetLeftEnd() and SetOrientation instead Sets the start in sequence.

Parameters:
seqI of this match to
start 

Implements mems::AbstractMatch.

Definition at line 79 of file MatchProjectionAdapter.h.

References m, seq, mems::AbstractMatch::SetStart(), and uint.

int64 mems::MatchProjectionAdapter::Start uint  startI  )  const [inline, virtual]
 

Deprecated: use LeftEnd() and Orientation() instead.

Returns the start coordinate of this match in sequence

Parameters:
startI 

Implements mems::AbstractMatch.

Definition at line 78 of file MatchProjectionAdapter.h.

References m, seq, mems::AbstractMatch::Start(), and uint.

uint mems::MatchProjectionAdapter::UsedSeq uint  seqI  )  const [inline, virtual]
 

Returns the id of the i-th defined sequence in this match.

Implements mems::AbstractMatch.

Definition at line 123 of file MatchProjectionAdapter.h.

References m, seq, mems::AbstractMatch::Start(), and uint.


Member Data Documentation

mems::AbstractMatch* mems::MatchProjectionAdapter::m
 

Definition at line 136 of file MatchProjectionAdapter.h.

Referenced by AlignmentLength(), CropEnd(), CropLeft(), CropRight(), CropStart(), GetAlignment(), GetColumn(), Invert(), IsGap(), LeftEnd(), Length(), MatchProjectionAdapter(), MoveEnd(), MoveStart(), Multiplicity(), operator=(), Orientation(), SetLeftEnd(), SetLength(), SetOrientation(), SetStart(), Start(), UsedSeq(), and ~MatchProjectionAdapter().

std::vector< size_t > mems::MatchProjectionAdapter::seq
 

Definition at line 137 of file MatchProjectionAdapter.h.

Referenced by CropLeft(), CropRight(), GetAlignment(), GetColumn(), IsGap(), LeftEnd(), Length(), MatchProjectionAdapter(), Multiplicity(), operator=(), Orientation(), SeqCount(), SetLeftEnd(), SetLength(), SetOrientation(), SetStart(), Start(), and UsedSeq().


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