calculate_rt_match_score: Calculate Retention Time (RT) Match Score

calculate_rt_match_scoreR Documentation

Calculate Retention Time (RT) Match Score

Description

This function calculates the retention time (RT) match score based on the RT error and the RT match tolerance. The score is calculated using a Gaussian-like function.

Usage

calculate_rt_match_score(RT.error, rt.match.tol = 30)

Arguments

RT.error

Numeric vector. The RT error values between experimental and reference RT values.

rt.match.tol

Numeric. The RT match tolerance in seconds. Default is 30.

Details

The RT match score is computed using a Gaussian-like function where the RT error is normalized by the RT match tolerance ('rt.match.tol'). Lower RT errors result in higher match scores.

Value

A numeric vector representing the RT match score for each RT error. The score is calculated using the formula: exp(-0.5 * (RT.error / rt.match.tol)^2).

Examples

## Not run: 
# Example RT errors
rt_errors <- c(5, 10, 2, 25)

# Calculate RT match scores with a default tolerance of 30 seconds
scores <- calculate_rt_match_score(RT.error = rt_errors, rt.match.tol = 30)
print(scores)

## End(Not run)



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