Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

multiplet-analysis

cheminfo4.1kMIT2.1.5TypeScript support: included

Extract coupling constants from a complex NMR multiiplet

readme

multiplet-analysis

NPM version build status npm download

The goal of this project is to be able to determine the multiplicity of a NMR signal as well as the coupling constants. It is based on a delta-function deconvolution developed by D. Jeannerat and G. Bodenhausen and published in J. Magn. Reson. 1999, 141(1), p133 doi:10.1006/jmre.1999.1845. More info and discussion in doc/README.md The result of the analysis that is an object composed:

  • delta
  • multiplicity : m (massif if delta is unspecified), s, s br, d br. We can repeat the multiplicity in this field but if it is empty we should use it from coupling constants array.
  • peak: [{x: , y:, z:, width}, {x: , y:, z:, width}, ]
  • j []
    • multiplicity: (d, t, q, p pent quint, sext hex, sept hept, oct, non)
    • coupling: (Hz)

Technical information

Run example

node -r esm examples/quadruplet.js
node -r esm examples/ddd.js
node -r esm examples/ddd_ABCD.js
node -r esm examples/doublet.js

node -r esm examples/simulate.js; # to simulate from a user-defined spin system
node -r esm examples/dd-exp.js; # to simulate from a user-defined spin system
node -r esm examples/asymDoublet.js; # to simulate from a user-defined spin system

Developement

git clone https://github.com/cheminfo/multiplet-analysis.git
cd multiplet-analysis
code .

To run the jest tests in an interactive way (preferably on a second screen): npx jest --watch

In order to debug you may anytime add a console.log in the code. The result of the log will appear in the jest --watch.

In the jest --.watch terminal you may as well select only one specific test.

In is also possible to select a specific test in the code by adding .only after describe or it like for example: it.only('s

Debugging data

In order to debug algorithm it is important to be able to visualize them. In the project we added a folder /examples/web that contains index.html. This webpage will load data.json and annotations.json and display a chart.

To automatically use and refresh this webpage you should install the plugin Live server typing code --install-extension ritwickdey.liveserver. Then, right click on index.html and open with live server. This will open the webpage in the browser and reload it if the files change.

There are also 2 examples files to create the data:

  • exampleGenerateAnnotations : create an array of annotations
  • exampleGenerateData : create an object like {x:[], y:[]}

When you clone / update the project don't forget to npm i to load possible new dependencies.

If you want to execute those scripts written as module you need to use esm that is installed as a development dependency. npm install esm node -r esm ./examples/web/exampleGenerateAnnotations.js

Creating simulated data

Spectra can be simulated on

http://www.nmrdb.org/simulator/

And the data can be download as a JSON file.

Installation

npm i multiplet-analysis

Usage

import library from 'multiplet-analysis';

const result = library(args);
// result is ...

API Documentation

License

MIT

npm i ml-fft npm home ml-fft

Demo and examples

Main scientific page.

example 1.

example 2.

changelog

Changelog

2.1.5 (2024-12-04)

Bug Fixes

  • returns reports if checkSymmetryFirst is true (#53) (e58ca0d)

2.1.4 (2024-12-04)

Bug Fixes

2.1.3 (2024-12-03)

Bug Fixes

  • center the multiplet at the beginning n explore the minTestedJ (#48) (d9c1b31)

2.1.2 (2023-07-20)

Bug Fixes

  • ensure cosine similarity for checkSymmetryFirst option(#45) (3cde35c)

2.1.1 (2023-05-05)

Bug Fixes

2.1.0 (2023-05-04)

Features

2.0.0 (2021-09-01)

⚠ BREAKING CHANGES

  • refactor j to js for jCouplings (#35)

Features

Bug Fixes

  • add package description (58c245f)

1.0.1 (2021-05-13)

Bug Fixes

1.0.0 (2021-03-24)

0.3.0 (2020-09-11)

0.2.0 (2020-07-27)

Bug Fixes

  • correctly take the next power of two (beb9e6d)
  • minor points to pass tests (8cc92b3)
  • remove obsolete test (63ebe4d)
  • set code back for clean log of messages associtated to commit (f651b2f)
  • smaller steps in fast mode / fast mode also for debug option (351bfdd)

0.1.0 (2020-03-29)

Bug Fixes

  • added detail about installation of Live server (5c8707f)
  • added path for call from root folder (e806478)
  • consistent data (2bf233c)
  • corrected some syntax prettier (22f5459)
  • eliminated bug in spectral width determination. The 7 Hz coupling is found. (0c1972c)
  • fixed bug for fft initialization (c140f25)
  • improve format (7cca988)
  • make test pass (d3b3285)
  • one-point correction to spectral widht determination (6f69bb3)
  • Small error in the scales of trigInterpolate (97bd567)
  • specify full path of web folder (in examples folder) (9e09f81)
  • typos in multiplicity and remove it.only (0ab5432)

Features

  • add dd-exp example (a7547fd)
  • add ddd (4723ab4)
  • add ddd_ABCD example (3eee4cc)
  • add docs folder (163152b)
  • add example to draw a chart (91f7542)
  • add possibility add phase - tested for ddd (a373b28)
  • add simulate spectrum (c4e2259)
  • added nice complex simulated examples of multiplets (8262066)
  • added nice complex simulated examples of multiplets (8a33274)
  • added tests for measureDeco and scalarProduct (305456c)
  • added webpage for demo (0158465)
  • added webpage for demo (dfa883f)
  • added webpage for demo (31b3795)
  • added webpage for demo (cc74ccd)
  • added webpage for demo (18a0cbc)
  • added webpage for demo (a852556)
  • added webpage for demo (ab63bdf)
  • const defines max number of coupling (495ca6c)
  • display coupling in the result page (c3f8917)
  • first implementation deconvolution (461705f)
  • implemented recursive search (99cc12d)
  • improved view of results (scales) (4c7c95e)
  • introduce option to symetrice multiplet at each step of simplification (2f6dfc6)
  • Introduced trigonometric interpolation using fft-js (5fcfa82)
  • return a chemical shift for the multiplet (a0910b4)
  • test of fft (cc7cc16)