glycans
v0.2.1
Published
Deals with glycans and their mass fragmentation
Readme
glycans
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)GlcorNeuAc(α2-3)Gal(β1-4)GlcNAcinto 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 glycansUsage
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 descriptorsGet an OpenChemLib molecule
import { getMoleculeFromIupacCondensed } from 'glycans';
const molecule = getMoleculeFromIupacCondensed('Glc(β1-4)Glc');
console.log(molecule.toMolfile());Development
npm install
npm testRun the fragmentation benchmark (requires benchmark data in src/benchmark/data/):
npm run benchmark