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.
- 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
Hexoses (pyranose and furanose forms), pentoses, and common derivatives including GlcNAc, GalNAc, NeuAc, Fuc, and others. See src/sugars.ts for the full list.
npm install glycansimport { 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 descriptorsimport { getMoleculeFromIupacCondensed } from 'glycans';
const molecule = getMoleculeFromIupacCondensed('Glc(β1-4)Glc');
console.log(molecule.toMolfile());npm install
npm testRun the fragmentation benchmark (requires benchmark data in src/benchmark/data/):
npm run benchmark