DIAlign
|
Generic namespace for all classes and functions of DIAlign. More...
Namespaces | |
AffineAlignment | |
Includes functions for the affine-alignment through a score-matrix using gap-opening and gap-closing penalties. | |
Alignment | |
Contains some of the core alignment functions for non-affine alignment. | |
ConstrainMatrix | |
Namespace for constraing similarity score matrix. | |
SimilarityMatrix | |
Similarity matrix namespace. | |
Traceback | |
Generic namespace for Traceback that includes source matrix name and the arrow direction. | |
Utils | |
Utility namespace. | |
Classes | |
struct | AffineAlignObj |
An affine alignment object. More... | |
struct | AlignedIndices |
Includes aligned indices of signal A and signal B with the cumulative score. More... | |
struct | AlignObj |
An alignment object (for non-affine alignment) More... | |
struct | SimMatrix |
Similarity matrix. More... | |
struct | SimMatrix_bool |
Path matrix. More... | |
Functions | |
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. More... | |
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 (XICs) derived from two LC-MS/MS experiments A and B. More... | |
void | doAffineAlignment (AffineAlignObj &obj, const SimMatrix &s, double goPenalty, double gePenalty, bool OverlapAlignment) |
Performs affine alignment on a given alignment object. More... | |
void | getAffineAlignedIndices (AffineAlignObj &obj, int bandwidth=0) |
Compute path using AffineAlignObj. More... | |
double | getGapPenalty (const SimMatrix &s, double gapQuantile, std::string SimType) |
returns a gap penalty from the distribution of similarity scores. More... | |
double | areaBwBoundaries (std::vector< std::vector< double > > vov, int leftIdx, int rightIdx) |
returns the summation of signals between leftIdx and rightIdx from vov. | |
Variables | |
const int | NA = 0 |
Generic namespace for all classes and functions of DIAlign.
This contains a brief description of the available functions in DIAlign. The DIAlign algorithm can be called through the interface provided by alignChromatogramsCpp(), which allows alignment of a set of chromatograms.
The AffineAlignObj will have the fields indexA_aligned, indexB_aligned and score populated, providing the aligned indices as output.
Individual functions that perform the alignment can be called through getSimilarityMatrix(), doAffineAlignment(), getAffineAlignedIndices().
void DIAlign::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.
obj | A object of type AffineAlignObj which needs to have at least capacity of the chromatogram length |
r1 | The first set of chromatograms, where each chromatogram is a vector of intensities. These chromatograms are XICs derived from a single analyte in run A |
r2 | The second set of chromatograms, where each chromatogram is a vector of intensities. These chromatograms are XICs derived from a single analyte in run B |
alignType | Available alignment methods, must be one of "global", "local" and "hybrid". |
tA | This vector has equally spaced timepoints of the XICs from run A. |
tB | This vector has equally spaced timepoints of the XICs from run B. |
normalization | Normalization method, must be one of "L2", "mean" or "none". |
simType | Similarity computation method, defines how similarity between two chromatographic points is computed. Must be one of (dotProductMasked, dotProduct, cosineAngle, cosine2Angle, euclideanDist, covariance, correlation). |
B1p | Timepoint mapped by global fit for tA[0]. |
B2p | Timepoint mapped by global fit for tA[tA.size()-1]. |
noBeef | It defines the distance from the global fit, upto which no penalization is performed. The window length will be chosen as = 2*noBeef. |
goFactor | Penalty for introducing first gap in alignment. This value is multiplied by base gap-penalty. |
geFactor | Penalty for introducing subsequent gaps in alignment. This value is multiplied by base gap-penalty. |
cosAngleThresh | In simType == dotProductMasked mode, angular similarity should be higher than cosAngleThresh otherwise similarity is forced to zero. |
OverlapAlignment | If alignment should be performed with free end-gaps. False: Global alignment, True: overlap alignment. |
dotProdThresh | In simType = dotProductMasked mode, values in similarity matrix higher than dotProdThresh quantile are checked for angular similarity. |
gapQuantile | Must be between 0 and 1. This is used to calculate base gap-penalty from similarity distribution. |
hardConstrain | Whether a hard constraint should be used for the similarity matrix. If false; indices farther from noBeef distance are filled with distance from linear fit line. |
samples4gradient | This parameter modulates penalization of masked indices. |
void DIAlign::doAffineAlignment | ( | AffineAlignObj & | obj, |
const SimMatrix & | s, | ||
double | goPenalty, | ||
double | gePenalty, | ||
bool | OverlapAlignment | ||
) |
Performs affine alignment on a given alignment object.
obj | A object of type AffineAlignObj which needs to have at least capacity of the chromatogram length |
s | A previously computed similarity matrix |
goPenalty | Penalty for introducing first gap in alignment. |
gePenalty | Penalty for introducing subsequent gaps in alignment. |
OverlapAlignment | If alignment should be performed with free end-gaps. False: Global alignment, True: overlap alignment. |
void DIAlign::getAffineAlignedIndices | ( | AffineAlignObj & | obj, |
int | bandwidth = 0 |
||
) |
Compute path using AffineAlignObj.
obj | A object of type AffineAlignObj which needs to have matrices A, B and M filled. |
bandwith | Compute path for multiple matrix cells (bandwith is number of cells to be computed) |
double DIAlign::getGapPenalty | ( | const SimMatrix & | s, |
double | gapQuantile, | ||
std::string | SimType | ||
) |
returns a gap penalty from the distribution of similarity scores.
For simType = "cosineAngle" and "cosine2Angle", gap penalty = 0.95 Other simType values, gap Penalty is the gapQuantile quantile from the score disctribution of s. gapQuantile must be between 0 and 1.
SimMatrix DIAlign::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 (XICs) derived from two LC-MS/MS experiments A and B.
d1 | The first set of chromatograms, where each chromatogram is a vector of intensities. These chromatograms are XICs derived from a single analyte in run A |
d2 | The second set of chromatograms, where each chromatogram is a vector of intensities. These chromatograms are XICs derived from a single analyte in run B |
Normalization | Normalization method, must be one of "L2", "mean" or "none". |
SimType | Similarity computation method, defines how similarity between two chromatographic points is computed. Must be one of (dotProductMasked, dotProduct, cosineAngle, cosine2Angle, euclideanDist, covariance, correlation). |
cosAngleThresh | In simType == dotProductMasked mode, angular similarity should be higher than cosAngleThresh otherwise similarity is forced to zero. |
dotProdThresh | In simType = dotProductMasked mode, values in similarity matrix higher than dotProdThresh quantile are checked for angular similarity. |