https://github.com/cheminfo/convert-to-jcamp

Convert strings into JCAMP

https://github.com/cheminfo/convert-to-jcamp

Science Score: 46.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
    1 of 8 committers (12.5%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.1%) to scientific vocabulary

Keywords

hacktoberfest

Keywords from Contributors

nmr nmr-spectroscopy chemistry mzdata bruker jcamp jcamp-dx jeol nmr-parser data-format
Last synced: 7 months ago · JSON representation

Repository

Convert strings into JCAMP

Basic Info
Statistics
  • Stars: 0
  • Watchers: 5
  • Forks: 3
  • Open Issues: 3
  • Releases: 35
Topics
hacktoberfest
Created over 8 years ago · Last pushed 11 months ago
Metadata Files
Readme Changelog License

README.md

convert-to-jcamp

Convert strings into JCAMP.

Zakodium logo

Maintained by Zakodium

[![NPM version][npm-image]][npm-url] [![build status][travis-image]][travis-url] [![Test coverage][codecov-image]][codecov-url] [![npm download][download-image]][download-url] [![DOI](https://www.zenodo.org/badge/98869235.svg)](https://www.zenodo.org/badge/latestdoi/98869235)

Installation

$ npm install convert-to-jcamp

Usage

From Variables

```js const { fromVariables } = require('convert-to-jcamp'); const variables = { x: { data: [1, 2, 3, 4], label: 'x value', units: 'x unit', isDependent: false, }, y: { data: [2, 3, 4, 5], label: 'y value', units: 'y unit' }, };

const jcamp = fromVariables(variables, { forceNtuples: true, meta: { meta1: 'value1', meta2: 'value2', }, info: { title: 'Hello world', dataType: 'TEST', }, }); ```

There are two functions for NMR. from1DNMRVariables and from2DNMRVariables generate a NMR JCAMP file from variables.

```js const { from2DNMRVariables } = require('convert-to-jcamp');

const variables = { y: { data: [1, 2], symbol: 'F1', label: 'y', units: 'Hz a', isDependent: false, }, x: { data: [0, 1, 2, 3, 4], symbol: 'F2', label: 'x', units: 'Hz', isDependent: false, }, z: { data: [ [2, 3, 4, 5, 7], [1, 2, 3, 4, 5], ], symbol: 'Y', label: 'z', units: 'arbitrary', isDependent: true, }, };

const jcamp = from2DNMRVariables(variables, { xyEncoding: 'DIFDUP', nmrInfo: { title: '2D NMR', owner: 'cheminfo', dataType: 'nD NMR SPECTRUM', origin: 'lab', }, meta: { NUC1: '1H', NUC2: '13C', SFO1: 400, // Spectrometer frequency for F2 (MHz) SFO2: 100, // Spectrometer frequency for F1 (MHz) }, // Optional: additional metadata info: { '.OBSERVE NUCLEUS': '1H', '.OBSERVER FREQUENCY': 400 }, // Optional: additional JCAMP info fields }); ```

```js const { from1DNMRVariables } = require('convert-to-jcamp'); const variables = { x: { data: xMultiply(data.x, observeFrequency), label: 'Frequencies', units: 'Hz', symbol: 'X', isDependent: false, }, r: { data: data.re, label: 'real data', units: 'arbitratry units', symbol: 'R', isDependent: true, }, i: { data: data.im, label: 'imaginary data', units: 'arbitratry units', symbol: 'I', isDependent: true, }, };

const jcamp = from1DNMRVariables(variables, { xyEncoding: 'DIFDUP', nmrInfo: { title: 'jcamp 1D', owner: 'cheminfo', dataType: 'NMR Spectrum', origin: 'lab', isFid: false, // true for FID, false for spectrum baseFrequency: 600, // MHz originFrequency: 600, // MHz nucleus: '1H', // Optional fields: // digitalFilter, decim, dspfvs, frequencyOffset, baseFrequency, spectralWidth, solvent, scaleFactor }, meta: { SFO1: 400, NUC1: '1H' }, // Optional: additional metadata would be with ##$ prefix // info: { ... }, // Optional: additional JCAMP info fields would be with ## prefix }); ```

An example for 1D NMR bruker-to-jcamp conversion is in the demo folder

bash npm install; npx ts-node demo/bruker-to-jcamp.ts

API Documentation

License

MIT

Owner

  • Name: Cheminfo
  • Login: cheminfo
  • Kind: organization

GitHub Events

Total
  • Create event: 3
  • Release event: 1
  • Issues event: 2
  • Delete event: 1
  • Issue comment event: 3
  • Push event: 12
  • Pull request event: 3
Last Year
  • Create event: 3
  • Release event: 1
  • Issues event: 2
  • Delete event: 1
  • Issue comment event: 3
  • Push event: 12
  • Pull request event: 3

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 214
  • Total Committers: 8
  • Avg Commits per committer: 26.75
  • Development Distribution Score (DDS): 0.509
Past Year
  • Commits: 5
  • Committers: 2
  • Avg Commits per committer: 2.5
  • Development Distribution Score (DDS): 0.4
Top Committers
Name Email Commits
Luc Patiny l****c@p****m 105
cheminfo-bot 1****t 36
Jose Alejandro Bolanos Arroyave j****s@c****o 27
Oceane Patiny o****e@p****m 27
Miguel Angel Asencio Hurtado m****h@g****m 15
Michaël Zasso t****s@p****m 2
Sebastien Ahkrin 3****n 1
Luc Patiny l****y@L****l 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 8 months ago

All Time
  • Total issues: 24
  • Total pull requests: 62
  • Average time to close issues: 8 days
  • Average time to close pull requests: 6 days
  • Total issue authors: 2
  • Total pull request authors: 9
  • Average comments per issue: 1.0
  • Average comments per pull request: 1.06
  • Merged pull requests: 50
  • Bot issues: 0
  • Bot pull requests: 9
Past Year
  • Issues: 1
  • Pull requests: 3
  • Average time to close issues: 2 days
  • Average time to close pull requests: about 9 hours
  • Issue authors: 1
  • Pull request authors: 2
  • Average comments per issue: 0.0
  • Average comments per pull request: 1.33
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • lpatiny (18)
  • jobo322 (6)
Pull Request Authors
  • cheminfo-bot (30)
  • jobo322 (18)
  • dependabot[bot] (9)
  • maasencioh (3)
  • targos (2)
  • RicardoSilvestr (1)
  • opatiny (1)
  • Sebastien-Ahkrin (1)
  • lpatiny (1)
Top Labels
Issue Labels
enhancement (1)
Pull Request Labels
autorelease: tagged (26) dependencies (9) autorelease: pending (4) hacktoberfest-accepted (1)

Packages

  • Total packages: 1
  • Total downloads:
    • npm 3,321 last-month
  • Total dependent packages: 11
  • Total dependent repositories: 5
  • Total versions: 51
  • Total maintainers: 5
npmjs.org: convert-to-jcamp

Convert strings into JCAMP

  • Versions: 51
  • Dependent Packages: 11
  • Dependent Repositories: 5
  • Downloads: 3,321 Last month
Rankings
Dependent packages count: 1.9%
Downloads: 2.7%
Dependent repos count: 5.0%
Average: 7.9%
Forks count: 8.9%
Stargazers count: 20.9%
Last synced: 8 months ago

Dependencies

package.json npm
  • @types/jest ^28.1.7 development
  • bruker-data-test ^0.2.1 development
  • brukerconverter ^4.1.7 development
  • eslint ^8.10.0 development
  • eslint-config-cheminfo-typescript ^11.0.1 development
  • esm ^3.2.25 development
  • jcampconverter ^9.0.2 development
  • jest ^28.1.3 development
  • jest-matcher-deep-close-to ^3.0.2 development
  • prettier ^2.5.1 development
  • rimraf ^3.0.2 development
  • ts-jest ^28.0.8 development
  • typescript ^4.6.2 development
  • cheminfo-types ^1.1.0
  • is-any-array ^2.0.0
  • ml-array-max ^1.2.4
  • ml-array-min ^1.2.3
  • ml-matrix ^6.10.2
  • ml-spectra-processing ^11.0.0
.github/workflows/lactame.yml actions
  • actions/checkout v2 composite
  • actions/setup-node v2 composite
  • zakodium/lactame-action v1 composite
.github/workflows/nodejs.yml actions
.github/workflows/npm-prerelease.yml actions
.github/workflows/release.yml actions
.github/workflows/typedoc.yml actions
  • JamesIves/github-pages-deploy-action releases/v4 composite
  • actions/checkout v2 composite
  • actions/setup-node v2 composite
  • zakodium/typedoc-action v2 composite