MMaskNGly

MaskNGly

Predict N-glycosylation sites with a mask-and-probe strategy from ESM-2 embeddings.

The method

From sequence to glycosylation propensity

MaskNGly probes contextual coupling within protein language model embeddings to identify potential N-glycosylation sites. No supervised glycosylation training or labeled glycosylation dataset is required: the method reads signals from pretrained ESM-2 embeddings for cross-species, omics-scale analysis.

  • Training-free readout
  • Independent of labeled glycosylation data
  • Omics-scale
  • Cross-species
Figure 1: ESM-2 extracts sequence embeddings; direct readout of N-X-S/T contextual coupling enables training-free, cross-species glycosylation prediction.
Figure 1 · Training-free protein N-glycosylation prediction.
  1. Find candidate sites

    Enter a UniProt accession to retrieve its protein sequence, or paste a sequence directly. MaskNGly scans for N-X-S/T sequons, where X is any residue except proline and N is the candidate attachment site.

    Each candidate is recorded by its residue position and local sequence context. When a matching AlphaFold model is available, these positions are mapped onto the structure for exploration.

  2. Mask and score

    Mask N at i and S/T at j = i + 2 separately. Measure the ESM-2 embedding change relative to the unmasked protein at the partner residue as Cij = ‖Ej(mask i) − Ej‖2.

    Min–max normalize each response across the full sequence to obtain Cij and Cji. The GP score averages these two directional couplings: GP = (Cij + Cji)/2. This paired readout measures how strongly the two sequon residues depend on one another in their sequence context.

  3. Predict and explore

    Apply the 0.5 operating threshold: scores ≥ 0.5 are positive and scores < 0.5 are negative. Select a candidate to inspect its GP score, surrounding sequence, and position in the protein structure.

    Rotate the model or show its surface to explore structural context. UniProt experimental evidence and publication links distinguish predicted candidates from sites supported by published experiments.

Database coverage

Across species, at omics scale

Download datasets Verified 2026-09-16
48species represented
1,496,193scored candidate sites
316,121positive predictions (≥ 0.5)
Positive · 316,121Negative · 1,180,072
Explore all 48 species
Ajellomyces capsulatus
22,438 sites
Arabidopsis thaliana
67,210 sites
Brugia malayi
27,702 sites
Caenorhabditis elegans
51,199 sites
Campylobacter jejuni
3,450 sites
Candida albicans
28,277 sites
Cladophialophora carrionii
25,291 sites
Danio rerio
78,322 sites
Dictyostelium discoideum
90,039 sites
Dracunculus medinensis
28,761 sites
Drosophila melanogaster
44,409 sites
Enterococcus faecium
4,237 sites
Escherichia coli
5,802 sites
Fonsecaea pedrosoi
29,853 sites
Glycine max
145,112 sites
Haemophilus influenzae
2,673 sites
Helicobacter pylori
3,037 sites
Homo sapiens
59,389 sites
Klebsiella pneumoniae
6,106 sites
Leishmania infantum
17,568 sites
Madurella mycetomatis
20,318 sites
Methanocaldococcus jannaschii
2,180 sites
Mus musculus
57,649 sites
Mycobacterium leprae
1,539 sites
Mycobacterium tuberculosis
3,167 sites
Mycobacterium ulcerans
4,003 sites
Neisseria gonorrhoeae
2,264 sites
Nocardia brasiliensis
5,500 sites
Onchocerca volvulus
34,590 sites
Oryza sativa
62,119 sites
Paracoccidioides lutzii
22,013 sites
Plasmodium falciparum
45,696 sites
Pseudomonas aeruginosa
4,803 sites
Rattus norvegicus
54,789 sites
Saccharomyces cerevisiae
26,471 sites
Salmonella typhimurium
5,991 sites
Schistosoma mansoni
96,369 sites
Schizosaccharomyces pombe
17,708 sites
Shigella dysenteriae
4,706 sites
Sporothrix schenckii
23,508 sites
Staphylococcus aureus
4,818 sites
Streptococcus pneumoniae
2,767 sites
Strongyloides stercoralis
57,351 sites
Trichuris trichiura
22,554 sites
Trypanosoma brucei
21,542 sites
Trypanosoma cruzi
49,874 sites
Wuchereria bancrofti
29,529 sites
Zea mays
71,500 sites
P0DOX5Homo sapiens449 aa

Immunoglobulin gamma-1 heavy chain

View UniProt record
Interactive structure

Sites mapped in three dimensions

Positioning the structure…
Datasets

Download

Download each dataset as a ZIP archive containing its CSV files.

Source code

Run MaskNGly locally

MaskNGly measures ESM-2 embedding changes after masking individual residues and scores N-X-S/T candidate sites.

Setup

If uv is not installed, run curl -LsSf https://astral.sh/uv/install.sh | sh on macOS/Linux; see the installation guide for other platforms.

Requires Python 3.11 or 3.12. The esm2_t33_650M_UR50D weights are downloaded on first use. Use --device cuda when CUDA is available.

uv sync --extra inference --extra plot --extra evaluation

Usage

The example contains the 193-residue human erythropoietin precursor (UniProt P01588, sequence version 1). Candidate sites are detected at positions 51, 65, and 110 using full precursor numbering.

uv run maskngly --input examples/P01588.fasta --output outputs/scores.csv

Each run computes influence matrices and writes site scores to the CSV. Add --save-npy to retain the matrices and --save-png to export a profile for each candidate site:

uv run maskngly --input examples/P01588.fasta --output outputs/scores.csv --save-npy --save-png

With this output path, matrices are saved under outputs/scores/matrices/ and profiles under outputs/scores/profiles/. Profile axes use 1-based protein positions. --radius controls the profile window (default: 50 residues).

FASTA headers may specify candidate N positions as Sites: 51,65,110; otherwise N-X-S/T sites are detected automatically. Sequences over 1,022 residues use a model-sized window around each candidate site. CSV columns include the protein ID, position, motif, score, prediction, and window start.

Scores use the S/T-mask response at N, min–max normalized across the full row, and predict positive above --threshold 0.5. --mode paired averages both directional responses. Scores measure embedding influence. --batch-size defaults to 8; --device defaults to cpu.

Add --labels labels.csv to write fixed-threshold and Youden-threshold metrics to outputs/scores_evaluation.csv. Labels use protein_id,position,label with both binary classes present. Validate tuned thresholds on a separate dataset.

Run uv run maskngly --help for all options and uv build to build distribution archives.

Source repository: NJUBiophysics/maskngly on GitHub ↗