Skip to content

cheminfo/glycans

Repository files navigation

glycans

NPM version npm download test coverage license

Work in progress. This library is under active development. APIs may change without notice.

TypeScript library for working with glycans: parsing IUPAC condensed notation, building 2D molecular structures, and performing mass spectrometry fragmentation analysis.

Features

  • IUPAC condensed parsing — parse glycan sequences such as Glc(β1-4)Glc or NeuAc(α2-3)Gal(β1-4)GlcNAc into structured unit and link objects
  • Molecule assembly — reconstruct a full glycan molecule (OpenChemLib Molecule) from parsed units with correct stereochemistry at glycosidic bonds (α/β)
  • Fragmentation benchmark tooling — scripts for running MS² and MS³ fragmentation predictions against reference spectra, with parallel worker support and ranked candidate output

Supported monosaccharides

Hexoses (pyranose and furanose forms), pentoses, and common derivatives including GlcNAc, GalNAc, NeuAc, Fuc, and others. See src/sugars.ts for the full list.

Installation

npm install glycans

Usage

Parse IUPAC condensed notation

import { parseIupacCondensed } from 'glycans';

const parsed = parseIupacCondensed('Glc(β1-4)Glc');
// parsed.units — array of monosaccharide units with SMILES and atom labels
// parsed.links — array of glycosidic bond descriptors

Get an OpenChemLib molecule

import { getMoleculeFromIupacCondensed } from 'glycans';

const molecule = getMoleculeFromIupacCondensed('Glc(β1-4)Glc');
console.log(molecule.toMolfile());

Development

npm install
npm test

Run the fragmentation benchmark (requires benchmark data in src/benchmark/data/):

npm run benchmark

License

MIT

About

Deals with glycans and their mass fragmentation

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors