npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nmr-correlation

v2.3.3

Published

Build and manipulation of correlations from 1D and 2D NMR data

Downloads

2,678

Readme

nmr-correlation

NPM version npm download

This package provides methods to build correlation data from NMR spectra. The NMR dataset has to be already processed and given in a certain format (see below).

Mainly, this is done by a grouping of signals with same nuclei between 1D and 2D or 2D and 2D NMR spectra. Each group is then represented by one correlation.

If a molecular formula is given, then missing correlations will be added as placeholder to complete the list.

Another feature is to determine the number of attached protons by using information from DEPT 90/135 or multiplicity-edited HSQC.

Input

Spectra

  • array of 1D, 2D, DEPT 90/135 spectra, e.g. obtained by nmr-parser
  • each spectrum has to be processed, e.g. via nmr-processing
  • declared type for spectra is
type Spectra = Array<Spectrum1D | Spectrum2D>;
  • further type definitions are available in src/types

Options

  • tolerances (must be given for each occurring atom type in spectra)
  • molecular formula (optional)

Values

  • optional, previously built correlations
  • useful to not override the following information if it is set to true in edited property:
    • hybridization, equivalence, protonsCount

Output

State

  • for each atom type with at least one correlation
  • current number of correlations
  • some error information according to a given molecular formula

Values

An array of correlations with following content:

  • link (array)
    • signal, axis (1D/2D signal and current axis which links to signals in another spectra)
    • match (indices of correlations with signal shift matches)
    • pseudo (whether this link is artificial)
    • some further meta information
  • attachment (contains indices of each attached correlation/atom)
  • protonsCount (array of possible numbers of attached protons)
  • equivalence (number of equivalences, default is 1)
  • hybridization (not set, except a CH3 group was detected)
  • pseudo (whether this is a placeholder, e.g. if molecular formula is given)
  • some further meta information, e.g. the group representing signal

Installation

$ npm i nmr-correlation

Usage

import { fromJCAMP } from 'nmr-parser';
import { buildCorrelationData } from 'nmr-correlation';

// parse spectra (symbolic example)
const data1H = fromJCAMP('1h.dx');
const data13C = fromJCAMP('13C.dx');
const dataHSQC = fromJCAMP('hsqc.dx');
const dataHMBC = fromJCAMP('hmbc.dx');
const dataCOSY = fromJCAMP('cosy.dx');
const dataDEPT90 = fromJCAMP('dept90.dx');
const dataDEPT135 = fromJCAMP('dept135.dx');

// process data (ranges/zones picking)
// ...
// put all the information together into specified format
// ...

// combine spectra into one array
const spectra = [
  data1H,
  data13C,
  dataHSQC,
  dataHMBC,
  dataCOSY,
  dataDEPT90,
  dataDEPT135,
];
// create options
const options = {
  tolerance: {
    C: 0.25,
    H: 0.02,
  },
  mf: 'C11H14N2O', // molecular formula
};
// build correlation data
const correlationData = buildCorrelationData(spectra, options);

License

MIT