Internal Alignment Class that represents a sequences matrix. More...
#include <sequencesMatrix.h>
Public Member Functions | |
sequencesMatrix () | |
Null constructor. More... | |
sequencesMatrix (string *alignmentMatrix, string *alignmentSeqsName, int sequences, int residues) | |
Manual constructor. More... | |
sequencesMatrix (Alignment *parent) | |
Automatic constructor. More... | |
sequencesMatrix & | operator= (const sequencesMatrix &) |
~sequencesMatrix () | |
Destructor. More... | |
void | printMatrix () |
Sequences Matrix printing method. More... | |
void | getColumn (int column, int *numResidueseqMatrix) |
Method to get a column out of the matrix. More... | |
void | getColumn (int value, int row, int *columnSeqMatrix) |
Method that looks to value in a row and stores a column's, corresponding to row, sequences matrix in a vector. More... | |
void | setOrder (int *order) |
Method that reorders the stored sequences with a given order list. More... | |
bool | getSequence (string seqName, int *sequence) |
Method to obtain a sequence based on its name. More... | |
int | getSeqNumber () |
Number of sequences getter. More... | |
int | getResidNumber () |
Number of residues getter. More... | |
Private Attributes | |
int | resNumber |
Number of residues per sequence. More... | |
int | seqsNumber |
Number of sequences in the matrix. More... | |
int ** | matrix |
Matrix container. It contains the sequences and residues of each sequence. More... | |
string * | seqsName |
Sequences names container. More... | |
Alignment * | alig |
Pointer to the alignment this object is related to. More... | |
Internal Alignment Class that represents a sequences matrix.
A Sequence matrix is a 2D matrix that represents MSA without any gaps included.
This class stores the alignment sequences matrix.
It provides methods to build the sequences matrix and print the matrix.
It also provides methods for look to a column in the matrix and for look to value at the position (row, column) in the matrix.
See:
Definition at line 55 of file sequencesMatrix.h.
Alignment::sequencesMatrix::sequencesMatrix | ( | void | ) |
Null constructor.
This construction method initializes all attributes of the new object with 0 or nullptr value.
Definition at line 35 of file sequencesMatrix.cpp.
References matrix, resNumber, seqsName, and seqsNumber.
Alignment::sequencesMatrix::sequencesMatrix | ( | string * | alignmentMatrix, |
string * | alignmentSeqsName, | ||
int | sequences, | ||
int | residues | ||
) |
Manual constructor.
This construction method initializes all attributes using the information passed as arguments.
alignmentMatrix | Sequences of the alignment to convert to sequenceMatrix |
alignmentSeqsName | Sequences names |
sequences | Number of sequences |
residues | Number of residues |
Definition at line 79 of file sequencesMatrix.cpp.
References utils::initlVect(), matrix, resNumber, seqsName, and seqsNumber.
|
explicit |
Automatic constructor.
This construction method initializes all attributes using the information present in the alignment pointer passed.
parent | Alignment to associate the sequences matrix to. |
Definition at line 48 of file sequencesMatrix.cpp.
References alig, utils::initlVect(), matrix, Alignment::originalNumberOfResidues, Alignment::originalNumberOfSequences, resNumber, seqsName, Alignment::seqsName, seqsNumber, and Alignment::sequences.
Referenced by statistics::Consistency::forceComparison(), and statistics::Consistency::perform().
Alignment::sequencesMatrix::~sequencesMatrix | ( | ) |
Destructor.
Destruction method that frees, if exists, previously allocated memory.
Definition at line 133 of file sequencesMatrix.cpp.
References matrix, resNumber, seqsName, and seqsNumber.
void Alignment::sequencesMatrix::getColumn | ( | int | column, |
int * | numResidueseqMatrix | ||
) |
Method to get a column out of the matrix.
column | Column number at sequences matrix. | |
[out] | numResidueseqMatrix | Vector where storage a column's sequences matrix. |
Method that storages a column's sequences matrix in a vector.
Definition at line 169 of file sequencesMatrix.cpp.
References matrix, resNumber, and seqsNumber.
Referenced by statistics::Consistency::compareAndChoose(), and statistics::Consistency::forceComparison().
void Alignment::sequencesMatrix::getColumn | ( | int | value, |
int | row, | ||
int * | columnSeqMatrix | ||
) |
Method that looks to value in a row and stores a column's, corresponding to row, sequences matrix in a vector.
value | to look in a row's sequences matrix. |
row | where to look for a value. |
columnSeqMatrix | Vector where storage a column's sequences matrix. |
Definition at line 185 of file sequencesMatrix.cpp.
References matrix, resNumber, and seqsNumber.
Referenced by statistics::Consistency::compareAndChoose(), and statistics::Consistency::forceComparison().
int Alignment::sequencesMatrix::getResidNumber | ( | void | ) |
Number of residues getter.
Definition at line 251 of file sequencesMatrix.cpp.
References resNumber.
int Alignment::sequencesMatrix::getSeqNumber | ( | void | ) |
Number of sequences getter.
Definition at line 244 of file sequencesMatrix.cpp.
References seqsNumber.
bool Alignment::sequencesMatrix::getSequence | ( | string | seqName, |
int * | sequence | ||
) |
Method to obtain a sequence based on its name.
seqName | Name of the sequence to find. | |
[out] | sequence | Where to store the sequence. |
Definition at line 225 of file sequencesMatrix.cpp.
References matrix, resNumber, seqsName, and seqsNumber.
Alignment::sequencesMatrix & Alignment::sequencesMatrix::operator= | ( | const sequencesMatrix & | old | ) |
Definition at line 110 of file sequencesMatrix.cpp.
References matrix, resNumber, seqsName, and seqsNumber.
void Alignment::sequencesMatrix::printMatrix | ( | void | ) |
Sequences Matrix printing method.
Method that prints the alignment sequences matrix.
Definition at line 152 of file sequencesMatrix.cpp.
References matrix, resNumber, and seqsNumber.
void Alignment::sequencesMatrix::setOrder | ( | int * | order | ) |
Method that reorders the stored sequences with a given order list.
order | Pointer that contains the new order we want to give the matrix. |
Definition at line 203 of file sequencesMatrix.cpp.
References matrix, resNumber, and seqsNumber.
Referenced by statistics::Consistency::compareAndChoose(), and statistics::Consistency::forceComparison().
|
private |
Pointer to the alignment this object is related to.
Definition at line 178 of file sequencesMatrix.h.
Referenced by sequencesMatrix().
|
private |
Matrix container.
It contains the sequences and residues of each sequence.
Definition at line 69 of file sequencesMatrix.h.
Referenced by getColumn(), getSequence(), operator=(), printMatrix(), sequencesMatrix(), setOrder(), and ~sequencesMatrix().
|
private |
Number of residues per sequence.
Definition at line 59 of file sequencesMatrix.h.
Referenced by getColumn(), getResidNumber(), getSequence(), operator=(), printMatrix(), sequencesMatrix(), setOrder(), and ~sequencesMatrix().
|
private |
Sequences names container.
Definition at line 74 of file sequencesMatrix.h.
Referenced by getSequence(), operator=(), sequencesMatrix(), and ~sequencesMatrix().
|
private |
Number of sequences in the matrix.
Definition at line 63 of file sequencesMatrix.h.
Referenced by getColumn(), getSeqNumber(), getSequence(), operator=(), printMatrix(), sequencesMatrix(), setOrder(), and ~sequencesMatrix().