calculate_confidence_level: Calculate Confidence Level for Metabolite Annotations

calculate_confidence_levelR Documentation

Calculate Confidence Level for Metabolite Annotations

Description

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

Usage

calculate_confidence_level(annotation_result)

Arguments

annotation_result

A data frame containing the annotation results, including the columns 'mz.error', 'RT.error', and 'SS'.

Details

The function assigns a confidence level to each annotation according to the following rules:

1

All of 'mz.error', 'RT.error', and 'SS' are available (not NA).

2

Any two of the three ('mz.error', 'RT.error', or 'SS') are available.

3

Only one or none of 'mz.error', 'RT.error', or 'SS' is available.

Value

A numeric vector of confidence levels (1, 2, or 3) for each annotation in the input data.

See Also

annotate_metabolites, plot_ms2_matching

Examples

## Not run: 
# Assuming `my_annotation_result` is the annotation data frame:
confidence_levels <- calculate_confidence_level(my_annotation_result)

## End(Not run)


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