LSDynaln Class Reference

#include <dynaln.h>

Inheritance diagram for LSDynaln:

Dynaln Dynaln

List of all members.

Public Member Functions

 LSDynaln ()
 LSDynaln (const bioseq &s1, const bioseq &s2)
 LSDynaln (const bioseq &s1, const bioseq &s2, const string &mat)
 ~LSDynaln ()
int global ()
int local ()
int runlocal ()
pair< int, int > computeScoreFW (int b1, int e1, int b2, int e2)
pair< int, int > computeScoreBW (int b1, int e1, int b2, int e2)
int path (int b1, int e1, int b2, int e2)
list< pair< int, int > > tracebackFW (pair< int, int > mrow, int b1, int &e1, int b2, int &e2)
list< pair< int, int > > tracebackBW (pair< int, int > mrow, int b1, int &e1, int b2, int &e2)
void buildResult ()
void debug_showmatrixForward (pair< int, int > &rows, const int col)
void debug_showmatrixBackward (pair< int, int > &rows, const int col)
 LSDynaln ()
 LSDynaln (const bioseq &s1, const bioseq &s2)
 LSDynaln (const bioseq &s1, const bioseq &s2, const string &mat)
 ~LSDynaln ()
int global ()
int local ()
int runlocal ()
pair< int, int > computeScoreFW (int b1, int e1, int b2, int e2)
pair< int, int > computeScoreBW (int b1, int e1, int b2, int e2)
int path (int b1, int e1, int b2, int e2)
list< pair< int, int > > tracebackFW (pair< int, int > mrow, int b1, int &e1, int b2, int &e2)
list< pair< int, int > > tracebackBW (pair< int, int > mrow, int b1, int &e1, int b2, int &e2)
void buildResult ()
void debug_showmatrixForward (pair< int, int > &rows, const int col)
void debug_showmatrixBackward (pair< int, int > &rows, const int col)

Private Member Functions

void allocmem ()
void allocmem ()

Private Attributes

int * MR
int * IXR
int * IYR


Detailed Description

Class LSDynaln

Linear space Dynamic Alignment. This is a derived class of the Dynaln. The memory allocation is different so that long sequences can be aligned.

Uses a kind of divided and conquer method.


Constructor & Destructor Documentation

LSDynaln::LSDynaln (  )  [inline]

LSDynaln::LSDynaln ( const bioseq s1,
const bioseq s2 
) [inline]

LSDynaln::LSDynaln ( const bioseq s1,
const bioseq s2,
const string &  mat 
) [inline]

LSDynaln::~LSDynaln (  ) 

References IXR, IYR, and MR.

LSDynaln::LSDynaln (  )  [inline]

LSDynaln::LSDynaln ( const bioseq s1,
const bioseq s2 
) [inline]

LSDynaln::LSDynaln ( const bioseq s1,
const bioseq s2,
const string &  mat 
) [inline]

LSDynaln::~LSDynaln (  ) 


Member Function Documentation

int LSDynaln::global (  ) 

the linear space version b1: begin index of sequence1 (0-based index) e1: one-passed the end index of sequence1 (0-based index) return: the best score

Reimplemented from Dynaln.

References allocmem(), Dynaln::alnidx, Dynaln::alntype, Dynaln::clearResult(), GLOBAL, bioseq::length(), path(), Dynaln::seq1, Dynaln::seq2, and Dynaln::Smax.

Referenced by alignDNA(), and main().

int LSDynaln::local (  ) 

int LSDynaln::runlocal (  )  [inline]

overwrite parent class method. Specific to linear space

Reimplemented from Dynaln.

References buildResult(), and local().

Referenced by alignProtein().

pair< int, int > LSDynaln::computeScoreFW ( int  b1,
int  e1,
int  b2,
int  e2 
)

pair< int, int > LSDynaln::computeScoreBW ( int  b1,
int  e1,
int  b2,
int  e2 
)

works on the reverse matrices b1>e1 | b2>e2

References Dynaln::C1, Dynaln::C2, Dynaln::gape, Dynaln::gapi, IXR, IYR, Matrix::lookup(), max, MR, and Dynaln::ST.

Referenced by path().

int LSDynaln::path ( int  b1,
int  e1,
int  b2,
int  e2 
)

arguments: 0-based index of sequences b1, e1: begin and end of sequence 1 b2, e2: begin and end of sequence 2 Here b1<e1 and b2<e2

The result will be consolidated in the alnidx list.

References Dynaln::alnidx, computeScoreBW(), computeScoreFW(), debug_showmatrixBackward(), debug_showmatrixForward(), Dynaln::IX, IXR, Dynaln::IY, IYR, Matrix::lookup(), Dynaln::M, max, MR, Dynaln::seq1, Dynaln::seq2, Dynaln::ST, bioseq::substr(), tracebackBW(), and tracebackFW().

Referenced by global(), local(), tracebackBW(), and tracebackFW().

