MASA-Core
Public Member Functions | Protected Member Functions
IManager Class Reference

Detailed Description

Interface that manages the MASA extension execution.

The MASA framework has an implementation of the IManager interface, that is responsible to receive commands from the Aligner. These commands are classified in the following types:

In order to test these conditional requirements, each aligner is associated with an instance of the IManager interface (see setManager() function). Besides the conditional requirement tests, the Manager also provides all the parameters necessary to customize the alignment, for example the sequences, the partitions coordinates. The AbstractAligner hides the IManager invocation using some delegate methods with protected visibility.

See also:
The aligner_capabilities_t struct describes all the possible capabilities and the requirement necessary to implement it.
The AbstractAligner has many methods that helps the implementation of the IAligner interface.
The IManager interface manages the execution of the IAligner.

Definition at line 90 of file IManager.hpp.

#include <IManager.hpp>

Inheritance diagram for IManager:
AlignerManager

List of all members.

Public Member Functions

virtual int getRecurrenceType () const =0
virtual int getSpecialRowInterval () const =0
virtual int getSpecialColumnInterval () const =0
virtual int getFirstColumnInitType ()=0
 Returns the initialization type of the first column.
virtual int getFirstRowInitType ()=0
 Returns the initialization type of the first row.
virtual Partition getSuperPartition ()=0
 Returns the super partition that includes all sub partitions being aligned.
virtual void receiveFirstRow (cell_t *buffer, int len)=0
 Receives the first row of the partition.
virtual void receiveFirstColumn (cell_t *buffer, int len)=0
 Receives the first column of the partition.
virtual void dispatchColumn (int j, const cell_t *buffer, int len)=0
 Notifies to the MASA framework that some cells of a column has been processed.
virtual void dispatchRow (int i, const cell_t *buffer, int len)=0
 Notifies to the MASA framework that some cells of a row has been processed.
virtual void dispatchScore (score_t score, int bx=-1, int by=-1)=0
 Notifies to the MASA framework that a new score has been computed.
virtual bool mustContinue ()=0
virtual bool mustDispatchLastCell ()=0
virtual bool mustDispatchLastRow ()=0
virtual bool mustDispatchLastColumn ()=0
virtual bool mustDispatchSpecialRows ()=0
virtual bool mustDispatchSpecialColumns ()=0
virtual bool mustDispatchScores ()=0
virtual bool mustPruneBlocks ()=0

Protected Member Functions

 ~IManager ()
 IManager ()

Constructor & Destructor Documentation

IManager::~IManager ( ) [inline, protected]

Definition at line 317 of file IManager.hpp.

IManager::IManager ( ) [inline, protected]

Definition at line 318 of file IManager.hpp.


Member Function Documentation

virtual void IManager::dispatchColumn ( int  j,
const cell_t buffer,
int  len 
) [pure virtual]

Notifies to the MASA framework that some cells of a column has been processed.

This function must be called serially for each column. For example, the invocation of dispatchColumn(50000, vector, 100) will dispatch the first 100 cells of the column 50000 to MASA, and the cells are read from the vector[0..99] elements. After this, a call to dispatchColumn(50000, vector, 50) will dispatch the next 50 cells of the same column 5000, and the cells are read from the vector[0..49] elements.

Parameters:
jthe column to be dispatched.
bufferthe vector containing the data (starting from cell 0).
lenthe number of cells that will be read from the vector.

Implemented in AlignerManager.

virtual void IManager::dispatchRow ( int  i,
const cell_t buffer,
int  len 
) [pure virtual]

Notifies to the MASA framework that some cells of a row has been processed.

This function must be called serially for each row, analogous to the AbstractAligner::dispatchLastColumn method.

Parameters:
ithe row to be dispatched.
bufferthe vector containing the data (starting from cell 0).
lenthe number of cells that will be read from the vector.

Implemented in AlignerManager.

virtual void IManager::dispatchScore ( score_t  score,
int  bx = -1,
int  by = -1 
) [pure virtual]

Notifies to the MASA framework that a new score has been computed.

This method may be called as many times it is necessary, and the best score will be calculated among all calls of this method.

If the Aligner supports the aligner_capabilities_t::dispatch_block_scores capability, them it must dispatch the score with the bx, by parameters set to the block indices and this method must be called only once for each block.

Parameters:
scorethe score to be dispatched
bxthe block position in the horizontal direction, starting from 0 up to AbstractAligner::getGridWidth() minus 1.
bythe block position in the vertical direction, starting from 0 up to AbstractAligner::getGridHeight() minus 1.

Implemented in AlignerManager.

virtual int IManager::getFirstColumnInitType ( ) [pure virtual]

Returns the initialization type of the first column.

Possible values are

  • INIT_WITH_CUSTOM_DATA: the first column must be initialized with custom data that can only be obtained by the AbstractAligner::receiveFirstColumn method.

  • INIT_WITH_GAPS: the first column must be initialized considering gaps. The initialization equation is:

    \begin{eqnarray*}H_{0,0} &=& 0 \\ H_{k,0} &=& -k.G_{ext}-G_{open} \\ F_{k,0} &=& -\infty \end{eqnarray*}

  • INIT_WITH_GAPS_OPENED: the first column must be initialized considering gaps, but without gap opening penalty. The initialization equation is:

    \begin{eqnarray*}H_{k,0} &=& -k.G_{ext} \\ F_{k,0} &=& -\infty \end{eqnarray*}

  • INIT_WITH_ZEROES: the first column must be initialized considering zero values. The initialization equation is:

    \begin{eqnarray*}H_{k,0} &=& 0 \\ F_{k,0} &=& -\infty \end{eqnarray*}

    The initialization data of all types may be obtained by the AbstractAligner::receiveFirstColumn method, but the subclass of AbstractAligner may implement the initialization functions using some architectural dependent code (for example, using vectorial hardware instructions).

