https://github.com/cheminfo/convert-to-jcamp
Convert strings into 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
Keywords from Contributors
Repository
Convert strings into JCAMP
Basic Info
- Host: GitHub
- Owner: cheminfo
- License: mit
- Language: TypeScript
- Default Branch: main
- Homepage: https://cheminfo.github.io/convert-to-jcamp/
- Size: 1.91 MB
Statistics
- Stars: 0
- Watchers: 5
- Forks: 3
- Open Issues: 3
- Releases: 35
Topics
Metadata Files
README.md
convert-to-jcamp
Convert strings into JCAMP.
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] [](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
Owner
- Name: Cheminfo
- Login: cheminfo
- Kind: organization
- Website: https://www.cheminfo.org/
- Repositories: 242
- Profile: https://github.com/cheminfo
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
Top Committers
| Name | 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
Pull Request Labels
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
- Homepage: https://github.com/cheminfo/convert-to-jcamp#readme
- License: MIT
-
Latest release: 6.0.0
published 11 months ago
Rankings
Maintainers (5)
Dependencies
- @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
- actions/checkout v2 composite
- actions/setup-node v2 composite
- zakodium/lactame-action v1 composite
- JamesIves/github-pages-deploy-action releases/v4 composite
- actions/checkout v2 composite
- actions/setup-node v2 composite
- zakodium/typedoc-action v2 composite