calculate_mz_match_score | R Documentation |
This function calculates the m/z match score based on the m/z error and the MS1 match tolerance in parts per million (ppm). The score is calculated using a Gaussian-like function.
calculate_mz_match_score(mz.error, ms1.match.ppm = 25)
mz.error |
Numeric vector. The m/z error values between experimental and reference m/z values. |
ms1.match.ppm |
Numeric. The MS1 match tolerance in parts per million (ppm). Default is 25. |
The m/z match score is computed using a Gaussian-like function where the error is normalized by the MS1 match tolerance ('ms1.match.ppm'). Lower m/z errors result in higher match scores.
A numeric vector representing the m/z match score for each m/z error. The score is calculated using the formula: exp(-0.5 * (mz.error / ms1.match.ppm)^2)
.
## Not run:
# Example m/z errors
mz_errors <- c(10, 15, 5, 20)
# Calculate m/z match scores with a default tolerance of 25 ppm
scores <- calculate_mz_match_score(mz.error = mz_errors, ms1.match.ppm = 25)
print(scores)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.