nmr-load-save
v2.0.4
Published
Package to load and save NMR spectra
Downloads
2,089
Readme
nmr-load-save
Package to load and save NMR spectra.
$ npm i nmr-load-save
Usage
import { fileCollectionFromPath } from 'filelist-utils';
import { read, writeNmredata } from 'nmr-load-save';
const fileCollection = fileCollectionFromPath('path_to_data');
// we can read a zip, jdx, jdf, nmredata, json, nmrium file extensions
const result = await read(fileCollection, options);
// based on extension we choose the format processor
console.log(result);
// return {
// spectra: [],
// molecules: [],
// }
// readSource function accept a partial FileCollectionItems and a baseURL to generate a
// data structure with a source object inside with { files, filter, baseURL }
const nmriumObject = await readSource(
{
baseURL: 'https://cheminfo.github.io',
files: [
{
name: 'aspirin-1h.zip',
relativePath: 'bruker-data-test/data/zipped/aspirin-1h.zip',
},
],
},
{},
);