Returns:
the initialization type.

Implemented in AlignerManager.

virtual int IManager::getFirstRowInitType ( ) [pure virtual]

Returns the initialization type of the first row.

Possible values are

  • INIT_WITH_CUSTOM_DATA: the first row must be initialized with custom data that can only be obtained by the AbstractAligner::receiveFirstRow method.

  • INIT_WITH_GAPS: the first column must be initialized considering gaps. The initialization equation is:

    \begin{eqnarray*}H_{0,0} &=& 0 \\ H_{0,k} &=& -k.G_{ext}-G_{open} \\ F_{0,k} &=& -\infty \end{eqnarray*}

  • INIT_WITH_GAPS_OPENED: the first column must be initialized considering gaps, but without gap opening penalty. The initialization equation is:

    \begin{eqnarray*}H_{0,k} &=& -k.G_{ext} \\ F_{0,k} &=& -\infty \end{eqnarray*}

  • INIT_WITH_ZEROES: the first row must be initialized considering zero values. The initialization equation is:

    \begin{eqnarray*}H_{0,k} &=& 0 \\ F_{0,k} &=& -\infty \end{eqnarray*}

    The initialization data of all types may be obtained by the AbstractAligner::receiveFirstRow method, but the subclass of AbstractAligner may implement the initialization functions using some architectural dependent code (for example, using vectorial hardware instructions).

Returns:
the initialization type.

Implemented in AlignerManager.

virtual int IManager::getRecurrenceType ( ) const [pure virtual]
Returns:
the recurrence type of the alignment. Possible values are SMITH_WATERMAN and NEEDLEMAN_WUNSCH.

Implemented in AlignerManager.

virtual int IManager::getSpecialColumnInterval ( ) const [pure virtual]
Returns:
the minimum distance between two special columns, or 0 if it must not save special columns.

Implemented in AlignerManager.

virtual int IManager::getSpecialRowInterval ( ) const [pure virtual]
Returns:
the minimum distance between two special rows, or 0 if it must not save special rows.

Implemented in AlignerManager.

virtual Partition IManager::getSuperPartition ( ) [pure virtual]

Returns the super partition that includes all sub partitions being aligned.

This method must be used only by block pruning algorithms in order to obtain the corner coordinates of the matrix.

A super partition is a set of many smaller partitions and this occurs in two situations. The first is when we are running stage1 in a multiprocess environment, where we have one sub partition for each process. The second situation happens when the aligner cannot handle the full size of the matrix, so the partition is split in parts smaller than the max sequence size capability of the aligner.

Returns:
the super partition.

Implemented in AlignerManager.

virtual bool IManager::mustContinue ( ) [pure virtual]
Returns:
true if the execution must continue.

Implemented in AlignerManager.

virtual bool IManager::mustDispatchLastCell ( ) [pure virtual]
Returns:
true if the last cell must be dispatched.

Implemented in AlignerManager.

virtual bool IManager::mustDispatchLastColumn ( ) [pure virtual]
Returns:
true if the last column must be dispatched.

Implemented in AlignerManager.

virtual bool IManager::mustDispatchLastRow ( ) [pure virtual]
Returns:
true if the last row must be dispatched.

Implemented in AlignerManager.

virtual bool IManager::mustDispatchScores ( ) [pure virtual]
Returns:
true if intermediate scores must be dispatched.

Implemented in AlignerManager.

virtual bool IManager::mustDispatchSpecialColumns ( ) [pure virtual]
Returns:
true if special columns must be dispatched.

Implemented in AlignerManager.

virtual bool IManager::mustDispatchSpecialRows ( ) [pure virtual]
Returns:
true if special rows must be dispatched.

Implemented in AlignerManager.

virtual bool IManager::mustPruneBlocks ( ) [pure virtual]
Returns:
true if block pruning optimization may be used.

Implemented in AlignerManager.

virtual void IManager::receiveFirstColumn ( cell_t buffer,
int  len 
) [pure virtual]

Receives the first column of the partition.

This function may block until all the requested data is ready. So prefer to read data in chunks instead of reading the full first row. The data will be stored from 0 to len-1 positions of the vector passed in the parameters.

Parameters:
bufferthe vector where the first column data will be stored.
lenthe number of cells that will be read.

Implemented in AlignerManager.

virtual void IManager::receiveFirstRow ( cell_t buffer,
int  len 
) [pure virtual]

Receives the first row of the partition.

This function may block until all the requested data is ready. So prefer to read data in chunks instead of reading the full first row. The data will be stored from 0 to len-1 positions of the vector passed in the parameters.

Parameters:
bufferthe vector where the first row data will be stored.
lenthe number of cells that will be read.

Implemented in AlignerManager.


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