calculate_mz_match_score: Calculate m/z Match Score

calculate_mz_match_scoreR Documentation

Calculate m/z Match Score

Description

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.

Usage

calculate_mz_match_score(mz.error, ms1.match.ppm = 25)

Arguments

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.

Details

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.

Value

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).

Examples

## 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)



tidymass/metid documentation built on Oct. 8, 2024, 10:32 p.m.