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

isotopic-distribution

Package Overview
Dependencies
Maintainers
2
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

isotopic-distribution - npm Package Compare versions

Comparing version 2.0.2 to 2.1.0

16

lib/index.js

@@ -604,2 +604,18 @@ 'use strict';

/**
* Returns the isotopic distirubtion
* @param {object} [options={}]
* @param {number} [options.maxValue=100]
* @param {number} [options.sumValue] // if sumValue is defined, maxValue is ignored
* @return {import('cheminfo-types').MeasurementXYVariables} an object containing at least the 2 properties: x:[] and y:[]
*/
getVariables(options = {}) {
const xy = this.getXY(options);
return {
x: { data: xy.x, label: 'm/z', units: 'u' },
y: { data: xy.y, label: 'Relative intensity', units: '%' },
};
}
/**
* Returns the isotopic distribution as the sum of gaussian

@@ -606,0 +622,0 @@ * @param {object} [options={}]

12

package.json
{
"name": "isotopic-distribution",
"version": "2.0.2",
"version": "2.1.0",
"description": "Calculate the isotopic distribution of a molecular formula",

@@ -23,6 +23,6 @@ "main": "lib/index.js",

"dependencies": {
"chemical-elements": "^2.0.1",
"mf-parser": "^2.2.0",
"mf-utilities": "^2.0.2",
"spectrum-generator": "^8.0.6"
"chemical-elements": "^2.0.2",
"mf-parser": "^2.2.1",
"mf-utilities": "^2.0.3",
"spectrum-generator": "^8.0.7"
},

@@ -32,3 +32,3 @@ "devDependencies": {

},
"gitHead": "91eb5af24bbad5cde6f018447f50552140253c2f"
"gitHead": "eaf15749dfc3cf47932c45669772647cf3034d69"
}

@@ -191,3 +191,3 @@ import { IsotopicDistribution } from '..';

it('create distribution of C10 and getXY with sumValue to 1', () => {
it('create distribution of C10 and getXY with sumValue to 100', () => {
let isotopicDistribution = new IsotopicDistribution('C10');

@@ -200,2 +200,9 @@ let xy = isotopicDistribution.getXY({ sumValue: 100 });

it('create distribution of C10 and getVariables with maxValue to 100', () => {
let isotopicDistribution = new IsotopicDistribution('C10');
let variables = isotopicDistribution.getVariables();
expect(variables.x.data.length).toBe(6);
expect(Math.max(...variables.y.data)).toBe(100);
});
it('create distribution of Ru5 and getXY', () => {

@@ -202,0 +209,0 @@ let isotopicDistribution = new IsotopicDistribution('Ru5');

@@ -295,2 +295,18 @@ import { ELECTRON_MASS } from 'chemical-elements';

/**
* Returns the isotopic distirubtion
* @param {object} [options={}]
* @param {number} [options.maxValue=100]
* @param {number} [options.sumValue] // if sumValue is defined, maxValue is ignored
* @return {import('cheminfo-types').MeasurementXYVariables} an object containing at least the 2 properties: x:[] and y:[]
*/
getVariables(options = {}) {
const xy = this.getXY(options);
return {
x: { data: xy.x, label: 'm/z', units: 'u' },
y: { data: xy.y, label: 'Relative intensity', units: '%' },
};
}
/**
* Returns the isotopic distribution as the sum of gaussian

@@ -297,0 +313,0 @@ * @param {object} [options={}]

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