Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jcampconverter

Package Overview
Dependencies
Maintainers
3
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jcampconverter - npm Package Compare versions

Comparing version 2.0.4 to 2.0.5

LICENSE

2

bower.json
{
"name": "jcampconverter",
"version": "2.0.4",
"version": "2.0.5",
"main": [

@@ -5,0 +5,0 @@ "dist/jcampconverter.js",

{
"name": "jcampconverter",
"version": "2.0.4",
"version": "2.0.5",
"description": "Parse and convert JCAMP data",

@@ -33,2 +33,3 @@ "main": "./src/index.js",

"devDependencies": {
"benchmark": "^1.0.0",
"browserify": "^8.1.3",

@@ -44,6 +45,6 @@ "del": "^1.1.1",

"should": "latest",
"v8-profiler": "^5.2.3",
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^1.0.0",
"benchmark": "^1.0.0"
"vinyl-source-stream": "^1.0.0"
}
}
# JCAMP converter
[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![David deps][david-image]][david-url]
[![npm download][download-image]][download-url]
Parse and convert JCAMP data
## Installation
### Node JS
```
npm install jcampconverter
```
`npm install jcampconverter`
### Bower
```
bower install jcampconverter
```
`bower install jcampconverter`
## Methods

@@ -30,2 +35,3 @@

* keepSpectra - Generate array for 2D NMR spectra (default: false)
* keepRecordsRegExp - regexp to select which records should be placed in the info field. By default: :/^[A-Za-z]+$/}

@@ -58,2 +64,3 @@ ### Use as a module

npm install
npm test
npm run build

@@ -70,3 +77,3 @@ ```

MIT
[MIT](./LICENSE)

@@ -77,1 +84,5 @@ [npm-image]: https://img.shields.io/npm/v/jcampconverter.svg?style=flat-square

[travis-url]: https://travis-ci.org/cheminfo/jcampconverter
[david-image]: https://img.shields.io/david/cheminfo/jcampconverter.svg?style=flat-square
[david-url]: https://david-dm.org/cheminfo/jcampconverter
[download-image]: https://img.shields.io/npm/dm/jcampconverter.svg?style=flat-square
[download-url]: https://npmjs.org/package/jcampconverter

@@ -28,2 +28,6 @@ 'use strict';

options = options || {};
var keepRecordsRegExp=/^[A-Z]+$/;
if (options.keepRecordsRegExp) keepRecordsRegExp=options.keepRecordsRegExp;
var start = new Date();

@@ -222,3 +226,3 @@

spectrum[convertMSFieldToLabel(dataLabel)] = dataValue;
} else if (dataLabel.match(/^[A-Z].*/)) {
} else if (dataLabel.match(keepRecordsRegExp)) {
result.info[dataLabel] = dataValue.trim();

@@ -470,11 +474,10 @@ }

function convertTo3DZ(spectra) {
//console.time('ConvertTo3DZ');
var z = [];
var noise = 0;
var minZ = spectra[0].data[0][0];
var maxZ = spectra[0].data[0][0];
var maxZ = minZ;
var ySize = spectra.length;
var xSize = spectra[0].data[0].length / 2;
var z = new Array(ySize);
for (var i = 0; i < ySize; i++) {
z[i] = [];
z[i] = new Array(xSize);
for (var j = 0; j < xSize; j++) {

@@ -489,3 +492,2 @@ z[i][j] = spectra[i].data[0][j * 2 + 1];

}
//console.timeEnd('ConvertTo3DZ');
return {

@@ -496,6 +498,6 @@ z: z,

minY: spectra[0].pageValue,
maxY: spectra[spectra.length - 1].pageValue,
maxY: spectra[ySize - 1].pageValue,
minZ: minZ,
maxZ: maxZ,
noise: noise / ((z.length - 1) * (z[0].length - 1) * 2)
noise: noise / ((ySize - 1) * (xSize - 1) * 2)
};

@@ -502,0 +504,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc