mutate_annotation_table: Update Annotation Table in a mass_dataset Object

View source: R/mutate_annotation_table.R

mutate_annotation_tableR Documentation

Update Annotation Table in a mass_dataset Object

Description

This function updates the annotation table in a mass_dataset object by appending new annotation data and retaining only the top annotations based on the total score.

Usage

mutate_annotation_table(object, annotation_table)

Arguments

object

A mass_dataset object containing the existing annotation table.

annotation_table

A data frame containing new annotation data to be added to the mass_dataset object. The table should contain specific columns as detailed below.

Details

This function allows you to update or append new annotations to the existing annotation table in a mass_dataset object. The function ensures that the new annotations are properly arranged based on the Total.score, and it retains only the top annotations for each variable_id based on the specified candidate.num.

The annotation_table must contain the following columns:

variable_id

The unique identifier for each variable.

ms2_files_id

The ID of the MS2 file associated with each annotation.

ms2_spectrum_id

The ID of the MS2 spectrum associated with each annotation.

Compound.name

The name of the annotated compound.

CAS.ID

The CAS ID of the compound.

HMDB.ID

The HMDB ID of the compound.

KEGG.ID

The KEGG ID of the compound.

Lab.ID

The lab identifier for the compound.

Adduct

The adduct form of the compound.

mz.error

The error in m/z matching.

mz.match.score

The score for the m/z match.

RT.error

The error in retention time matching.

RT.match.score

The score for the retention time match.

CE

Collision energy used in MS2 matching.

SS

Spectral similarity score for MS2 matching.

Total.score

The total score for the annotation.

Database

The database used for annotation.

Level

The confidence level of the annotation.

Value

The function returns the updated mass_dataset object with the appended and processed annotation table.

Examples

## Not run: 
# Example usage
updated_object <- mutate_annotation_table(
  object = my_dataset,
  annotation_table = new_annotation_data
)

## End(Not run)



tidymass/massdataset documentation built on Sept. 14, 2024, 4:41 p.m.