31 #include "Alignment/sequencesMatrix.h" 32 #include "Alignment/Alignment.h" 38 StartTiming(
"Alignment::sequencesMatrix::sequencesMatrix(void) ");
51 StartTiming(
"Alignment::sequencesMatrix::sequencesMatrix(Alignment *parent) ");
67 for (i = 0, k = 1; i <
seqsNumber; i++, k = 1) {
82 StartTiming(
"Alignment::sequencesMatrix::sequencesMatrix(string *alignmentMatrix, string *alignmentSeqsName, int sequences, int residues) ");
100 for (i = 0, k = 1; i <
seqsNumber; i++, k = 1) {
102 if (alignmentMatrix[i][j] !=
'-') {
136 StartTiming(
"Alignment::sequencesMatrix::~sequencesMatrix(void) ");
155 StartTiming(
"void Alignment::sequencesMatrix::printMatrix(void) ");
160 for (k = i; k < (20 + i) && k <
resNumber; k++) {
161 cout << setw(4) <<
matrix[j][k] <<
" ";
172 StartTiming(
"void Alignment::sequencesMatrix::getColumn(int column, int *columnSeqMatrix) ");
177 columnSeqMatrix[i] =
matrix[i][column];
181 columnSeqMatrix[i] = 0;
188 StartTiming(
"void Alignment::sequencesMatrix::getColumn(int value, int row, int *columnSeqMatrix) ");
192 if (
matrix[row][i] == value)
break;
196 columnSeqMatrix[j] =
matrix[j][i];
200 columnSeqMatrix[j] = -1;
206 StartTiming(
"void Alignment::sequencesMatrix::setOrder(int *order) ");
215 resg[i][j] =
matrix[order[i]][j];
219 matrix[i][j] = resg[i][j];
228 StartTiming(
"bool Alignment::sequencesMatrix::getSequence(string seqName, int *sequence) ");
232 if (
seqsName[pos].compare(seqName) == 0)
239 sequence[i] =
matrix[pos][i];
247 StartTiming(
"int Alignment::sequencesMatrix::getSeqNumber(void) ");
254 StartTiming(
"int Alignment::sequencesMatrix::getResidNumber(void) ");
Alignment * alig
Pointer to the alignment this object is related to.
int getSeqNumber()
Number of sequences getter.
sequencesMatrix(string *alignmentMatrix, string *alignmentSeqsName, int sequences, int residues)
Manual constructor.
#define StartTiming(name)
int resNumber
Number of residues per sequence.
std::string * sequences
Vector containing the sequences.
Class containing an alignment This class stores the alignment sequences with it's names...
void getColumn(int column, int *numResidueseqMatrix)
Method to get a column out of the matrix.
int originalNumberOfResidues
Number of residues the alignment had when it was loaded.
void initlVect(int *vector, int tam, int valor)
Vector initialization.
sequencesMatrix & operator=(const sequencesMatrix &)
bool getSequence(string seqName, int *sequence)
Method to obtain a sequence based on its name.
int getResidNumber()
Number of residues getter.
std::string * seqsName
String vector containing the sequences names.
int originalNumberOfSequences
Number of sequences the alignment had when it was loaded.
sequencesMatrix()
Null constructor.
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 ...
void printMatrix()
Sequences Matrix printing method.
~sequencesMatrix()
Destructor.
Utilities class. This class contains shared methods to be used in multiple parts of the code...
Internal Alignment Class that represents a sequences matrix.
void setOrder(int *order)
Method that reorders the stored sequences with a given order list.
string * seqsName
Sequences names container.
int seqsNumber
Number of sequences in the matrix.
int ** matrix
Matrix container. It contains the sequences and residues of each sequence.
sequencesMatrix(Alignment *parent)
Automatic constructor.