New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ms-spectrum

Package Overview
Dependencies
Maintainers
0
Versions
112
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ms-spectrum - npm Package Compare versions

Comparing version 3.6.1 to 3.6.2

lib/src/getBestPeaks.d.ts

12

package.json
{
"name": "ms-spectrum",
"version": "3.6.1",
"version": "3.6.2",
"description": "A mass spectrum",
"main": "lib/index.js",
"main": "lib/src/index.js",
"module": "src/index.js",

@@ -24,6 +24,6 @@ "files": [

"cheminfo-types": "^1.7.3",
"emdb": "^3.3.1",
"emdb": "^3.3.2",
"is-any-array": "^2.0.1",
"mf-parser": "^3.2.0",
"mf-utilities": "^3.2.0",
"mf-parser": "^3.2.1",
"mf-utilities": "^3.2.1",
"ml-gsd": "^12.1.6",

@@ -39,3 +39,3 @@ "ml-regression-power": "^3.0.0",

},
"gitHead": "ea33c20348f0cf73b46b5083b7cdb963c2be1b4f"
"gitHead": "838f98a30846d4b1721b8ed7aa94a55e854d7521"
}

@@ -85,3 +85,3 @@ import { xyObjectMaxXPoint, xyObjectMinXPoint } from 'ml-spectra-processing';

}
let newPeak = JSON.parse(JSON.stringify(item.peak));
let newPeak = structuredClone(item.peak);
newPeak.close = close;

@@ -88,0 +88,0 @@ toReturn.push(newPeak);

@@ -31,9 +31,8 @@ import { EMDB } from 'emdb';

for (let peak of peaks) {
peak.mfs = (
await emdb.fromMonoisotopicMass(peak.x, {
precision,
ranges,
ionizations,
})
).mfs;
const { mfs } = await emdb.fromMonoisotopicMass(peak.x, {
precision,
ranges,
ionizations,
});
peak.mfs = mfs;
}

@@ -40,0 +39,0 @@ peaks = peaks.filter((peak) => peak.mfs.length > 0);

@@ -24,4 +24,4 @@ import { Comparator } from 'peaks-similarity';

if (!spectrum || !spectrum.data.x.length > 0) {
throw Error(
if (!spectrum || spectrum.data.x.length === 0) {
throw new Error(
'You need to add an experimental spectrum first using setMassSpectrum',

@@ -36,3 +36,3 @@ );

similarity = JSON.parse(JSON.stringify(similarity));
similarity = structuredClone(similarity);
similarity.common = 'second';

@@ -49,3 +49,3 @@

if (!checkTopBottom.bottom || !checkTopBottom.top) {
throw Error(
throw new Error(
'widthFunction should return an object with bottom and top properties',

@@ -52,0 +52,0 @@ );

@@ -43,6 +43,8 @@ import {

if (sumValue) {
peaks = JSON.parse(JSON.stringify(peaks));
peaks = structuredClone(peaks);
const currentSum = xyObjectSumY(peaks);
const ratio = sumValue / currentSum;
peaks.forEach((peak) => (peak.y *= ratio));
for (const peak of peaks) {
peak.y *= ratio;
}
}

@@ -49,0 +51,0 @@

@@ -15,3 +15,3 @@ import { PowerRegression } from 'ml-regression-power';

if (isNaN(regression.A) || isNaN(regression.B)) {
if (Number.isNaN(regression.A) || Number.isNaN(regression.B)) {
throw new Error('peaksWidth: can not calculate regression');

@@ -18,0 +18,0 @@ }

@@ -21,2 +21,4 @@ import { isAnyArray } from 'is-any-array';

const defaultData = { x: [], y: [] };
/**

@@ -32,3 +34,3 @@ * Class dealing with mass spectra and peak picking

*/
constructor(data = { x: [], y: [] }, options = {}) {
constructor(data = defaultData, options = {}) {
if (

@@ -56,6 +58,6 @@ typeof data !== 'object' ||

this.info = {
minX: NaN,
maxX: NaN,
minY: NaN,
maxY: NaN,
minX: Number.NaN,
maxX: Number.NaN,
minY: Number.NaN,
maxY: Number.NaN,
};

@@ -62,0 +64,0 @@ }

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