emdb is a JavaScript/TypeScript library designed for managing and querying databases of molecular formulas, primarily focused on exact mass calculations in cheminformatics. It is part of the larger 'mass-tools' monorepo maintained by cheminfo. The library is currently stable at version 7.56.0 (as of April 2026), demonstrating a rapid release cadence with multiple updates often shipped monthly, indicating very active development. Key functionalities include loading various predefined chemical databases (e.g., test, KnapSack, commercial, contaminants), creating custom molecular formula databases from structured arrays or Google Sheets, and providing robust utility modules for generating molecular formulas from peptide or nucleotide sequences. It enhances cheminformatics applications by offering precise mass calculations and comprehensive molecular formula manipulation, including detailed information such as exact mass, molecular weight, charge, OCL (Open Chemistry Libre), and mass spectrometry filter data.
npm install emdbVerified import paths — ran on the pinned version, not inferred.
Demonstrates loading a test database, using the MF utility, generating molecular formulas from peptide and nucleotide sequences, and creating a custom database from an array.
It is crucial to review the comprehensive changelog on GitHub for `cheminfo/mass-tools` when upgrading from older major versions to understand all breaking changes. Always install the latest stable version for new projects: `npm install emdb@latest`.
Always prefer `import emdb from 'emdb';` for the main library and access its utilities via `emdb.Util.XYZ`. Ensure your `tsconfig.json` and `package.json` are correctly configured for your chosen module system (e.g., `"type": "module"` in `package.json` for ESM).
Access all utilities through the default `emdb` import: `import emdb from 'emdb'; const mf = new emdb.Util.MF(...);`
Replace `const emdb = require('emdb');` with `import emdb from 'emdb';` to use the ESM syntax.Verify that `emdb` is correctly imported as a default export (`import emdb from 'emdb';`) and that `emdb.Util.MF` is properly accessed and instantiated using `new`.
Ensure `emdb` is imported as the default export and that `Util` and `Peptide` are correctly accessed as properties: `emdb.Util.Peptide.sequenceToMF(...)`. Double-check method casing and arguments.
No dependency data recorded yet.