OpenMS
|
This class contains functions that are used to calculate the global alignment score of two amino acid sequences. This class uses the Needleman-Wunsch algorithm. For match and mismatch it uses a similarity scoring matrix. More...
#include <OpenMS/ANALYSIS/SEQUENCE/NeedlemanWunsch.h>
Public Types | |
enum class | ScoringMatrix { identity , PAM30MS , SIZE_OF_SCORINGMATRIX } |
contains the valid matrices and the number of them More... | |
Public Member Functions | |
NeedlemanWunsch (ScoringMatrix matrix, int penalty) | |
Constructor that sets the scoring matrix and the gap penalty. More... | |
NeedlemanWunsch ()=default | |
Default constructor (scoring matrix PAM30MS and penalty 5) More... | |
~NeedlemanWunsch ()=default | |
Default destructor. More... | |
int | align (const String &seq1, const String &seq2) |
Calculates the similarity score of the global alignment of two amino acid sequences using Needleman-Wunsch- Algorithm. More... | |
void | setMatrix (const ScoringMatrix &matrix) |
sets the scoring matrix. Takes either a string or the enum ScoringMatrix. More... | |
void | setMatrix (const std::string &matrix) |
void | setPenalty (const int penalty) |
sets the cost of gaps More... | |
ScoringMatrix | getMatrix () const |
returns the scoring matrix More... | |
int | getPenalty () const |
returns the gap penalty More... | |
Static Public Attributes | |
static const std::vector< std::string > | NamesOfScoringMatrices |
Names of valid matrices. More... | |
Private Attributes | |
int | gap_penalty_ = 5 |
penalty for alignment score calculation More... | |
ScoringMatrix | my_matrix_ = ScoringMatrix::PAM30MS |
scoring matrix for the alignment score calculation More... | |
std::vector< int > | first_row_ {} |
alignment score calculation with two rows More... | |
std::vector< int > | second_row_ {} |
This class contains functions that are used to calculate the global alignment score of two amino acid sequences. This class uses the Needleman-Wunsch algorithm. For match and mismatch it uses a similarity scoring matrix.
|
strong |
NeedlemanWunsch | ( | ScoringMatrix | matrix, |
int | penalty | ||
) |
Constructor that sets the scoring matrix and the gap penalty.
|
default |
Default constructor (scoring matrix PAM30MS and penalty 5)
|
default |
Default destructor.
Calculates the similarity score of the global alignment of two amino acid sequences using Needleman-Wunsch- Algorithm.
ScoringMatrix getMatrix | ( | ) | const |
returns the scoring matrix
int getPenalty | ( | ) | const |
returns the gap penalty
void setMatrix | ( | const ScoringMatrix & | matrix | ) |
sets the scoring matrix. Takes either a string or the enum ScoringMatrix.
Exception | illegal argument is thrown if the input is not a member of the valid matrices. |
void setMatrix | ( | const std::string & | matrix | ) |
void setPenalty | ( | const int | penalty | ) |
sets the cost of gaps
|
private |
alignment score calculation with two rows
|
private |
penalty for alignment score calculation
|
private |
scoring matrix for the alignment score calculation
|
static |
Names of valid matrices.
|
private |