OpenMS
2.8.0
|
Scoring functions used by MRMScoring. More...
Classes | |
struct | XCorrArrayType |
Typedefs | |
Type defs and helper structures | |
typedef std::pair< int, double > | XCorrEntry |
Cross Correlation array contains (lag,correlation) pairs. More... | |
Functions | |
Helper functions | |
OPENSWATHALGO_DLLAPI double | NormalizedManhattanDist (double x[], double y[], int n) |
Calculate the normalized Manhattan distance between two arrays. More... | |
OPENSWATHALGO_DLLAPI double | RootMeanSquareDeviation (double x[], double y[], int n) |
Calculate the RMSD (root means square deviation) More... | |
OPENSWATHALGO_DLLAPI double | SpectralAngle (double x[], double y[], int n) |
Calculate the Spectral angle (acosine of the normalized dotproduct) More... | |
OPENSWATHALGO_DLLAPI XCorrArrayType | calcxcorr_legacy_mquest_ (std::vector< double > &data1, std::vector< double > &data2, bool normalize) |
OPENSWATHALGO_DLLAPI XCorrArrayType | normalizedCrossCorrelation (std::vector< double > &data1, std::vector< double > &data2, const int maxdelay, const int lag) |
OPENSWATHALGO_DLLAPI XCorrArrayType | normalizedCrossCorrelationPost (std::vector< double > &normalized_data1, std::vector< double > &normalized_data2, const int maxdelay, const int lag) |
Calculate crosscorrelation on std::vector data that is already normalized. More... | |
OPENSWATHALGO_DLLAPI XCorrArrayType | calculateCrossCorrelation (const std::vector< double > &data1, const std::vector< double > &data2, const int maxdelay, const int lag) |
Calculate crosscorrelation on std::vector data without normalization. More... | |
OPENSWATHALGO_DLLAPI XCorrArrayType::const_iterator | xcorrArrayGetMaxPeak (const XCorrArrayType &array) |
Find best peak in an cross-correlation (highest apex) More... | |
OPENSWATHALGO_DLLAPI void | standardize_data (std::vector< double > &data) |
Standardize a vector (subtract mean, divide by standard deviation) More... | |
OPENSWATHALGO_DLLAPI void | normalize_sum (double x[], unsigned int n) |
Divide each element of x by the sum of the vector. More... | |
OPENSWATHALGO_DLLAPI void | computeAndAppendRank (const std::vector< double > &v, std::vector< unsigned int > &ranks) |
Compute rank of vector elements and append it to ranks . More... | |
OPENSWATHALGO_DLLAPI void | computeRankVector (const std::vector< std::vector< double >> &intensity, std::vector< std::vector< unsigned int >> &ranks) |
Compute rank of vector elements for each row in a 2D array. More... | |
OPENSWATHALGO_DLLAPI double | rankedMutualInformation (std::vector< unsigned int > &ranked_data1, std::vector< unsigned int > &ranked_data2) |
Estimate mutual information between two vectors of ranks. More... | |
Scoring functions used by MRMScoring.
Many helper functions to calculate cross-correlations between data
typedef std::pair<int, double> XCorrEntry |
Cross Correlation array contains (lag,correlation) pairs.
OPENSWATHALGO_DLLAPI XCorrArrayType OpenSwath::Scoring::calculateCrossCorrelation | ( | const std::vector< double > & | data1, |
const std::vector< double > & | data2, | ||
const int | maxdelay, | ||
const int | lag | ||
) |
Calculate crosscorrelation on std::vector data without normalization.
OPENSWATHALGO_DLLAPI XCorrArrayType OpenSwath::Scoring::calcxcorr_legacy_mquest_ | ( | std::vector< double > & | data1, |
std::vector< double > & | data2, | ||
bool | normalize | ||
) |
Calculate crosscorrelation on std::vector data - Deprecated! Legacy code, this is a 1:1 port of the function from mQuest
OPENSWATHALGO_DLLAPI void OpenSwath::Scoring::computeAndAppendRank | ( | const std::vector< double > & | v, |
std::vector< unsigned int > & | ranks | ||
) |
Compute rank of vector elements and append it to ranks
.
Referenced by MRMTransitionGroupPicker::pickFragmentChromatograms().
OPENSWATHALGO_DLLAPI void OpenSwath::Scoring::computeRankVector | ( | const std::vector< std::vector< double >> & | intensity, |
std::vector< std::vector< unsigned int >> & | ranks | ||
) |
Compute rank of vector elements for each row in a 2D array.
OPENSWATHALGO_DLLAPI void OpenSwath::Scoring::normalize_sum | ( | double | x[], |
unsigned int | n | ||
) |
Divide each element of x by the sum of the vector.
OPENSWATHALGO_DLLAPI XCorrArrayType OpenSwath::Scoring::normalizedCrossCorrelation | ( | std::vector< double > & | data1, |
std::vector< double > & | data2, | ||
const int | maxdelay, | ||
const int | lag | ||
) |
Calculate crosscorrelation on std::vector data (which is first normalized) NOTE: this replaces calcxcorr
Referenced by MRMTransitionGroupPicker::computeQuality_().
OPENSWATHALGO_DLLAPI XCorrArrayType OpenSwath::Scoring::normalizedCrossCorrelationPost | ( | std::vector< double > & | normalized_data1, |
std::vector< double > & | normalized_data2, | ||
const int | maxdelay, | ||
const int | lag | ||
) |
Calculate crosscorrelation on std::vector data that is already normalized.
OPENSWATHALGO_DLLAPI double OpenSwath::Scoring::NormalizedManhattanDist | ( | double | x[], |
double | y[], | ||
int | n | ||
) |
Calculate the normalized Manhattan distance between two arrays.
Equivalent to the function "delta_ratio_sum" from mQuest to calculate similarity between library intensity and experimental ones.
The delta_ratio_sum is calculated as follows:
OPENSWATHALGO_DLLAPI double OpenSwath::Scoring::rankedMutualInformation | ( | std::vector< unsigned int > & | ranked_data1, |
std::vector< unsigned int > & | ranked_data2 | ||
) |
Estimate mutual information between two vectors of ranks.
Referenced by MRMTransitionGroupPicker::pickFragmentChromatograms().
OPENSWATHALGO_DLLAPI double OpenSwath::Scoring::RootMeanSquareDeviation | ( | double | x[], |
double | y[], | ||
int | n | ||
) |
Calculate the RMSD (root means square deviation)
The RMSD is calculated as follows:
OPENSWATHALGO_DLLAPI double OpenSwath::Scoring::SpectralAngle | ( | double | x[], |
double | y[], | ||
int | n | ||
) |
Calculate the Spectral angle (acosine of the normalized dotproduct)
The spectral angle is calculated as follows:
OPENSWATHALGO_DLLAPI void OpenSwath::Scoring::standardize_data | ( | std::vector< double > & | data | ) |
Standardize a vector (subtract mean, divide by standard deviation)
OPENSWATHALGO_DLLAPI XCorrArrayType::const_iterator OpenSwath::Scoring::xcorrArrayGetMaxPeak | ( | const XCorrArrayType & | array | ) |
Find best peak in an cross-correlation (highest apex)
Referenced by MRMTransitionGroupPicker::computeQuality_().