R/6_zzz.R
calculate_confidence_level.Rd
This function calculates the confidence level for each annotation based on the presence or absence of m/z error, retention time (RT) error, and spectral similarity (SS).
calculate_confidence_level(annotation_result)
A numeric vector of confidence levels (1, 2, or 3) for each annotation in the input data.
The function assigns a confidence level to each annotation according to the following rules:
All of `mz.error`, `RT.error`, and `SS` are available (not NA).
Any two of the three (`mz.error`, `RT.error`, or `SS`) are available.
Only one or none of `mz.error`, `RT.error`, or `SS` is available.
if (FALSE) { # \dontrun{
# Assuming `my_annotation_result` is the annotation data frame:
confidence_levels <- calculate_confidence_level(my_annotation_result)
} # }