
Update Annotation Table in a mass_dataset Object
Source:R/mutate_annotation_table.R
mutate_annotation_table.RdThis 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.
Value
The function returns the updated mass_dataset object with the appended and processed annotation table.
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.