# nmr-predictor

> NMR chemical shift predictor

Latest version **1.2.0** (published 2019-02-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install nmr-predictor
pnpm add nmr-predictor
yarn add nmr-predictor
bun add nmr-predictor
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2019-02-06 |
| First published | 2016-08-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 7 |
| Unpacked size | 36.7 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | andcastillo |
| Maintainers | andcastillo, jobo322, lpatiny, maasencioh, stropitek, targos |

## Links

- npm: https://www.npmjs.com/package/nmr-predictor
- Repository: https://github.com/cheminfo-js/nmr-predictor
- Homepage: https://github.com/cheminfo-js/spectra/packages/nmr-predictor
- Issues: https://github.com/cheminfo-js/spectra/issues
- npm.io page: https://npm.io/package/nmr-predictor

## Dependencies (7)

- [should](https://npm.io/package/should.md) ^13.2.3
- [xml2js](https://npm.io/package/xml2js.md) ^0.4.19
- [num-sort](https://npm.io/package/num-sort.md) ^1.0.0
- [new-array](https://npm.io/package/new-array.md) ^1.0.0
- [superagent](https://npm.io/package/superagent.md) ^3.5.0
- [openchemlib-extended](https://npm.io/package/openchemlib-extended.md) ^4.0.1
- [spectra-nmr-utilities](https://npm.io/package/spectra-nmr-utilities.md) ^1.0.5

## Recent versions

- 1.2.0 (latest) — 2019-02-06
- 1.1.12 — 2018-11-27
- 1.1.11 — 2018-11-01
- 1.1.10 — 2018-11-01
- 1.1.9 — 2018-11-01
- 1.1.8 — 2018-09-19
- 1.1.7 — 2018-09-03
- 1.1.6 — 2018-06-25
- 1.1.5 — 2017-12-01
- 1.1.4 — 2017-09-15
- 1.1.3 — 2017-09-15
- 1.1.2 — 2017-09-14
- 1.1.0 — 2017-07-10
- 1.0.9 — 2017-06-23
- 1.0.7 — 2017-06-20
- … 18 more at https://npm.io/package/nmr-predictor/versions

## README

# nmr-predictor

  [![NPM version][npm-image]][npm-url]
  [![build status][travis-image]][travis-url]
  [![David deps][david-image]][david-url]
  [![npm download][download-image]][download-url]

NMR chemical shift predictor

This library provide function for predicting nmr chemical shift for 1H and 13C. The predictions could be made from 2 different ways: 1. By the use of a local database of molecular fragments that are paired with is corresponding chemical shifts, and 2. by the use of Spinus too.
The predictor accepts a molfile as input data, and produces a set of predictions for each of the atoms in the molecule. Prediction of coupling constants are supported aswell, by means of the Karplus equation.

## Installation

```
$ npm install nmr-predictor
```

# [API Documentation](https://cheminfo-js.github.io/spectra/packages/nmr-predictor/docs/)

## Example: Prediction of 1H and 13C chemical shifts for the Ethylbenzene. 

In this example, we made use of our local databases for the chemical shift prediction. If you don't have your own databases, you may use our precompiled libraries for 1H and 13C, available in our github project by means of the fecthProton and fetchCarbon functions. fetchCarbon retrieves a compiled version of NMRShiftDB2 database. fetchProton retrieves an inhouse beta library for 1H predictions.

```js
'use strict';

const predictor = require('..');

const molfile = `Benzene, ethyl-, ID: C100414
  NIST    16081116462D 1   1.00000     0.00000
Copyright by the U.S. Sec. Commerce on behalf of U.S.A. All rights reserved.
  8  8  0     0  0              1 V2000
    0.5015    0.0000    0.0000 C   0  0  0  0  0  0           0  0  0
    0.0000    0.8526    0.0000 C   0  0  0  0  0  0           0  0  0
    1.5046    0.0000    0.0000 C   0  0  0  0  0  0           0  0  0
    2.0062    0.8526    0.0000 C   0  0  0  0  0  0           0  0  0
    3.0092    0.8526    0.0000 C   0  0  0  0  0  0           0  0  0
    1.5046    1.7554    0.0000 C   0  0  0  0  0  0           0  0  0
    0.5015    1.7052    0.0000 C   0  0  0  0  0  0           0  0  0
    3.5108    0.0000    0.0000 C   0  0  0  0  0  0           0  0  0
  1  2  2  0     0  0
  3  1  1  0     0  0
  2  7  1  0     0  0
  4  3  2  0     0  0
  4  5  1  0     0  0
  6  4  1  0     0  0
  5  8  1  0     0  0
  7  6  2  0     0  0
M  END
`;

// 1D proton prediction
predictor.fetchProton().then(function () {
    console.log(predictor.proton(molfile));
});

// 2D HSQC prediction
Promise.all([
  predictor.fetchProton(),
  predictor.fetchCarbon()
]).then(function (dbs) {
  return predictor.twod(predictor.proton(molfile), predictor.carbon(molfile), molfile);
});

// 2D HSQC with spinus
Promise.all([
  predictor.spinus(molfile),
  predictor.fetchCarbon()
]).then(function (results) {
  return predictor.twod(results[0], predictor.carbon(molfile), molfile);
});
```

## License

  [MIT](./LICENSE)

[npm-image]: https://img.shields.io/npm/v/nmr-predictor.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/nmr-predictor
[travis-image]: https://img.shields.io/travis/cheminfo-js/nmr-predictor/master.svg?style=flat-square
[travis-url]: https://travis-ci.org/cheminfo-js/nmr-predictor
[david-image]: https://img.shields.io/david/cheminfo-js/nmr-predictor.svg?style=flat-square
[david-url]: https://david-dm.org/cheminfo-js/nmr-predictor
[download-image]: https://img.shields.io/npm/dm/nmr-predictor.svg?style=flat-square
[download-url]: https://www.npmjs.com/package/nmr-predictor

---
_Source: https://npm.io/package/nmr-predictor · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
