Interval Class Reference

#include <Interval.h>

Inheritance diagram for Interval:

Inheritance graph
[legend]
Collaboration diagram for Interval:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void add (AbstractMatch *am)
void CalculateAlignmentLength ()
virtual void CalculateOffset ()
 Calculates the generalized offset and other bookkeeping information for this mem.

IntervalClone () const
virtual 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 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 amount, uint seqI)
 Crop this match from the right Removes the last crop_amount positions from the right side of the match.

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

virtual void GetAlignedSequences (gnAlignedSequences &gnas, const vector< gnSequence * > &seq_table) const
 Get a gnAlignedSequences object TODO: get rid of this.

void GetAlignment (std::vector< std::vector< bool > > &align_matrix) const
void GetColumn (gnSeqI col, vector< gnSeqI > &pos, 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.

const std::vector< AbstractMatch * > & GetMatches () const
 Interval (const Interval &iv)
template<class MatchVector>  Interval (const MatchVector &matches)
 construct from a MatchList or a vector of pointers to AbstractMatches

 Interval ()
virtual void Invert ()
 Inverts the coordinates of this match.

Intervaloperator= (const Interval &iv)
void SetAlignment (const std::vector< std::string > &seq_align)
 Sets the alignment.

void ValidateMatches () const
 ~Interval ()

Protected Attributes

std::vector< AbstractMatch * > matches

Private Member Functions

template<typename ListType, typename Iter> void AddGapMatches (ListType &the_list, const Iter &first, const Iter &last, uint seqI)
void addUnalignedRegions ()
void FindMatchPos (uint seqI, gnSeqI pos, size_t &matchI, gnSeqI &match_pos)
void GetColumnAndMatch (gnSeqI col, vector< gnSeqI > &pos, vector< bool > &column, size_t &matchI, gnSeqI &match_col) const

Friends

std::ostream & operator<< (std::ostream &os, const Interval &iv)
 Writes this Interval to the specified output stream (e.g.

std::istream & operator>> (std::istream &is, const Interval &iv)
 Reads a Interval from the specified input stream (e.g.


Constructor & Destructor Documentation

Interval::Interval  )  [inline]
 

Definition at line 26 of file Interval.h.

Referenced by Clone().

template<typename MatchVector>
Interval::Interval const MatchVector &  matches  ) 
 

construct from a MatchList or a vector of pointers to AbstractMatches

Definition at line 95 of file Interval.h.

References addUnalignedRegions(), CalculateAlignmentLength(), CalculateOffset(), SparseAbstractMatch::SeqCount(), and ValidateMatches().

Interval::Interval const Interval iv  )  [inline]
 

Definition at line 109 of file Interval.h.

Interval::~Interval  )  [inline]
 

Definition at line 88 of file Interval.h.

References matches.


Member Function Documentation

void Interval::add AbstractMatch am  )  [inline]
 

Definition at line 54 of file Interval.h.

References AbstractMatch::Clone(), and matches.

Referenced by IntervalList::ReadList().

template<typename ListType, typename Iter>
void Interval::AddGapMatches ListType &  the_list,
const Iter &  first,
const Iter &  last,
uint  seqI
[private]
 

Definition at line 34 of file Interval.cpp.

References insert(), SparseAbstractMatch::LeftEnd(), SparseAbstractMatch::Orientation(), AbstractMatch::RightEnd(), SparseAbstractMatch::SeqCount(), SparseAbstractMatch::SetLeftEnd(), UngappedLocalAlignment< SparseAbstractMatch >::SetLength(), SparseAbstractMatch::SetOrientation(), and uint.

Referenced by addUnalignedRegions().

void Interval::addUnalignedRegions  )  [private]
 

Definition at line 65 of file Interval.cpp.

References AddGapMatches(), SparseAbstractMatch::LeftEnd(), matches, SparseAbstractMatch::Orientation(), SparseAbstractMatch::SeqCount(), and uint.

Referenced by Interval().

void Interval::CalculateAlignmentLength  ) 
 

Definition at line 419 of file Interval.cpp.

References matches, and AbstractGappedAlignment< SparseAbstractMatch >::SetAlignmentLength().

Referenced by CalculateOffset(), and Interval().

void Interval::CalculateOffset  )  [virtual]
 

Calculates the generalized offset and other bookkeeping information for this mem.

This should always be called after changing the start positions of the mem.

Reimplemented from SparseAbstractMatch.

Definition at line 310 of file Interval.cpp.

References CalculateAlignmentLength(), SparseAbstractMatch::CalculateOffset(), AbstractGappedAlignment< SparseAbstractMatch >::Length(), matches, SparseAbstractMatch::SeqCount(), AbstractGappedAlignment< SparseAbstractMatch >::SetLength(), SparseAbstractMatch::SetStart(), SparseAbstractMatch::Start(), and uint.

Referenced by CropLeft(), CropRight(), CropStart(), Interval(), and IntervalList::ReadList().

Interval * Interval::Clone  )  const [inline, virtual]
 

Implements AbstractMatch.

Definition at line 125 of file Interval.h.

References Interval().

void Interval::CropEnd gnSeqI  crop_amount  )  [virtual]
 

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

Implements AbstractMatch.

Definition at line 209 of file Interval.cpp.

References CropStart(), and Invert().

void Interval::CropLeft gnSeqI  amount,
uint  seqI
[virtual]
 

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