list< pair< int, int > > LSDynaln::tracebackFW ( pair< int, int >  mrow,
int  b1,
int &  e1,
int  b2,
int &  e2 
)

arguments: mrow index of the last two rows of the matrix (top,buttom) This function will decrement e1 and e2. If they have become smaller than b1 and b2 respectively, then the job has been finished and there is no need to do another recursion call. The caller (path()) function uses this information. return: path in forward direction

References Dynaln::IX, Dynaln::IY, Dynaln::M, max, path(), and R.

Referenced by path().

list< pair< int, int > > LSDynaln::tracebackBW ( pair< int, int >  mrow,
int  b1,
int &  e1,
int  b2,
int &  e2 
)

arguments: mrow is the matrix row, a pair of integers for the top and buttom array starting point. This information was used to locate the starting point for the MR, IXR, and IYR arrays. The first integer starts the top array, and the second integer starts the buttom array. MR + mrow.first --> top array. Return the path in the forward direction, there is no need to reverse it

References Dynaln::IX, Dynaln::IY, Dynaln::M, max, path(), and R.

Referenced by path().

void LSDynaln::buildResult (  ) 

Overwrite the base class version. There are some commonality, need to be factored out in the future.

Reimplemented from Dynaln.

References Dynaln::alnidx, Dynaln::alntype, Dynaln::buildAlnInfo(), Dynaln::countnumgaps(), GLOBAL, bioseq::length(), Dynaln::seq1, Dynaln::seq1begin, Dynaln::seq1end, Dynaln::seq2, Dynaln::seq2begin, and Dynaln::seq2end.

Referenced by alignDNA(), main(), and runlocal().

void LSDynaln::debug_showmatrixForward ( pair< int, int > &  rows,
const int  col 
)

References Dynaln::IX, Dynaln::IY, and Dynaln::M.

Referenced by path().

void LSDynaln::debug_showmatrixBackward ( pair< int, int > &  rows,
const int  col 
)

References IXR, IYR, and MR.

Referenced by path().

void LSDynaln::allocmem (  )  [private]

allocate memory use two rows for top problem two rows for buttom problem S and SR have only one row to store the score of the last row.

Reimplemented from Dynaln.

References Dynaln::C1, Dynaln::C2, bioseq::getcode(), Dynaln::IX, IXR, Dynaln::IY, IYR, bioseq::length(), Dynaln::M, MR, Dynaln::numcol, Dynaln::seq1, Dynaln::seq2, and Dynaln::Ssize.

Referenced by global(), and local().

int LSDynaln::global (  ) 

It does the alignment, return the index of the final cell (in terms of the sequence) in the alignment, this can be used for traceback. The max score will be set.

return the max score of the global alignment.

Reimplemented from Dynaln.

int LSDynaln::local (  ) 

Run the local algorithm

Reimplemented from Dynaln.

int LSDynaln::runlocal (  )  [inline]

Local algorithm build alignment result use buildResult() to build the alignment result.

Reimplemented from Dynaln.

References buildResult(), and local().

pair<int, int> LSDynaln::computeScoreFW ( int  b1,
int  e1,
int  b2,
int  e2 
)

pair<int, int> LSDynaln::computeScoreBW ( int  b1,
int  e1,
int  b2,
int  e2 
)

int LSDynaln::path ( int  b1,
int  e1,
int  b2,
int  e2 
)

list<pair<int,int> > LSDynaln::tracebackFW ( pair< int, int >  mrow,
int  b1,
int &  e1,
int  b2,
int &  e2 
)

list<pair<int,int> > LSDynaln::tracebackBW ( pair< int, int >  mrow,
int  b1,
int &  e1,
int  b2,
int &  e2 
)

void LSDynaln::buildResult (  ) 

This methods build addional information from the initial phase of the algorithm. 1. call traceback. 2. clear existing result (call clearResult()) 3. then use the alnidx list to update other information: idencnt: counts for identical resudues simcnt: similar residues numgaps1, numgaps2: number of gaps in seq1 and seq2 gaplen1, gaplen2: total gaps in both sequences. topaln: aligned string of seq1 buttomaln: aligned string of seq2 middle: alignment middle line (| for identical : for similar) This method create additional redundant information for easy usage and user interface.

Reimplemented from Dynaln.

void LSDynaln::debug_showmatrixForward ( pair< int, int > &  rows,
const int  col 
)

void LSDynaln::debug_showmatrixBackward ( pair< int, int > &  rows,
const int  col 
)

void LSDynaln::allocmem (  )  [private]

allocate needed memory according to the length of the input sequences

For repeated use of this object, if previous allocated memory is large enough then this object will reuse the old memory without reallocate new memory.

Reimplemented from Dynaln.


Member Data Documentation

int * LSDynaln::MR [private]

int * LSDynaln::IXR [private]

int * LSDynaln::IYR [private]


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

Generated on Wed Aug 10 11:57:12 2011 for Softwares from Orpara by  doxygen 1.5.6