#include <dynaln.h>

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 |
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.
| LSDynaln::LSDynaln | ( | ) | [inline] |
| LSDynaln::LSDynaln | ( | ) | [inline] |
| LSDynaln::~LSDynaln | ( | ) |
| 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 | ( | ) |
Run the local algorithm
Reimplemented from Dynaln.
References allocmem(), Dynaln::alnidx, Dynaln::alntype, Dynaln::C1, Dynaln::C2, Dynaln::clearResult(), Dynaln::gape, Dynaln::gapi, Dynaln::IX, Dynaln::IY, bioseq::length(), LOCAL, Matrix::lookup(), Dynaln::M, max, MR, path(), Dynaln::seq1, Dynaln::seq1begin, Dynaln::seq1end, Dynaln::seq2, Dynaln::seq2begin, Dynaln::seq2end, Dynaln::Smax, Dynaln::Smaxi, Dynaln::Smaxj, and Dynaln::ST.
Referenced by main(), and runlocal().
| 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 | |||
| ) |
References Dynaln::C1, Dynaln::C2, Dynaln::gape, Dynaln::gapi, Dynaln::IX, Dynaln::IY, Matrix::lookup(), Dynaln::M, max, and Dynaln::ST.
Referenced by path().
| 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 | |||
| ) |
| void LSDynaln::debug_showmatrixBackward | ( | pair< int, int > & | rows, | |
| const int | col | |||
| ) |
| 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.
| int LSDynaln::global | ( | ) |
| 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.
int * LSDynaln::MR [private] |
Referenced by allocmem(), computeScoreBW(), debug_showmatrixBackward(), local(), path(), and ~LSDynaln().
int * LSDynaln::IXR [private] |
Referenced by allocmem(), computeScoreBW(), debug_showmatrixBackward(), path(), and ~LSDynaln().
int * LSDynaln::IYR [private] |
Referenced by allocmem(), computeScoreBW(), debug_showmatrixBackward(), path(), and ~LSDynaln().
1.5.6