10 #include "alignment.h" 12 #include "chromSimMatrix.h" 13 #include "alignment.h" 14 #include "gapPenalty.h" 15 #include "affinealignobj.h" 16 #include "affinealignment.h" 17 #include "constrainMat.h" 94 const std::vector<std::vector<double> > & r1,
95 const std::vector<std::vector<double> > & r2,
96 std::string alignType,
97 const std::vector<double>& tA,
const std::vector<double>& tB,
98 const std::string & normalization,
const std::string& simType,
99 double B1p = 0.0,
double B2p =0.0,
101 double goFactor = 0.125,
double geFactor = 40,
102 double cosAngleThresh = 0.3,
bool OverlapAlignment =
true,
103 double dotProdThresh = 0.96,
double gapQuantile = 0.5,
104 bool hardConstrain =
false,
double samples4gradient = 100.0)
107 obj.
reset(s.n_row + 1, s.n_col + 1);
110 if (alignType ==
"hybrid")
113 MASK.n_row = tA.size();
114 MASK.n_col = tB.size();
115 MASK.
data.resize(MASK.n_row*MASK.n_col, 0.0);
116 double A1 = tA[0], A2 = tA[MASK.n_row-1];
117 double B1 = tB[0], B2 = tB[MASK.n_col-1];
119 auto maxIt = max_element(std::begin(s.
data), std::end(s.
data));
120 double maxVal = *maxIt;
141 const std::vector<std::vector<double>>& d2,
142 const std::string& Normalization,
143 const std::string& SimType,
144 double cosAngleThresh,
145 double dotProdThresh)
void getAffineAlignedIndices(AffineAlignObj &obj, int bandwidth=0)
Compute path using AffineAlignObj.
Definition: CppInterface.hpp:175
void alignChromatogramsCpp(AffineAlignObj &obj, const std::vector< std::vector< double > > &r1, const std::vector< std::vector< double > > &r2, std::string alignType, const std::vector< double > &tA, const std::vector< double > &tB, const std::string &normalization, const std::string &simType, double B1p=0.0, double B2p=0.0, int noBeef=0, double goFactor=0.125, double geFactor=40, double cosAngleThresh=0.3, bool OverlapAlignment=true, double dotProdThresh=0.96, double gapQuantile=0.5, bool hardConstrain=false, double samples4gradient=100.0)
Align two pairs of chromatograms derived from two LC-MS/MS experiments A and B.
Definition: CppInterface.hpp:93
void calcNoBeefMask(SimMatrix &MASK, double A1, double A2, double B1, double B2, double B1p, double B2p, int noBeef, bool hardConstrain)
Fill a diagonal strip with one through the matrix MASK.
Definition: constrainMat.cpp:13
An affine alignment object.
Definition: affinealignobj.h:44
void getAffineAlignedIndices(AffineAlignObj &affineAlignObj, int bandwidth)
Calculates aligned indices for source signal A and B, additionaly, builds an alignment path matrix wi...
Definition: affinealignment.cpp:193
void reset(int ROW_SIZE, int COL_SIZE)
Reset object to initial state (without allocating new memory)
Definition: affinealignobj.h:109
Generic namespace for all classes and functions of DIAlign.
Definition: affinealignment.cpp:29
void constrainSimilarity(SimMatrix &s, const SimMatrix &MASK, double constrainVal)
Applies the mask from calcNoBeefMask() on the similarity matrix.
Definition: constrainMat.cpp:71
std::vector< double > data
Similarity data.
Definition: similarityMatrix.h:16
Similarity matrix.
Definition: similarityMatrix.h:14
SimMatrix getSimilarityMatrix(const std::vector< std::vector< double >> &d1, const std::vector< std::vector< double >> &d2, const std::string Normalization, const std::string SimType, double cosAngleThresh, double dotProdThresh)
Returns a similarity matrix between d1 and d2 vector of vectors.
Definition: chromSimMatrix.cpp:324
void doAffineAlignment(AffineAlignObj &affineAlignObj, const SimMatrix &s, double go, double ge, bool OverlapAlignment)
Performs affine alignment on similarity-score matrix DIAlign::SimMatrix and fills M...
Definition: affinealignment.cpp:38
double getGapPenalty(const SimMatrix &s, double gapQuantile, std::string SimType)
returns a gap penalty from the distribution of similarity scores.
Definition: gapPenalty.cpp:5
SimMatrix getSimilarityMatrix(const std::vector< std::vector< double >> &d1, const std::vector< std::vector< double >> &d2, const std::string &Normalization, const std::string &SimType, double cosAngleThresh, double dotProdThresh)
Calculates similarity matrix of two fragment-ion chromatogram groups or extracted-ion chromatograms (...
Definition: CppInterface.hpp:140
void doAffineAlignment(AffineAlignObj &obj, const SimMatrix &s, double goPenalty, double gePenalty, bool OverlapAlignment)
Performs affine alignment on a given alignment object.
Definition: CppInterface.hpp:161