R package for annotation of glycans in mass spectrometry data.
This is a quick tutorial for how to use GlycoAnnotateR in conjuction with mzMine, a popular GUI-based tool for MS data analysis. In this tutorial I am using mzMine version 4.4.3 to analyse the same LC-MS/MS data that is used in the simple GlycoAnnotateR tutorial. An enzyme digest of fucoidan, a sulfated fucan from brown algae, was separated by HILIC and detected with an Orbitrap. The data can be downloaded from the MassIVE server (f.MSV000095410/peak/MS31_20240618_newMpyrifera_digest_SIMddMS2_2.5uL_85%EtOH_11.mzML).
First, the data needs to be processed in mzMine. Since the mzMine documentation is excellent I will only briefly describe the steps here. I always used the default parameters unless specified.
Import the data to mzMine (Raw data methods –> Import MS data).
Detect masses (Raw data methods –> Spectra processing –> Mass detection)
Detect LC-MS peaks (Feature detection –> LC-MS –> Chromatogram builder)
Export feature list (Feature list methods –> Export feature list –> CSV)
Just a few lines of code are needed to annotate the feature list in R. For a detailed explanation of the annotation parameters see here
#load GlycoAnnotateR package and tidyverse
library(GlycoAnnotateR)
library(tidyverse)
#import exported feature list. make sure you are in the correct directory!
mzmine_export <- read_csv('export_mzmine.csv', show_col_types = F)
#set parameters for annotation
#change as needed for your data
param <- glycoPredictParam(
#degree of polymerisation data
dp = c(1, 10),
#modifications
modifications = c('sulfate', 'deoxy'),
#is double sulfation possible?
double_sulfate = T,
#maximum number of monomers per modification
nmod_max = 3,
#adducts
adducts = 'H',
#polarity
polarity = 'neg',
#ionisation type
ion_type = 'ESI',
#mass range
scan_range = c(145, 1500))
#annotate exported feature list
mzmine_export_annot <- glycoAnnotate(mzmine_export,
#name of column with mz value to annotate
mz_column = 'mz',
#parameters for composition prediction
param = param,
#error tolerance for annotation
error = 3.5, error_units = 'ppm')
#filter annotated feature list to only contain annotated features
#and format for import into mzmine
mzmine_export_annotonly <- mzmine_export_annot %>%
#filter for only annotated features
drop_na(`IUPAC name`) %>%
#rename columns to match mzmine requirements
rename(`neutral mass` = mass,
name = `IUPAC name`, #this will be the composition description
adduct = ion) %>%
#select columns
select(mz, rt, `neutral mass`, name, adduct, formula)
#write formatted and filtered table to file
write_csv(mzmine_export_annotonly, 'export_glycoannotateR.csv')
#print for inspection
print(mzmine_export_annotonly)
## mz rt neutral mass name adduct
## 1 243.1237 0.6425 3173.6954 Hex6 DeoxyHex4 Sulfate20 [M-13H]-13
## 2 243.0178 0.9809 244.0253 DeoxyHex1 Sulfate1 [M-H]-
## 3 234.0123 1.3713 470.0400 DeoxyHex2 Sulfate2 [M-2H]-2
## 4 313.9686 6.7659 629.9536 DeoxyHex2 Sulfate4 [M-2H]-2
## 5 386.9985 7.8018 776.0116 DeoxyHex3 Sulfate4 [M-2H]-2
## 6 426.9768 9.8313 855.9684 DeoxyHex3 Sulfate5 [M-2H]-2
## 7 500.0064 11.3063 1002.0263 DeoxyHex4 Sulfate5 [M-2H]-2
## 8 539.9851 13.3453 1081.9831 DeoxyHex4 Sulfate6 [M-2H]-2
## 9 466.9552 13.9708 935.9252 DeoxyHex3 Sulfate6 [M-2H]-2
## 10 579.9630 15.3721 1161.9399 DeoxyHex4 Sulfate7 [M-2H]-2
## 11 692.9713 17.5747 1387.9546 DeoxyHex5 Sulfate8 [M-2H]-2
## 12 766.0006 18.4773 1534.0125 DeoxyHex6 Sulfate8 [M-2H]-2
## formula
## 1 C60H102O107S20
## 2 C6H12O8S
## 3 C12H22O15S2
## 4 C12H22O21S4
## 5 C18H32O25S4
## 6 C18H32O28S5
## 7 C24H42O32S5
## 8 C24H42O35S6
## 9 C18H32O31S6
## 10 C24H42O38S7
## 11 C30H52O45S8
## 12 C36H62O49S8
The exported csv can then be used as a ‘database’ for targeted feature detection in mzMine. This can be done by selecting ‘Feature detection –> LC-MS –> Targeted feature detection’ in mzMine. The file exported from R should be selected as the ‘Database file’. The following columns should be checked: neutral mass, mz, rt, formula, adduct, and name (and then press OK). This will create a new feature list in mzMine with only the annotated features, and will show the annotated compositions under ‘Compound DB’.
MS/MS spectra can be associated (Feature list methods –> Processing –> Assign MS2 features) to features, exported, and annotated in a similar way as the MS1 features.