Alignment::sequencesMatrix Class Reference

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...
 
sequencesMatrixoperator= (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...
 
Alignmentalig
 Pointer to the alignment this object is related to. More...
 

Detailed Description

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:

  • Statistics::Consistency::compareAndChoose
  • Statistics::Consistency::forceComparison

Definition at line 55 of file sequencesMatrix.h.

Constructor & Destructor Documentation

◆ sequencesMatrix() [1/3]

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.

◆ sequencesMatrix() [2/3]

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.

Parameters
alignmentMatrixSequences of the alignment to convert to sequenceMatrix
alignmentSeqsNameSequences names
sequencesNumber of sequences
residuesNumber of residues

Definition at line 79 of file sequencesMatrix.cpp.

References utils::initlVect(), matrix, resNumber, seqsName, and seqsNumber.

+ Here is the call graph for this function:

◆ sequencesMatrix() [3/3]

Alignment::sequencesMatrix::sequencesMatrix ( Alignment parent)
explicit

Automatic constructor.

This construction method initializes all attributes using the information present in the alignment pointer passed.

Parameters
parentAlignment 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~sequencesMatrix()

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.

Member Function Documentation

◆ getColumn() [1/2]

void Alignment::sequencesMatrix::getColumn ( int  column,
int *  numResidueseqMatrix 
)

Method to get a column out of the matrix.

Parameters
columnColumn number at sequences matrix.
[out]numResidueseqMatrixVector 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().

+ Here is the caller graph for this function:

◆ getColumn() [2/2]

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.

Parameters
valueto look in a row's sequences matrix.
rowwhere to look for a value.
columnSeqMatrixVector 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().

+ Here is the caller graph for this function:

◆ getResidNumber()

int Alignment::sequencesMatrix::getResidNumber ( void  )

Number of residues getter.

Returns
Number of residues.

Definition at line 251 of file sequencesMatrix.cpp.

References resNumber.

◆ getSeqNumber()

int Alignment::sequencesMatrix::getSeqNumber ( void  )

Number of sequences getter.

Returns
Number of sequences.

Definition at line 244 of file sequencesMatrix.cpp.

References seqsNumber.

◆ getSequence()

bool Alignment::sequencesMatrix::getSequence ( string  seqName,
int *  sequence 
)

Method to obtain a sequence based on its name.

Parameters
seqNameName of the sequence to find.
[out]sequenceWhere to store the sequence.
Returns
True if found. False if not.

Definition at line 225 of file sequencesMatrix.cpp.

References matrix, resNumber, seqsName, and seqsNumber.

◆ operator=()

Alignment::sequencesMatrix & Alignment::sequencesMatrix::operator= ( const sequencesMatrix old)

Definition at line 110 of file sequencesMatrix.cpp.

References matrix, resNumber, seqsName, and seqsNumber.

◆ printMatrix()

void Alignment::sequencesMatrix::printMatrix ( void  )

Sequences Matrix printing method.

Method that prints the alignment sequences matrix.

Warning
Not In Use

Definition at line 152 of file sequencesMatrix.cpp.

References matrix, resNumber, and seqsNumber.

◆ setOrder()

void Alignment::sequencesMatrix::setOrder ( int *  order)

Method that reorders the stored sequences with a given order list.

Parameters
orderPointer 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().

+ Here is the caller graph for this function:

Member Data Documentation

◆ alig

Alignment* Alignment::sequencesMatrix::alig
private

Pointer to the alignment this object is related to.

Definition at line 178 of file sequencesMatrix.h.

Referenced by sequencesMatrix().

◆ matrix

int** Alignment::sequencesMatrix::matrix
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().

◆ resNumber

int Alignment::sequencesMatrix::resNumber
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().

◆ seqsName

string* Alignment::sequencesMatrix::seqsName
private

Sequences names container.

Definition at line 74 of file sequencesMatrix.h.

Referenced by getSequence(), operator=(), sequencesMatrix(), and ~sequencesMatrix().

◆ seqsNumber

int Alignment::sequencesMatrix::seqsNumber
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().


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