Implements AbstractMatch.

Definition at line 245 of file Interval.cpp.

References CalculateOffset(), FindMatchPos(), SparseAbstractMatch::LeftEnd(), AbstractGappedAlignment< SparseAbstractMatch >::Length(), matches, SparseAbstractMatch::Orientation(), uint, and ValidateMatches().

void Interval::CropRight gnSeqI  amount,
uint  seqI
[virtual]
 

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

Implements AbstractMatch.

Definition at line 276 of file Interval.cpp.

References CalculateOffset(), FindMatchPos(), SparseAbstractMatch::LeftEnd(), AbstractGappedAlignment< SparseAbstractMatch >::Length(), matches, SparseAbstractMatch::Orientation(), uint, and ValidateMatches().

void Interval::CropStart gnSeqI  crop_amount  )  [virtual]
 

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

Implements AbstractMatch.

Definition at line 184 of file Interval.cpp.

References AbstractGappedAlignment< SparseAbstractMatch >::AlignmentLength(), CalculateOffset(), GetColumnAndMatch(), matches, and ValidateMatches().

Referenced by CropEnd().

void Interval::FindMatchPos uint  seqI,
gnSeqI  pos,
size_t &  matchI,
gnSeqI &  match_pos
[private]
 

Definition at line 216 of file Interval.cpp.

References matches, SparseAbstractMatch::Orientation(), and uint.

Referenced by CropLeft(), and CropRight().

void Interval::GetAlignedSequences gnAlignedSequences gnas,
const vector< gnSequence * > &  seq_table
const [virtual]
 

Get a gnAlignedSequences object TODO: get rid of this.

Definition at line 454 of file Interval.cpp.

References gnAlignedSequences::names, gnAlignedSequences::positions, gnAlignedSequences::sequences, SparseAbstractMatch::Start(), and uint.

Referenced by simpleFindBackbone(), and simpleFindIslands().

void Interval::GetAlignment std::vector< std::vector< bool > > &  align_matrix  )  const [virtual]
 

Implements AbstractMatch.

Definition at line 428 of file Interval.cpp.

References matches, SparseAbstractMatch::SeqCount(), and uint.

void Interval::GetColumn gnSeqI  col,
vector< gnSeqI > &  pos,
vector< bool > &  column
const [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 AbstractMatch.

Definition at line 92 of file Interval.cpp.

References GetColumnAndMatch().

void Interval::GetColumnAndMatch gnSeqI  col,
vector< gnSeqI > &  pos,
vector< bool > &  column,
size_t &  matchI,
gnSeqI &  match_col
const [private]
 

Definition at line 136 of file Interval.cpp.

References SparseAbstractMatch::LeftEnd(), matches, SparseAbstractMatch::Orientation(), AbstractMatch::RightEnd(), SparseAbstractMatch::SeqCount(), and uint.

Referenced by CropStart(), and GetColumn().

const std::vector<AbstractMatch*>& Interval::GetMatches  )  const [inline]
 

Definition at line 72 of file Interval.h.

References matches.

void Interval::Invert  )  [virtual]
 

Inverts the coordinates of this match.

Reimplemented from SparseAbstractMatch.

Definition at line 82 of file Interval.cpp.

References SparseAbstractMatch::Invert(), matches, and uint.

Referenced by CropEnd().

Interval & Interval::operator= const Interval iv  )  [inline]
 

Definition at line 115 of file Interval.h.

References matches, and AbstractGappedAlignment< AbstractMatchImpl >::operator=().

void Interval::SetAlignment const std::vector< std::string > &  seq_align  )  [virtual]
 

Sets the alignment.

Parameters:
seq_align should be in row/column format, e.g. one string per sequence (row)

Implements AbstractGappedAlignment< SparseAbstractMatch >.

Definition at line 383 of file Interval.cpp.

References AbstractGappedAlignment< SparseAbstractMatch >::Length(), matches, SparseAbstractMatch::SeqCount(), GappedAlignment::SetAlignment(), AbstractGappedAlignment< SparseAbstractMatch >::SetLength(), SparseAbstractMatch::SetStart(), SparseAbstractMatch::Start(), and uint.

void Interval::ValidateMatches  )  const
 

Definition at line 99 of file Interval.cpp.

References SparseAbstractMatch::LeftEnd(), matches, SparseAbstractMatch::Orientation(), and uint.

Referenced by CropLeft(), CropRight(), CropStart(), and Interval().


Friends And Related Function Documentation

std::ostream& operator<< std::ostream &  os,
const Interval iv
[friend]
 

Writes this Interval to the specified output stream (e.g.

cout).

Definition at line 401 of file Interval.cpp.

std::istream& operator>> std::istream &  is,
const Interval iv
[friend]
 

Reads a Interval from the specified input stream (e.g.

cin).


Member Data Documentation

std::vector< AbstractMatch* > Interval::matches [protected]
 

Definition at line 78 of file Interval.h.

Referenced by add(), addUnalignedRegions(), CalculateAlignmentLength(), CalculateOffset(), CropLeft(), CropRight(), CropStart(), FindMatchPos(), GetAlignment(), GetColumnAndMatch(), GetMatches(), Invert(), operator<<(), operator=(), SetAlignment(), ValidateMatches(), and ~Interval().


The documentation for this class was generated from the following files:
Generated on Thu Jan 5 06:00:41 2006 for libMems by doxygen 1.3.6