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

ml-gsd

Package Overview
Dependencies
Maintainers
10
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ml-gsd - npm Package Compare versions

Comparing version 3.0.1 to 4.0.0

9

History.md

@@ -0,1 +1,10 @@

# [4.0.0](https://github.com/mljs/global-spectral-deconvolution/compare/v3.0.1...v4.0.0) (2020-03-20)
### Features
* broadenPeaks takes into account the inflection points if available ([d9302c7](https://github.com/mljs/global-spectral-deconvolution/commit/d9302c74a937f1202dc0898b0ca86bf684edf2c2))
## [3.0.1](https://github.com/mljs/global-spectral-deconvolution/compare/v3.0.0...v3.0.1) (2020-02-28)

@@ -2,0 +11,0 @@

18

lib/index.js

@@ -21,3 +21,2 @@ 'use strict';

heightFactor: 0,
boundaries: false,
derivativeThreshold: -1,

@@ -237,6 +236,6 @@ };

};
if (options.boundaries) {
signals[signalsLen - 1].left = intervalL[possible];
signals[signalsLen - 1].right = intervalR[possible];
}
signals[signalsLen - 1].left = intervalL[possible];
signals[signalsLen - 1].right = intervalR[possible];
if (options.heightFactor) {

@@ -629,4 +628,9 @@ let yLeft = Y[intervalL[possible].index];

for (let peak of peakList) {
peak.from = peak.x - (peak.width / 2) * factor;
peak.to = peak.x + (peak.width / 2) * factor;
if (!peak.right || !peak.left) {
peak.from = peak.x - (peak.width / 2) * factor;
peak.to = peak.x + (peak.width / 2) * factor;
} else {
peak.from = peak.x - (peak.x - peak.left.x) * factor;
peak.to = peak.x + (peak.right.x - peak.x) * factor;
}
}

@@ -633,0 +637,0 @@

{
"name": "ml-gsd",
"version": "3.0.1",
"version": "4.0.0",
"description": "Global Spectra Deconvolution",

@@ -50,3 +50,3 @@ "main": "lib/index.js",

"eslint-plugin-import": "^2.20.1",
"eslint-plugin-jest": "^23.8.0",
"eslint-plugin-jest": "^23.8.2",
"eslint-plugin-prettier": "^3.1.2",

@@ -56,4 +56,4 @@ "jest": "^25.1.0",

"prettier": "^1.19.1",
"rollup": "^1.31.1",
"spectrum-generator": "^3.1.3",
"rollup": "^2.1.0",
"spectrum-generator": "^4.0.0",
"xy-parser": "^3.0.0"

@@ -60,0 +60,0 @@ },

@@ -37,2 +37,10 @@ import { gsd } from '..';

y: 4.657142857142857,
left: {
index: 14,
x: 14,
},
right: {
index: 16,
x: 16,
},
},

@@ -58,2 +66,10 @@ ]);

index: 15,
left: {
index: 13,
x: 13,
},
right: {
index: 16,
x: 16,
},
soft: false,

@@ -83,2 +99,10 @@ width: 3,

index: 15,
left: {
index: 13,
x: 13,
},
right: {
index: 16,
x: 16,
},
soft: false,

@@ -85,0 +109,0 @@ width: 3,

@@ -14,3 +14,2 @@ import SG from 'ml-savitzky-golay-generalized';

heightFactor: 0,
boundaries: false,
derivativeThreshold: -1,

@@ -230,6 +229,6 @@ };

};
if (options.boundaries) {
signals[signalsLen - 1].left = intervalL[possible];
signals[signalsLen - 1].right = intervalR[possible];
}
signals[signalsLen - 1].left = intervalL[possible];
signals[signalsLen - 1].right = intervalR[possible];
if (options.heightFactor) {

@@ -236,0 +235,0 @@ let yLeft = Y[intervalL[possible].index];

@@ -6,10 +6,34 @@ import { broadenPeaks } from '../broadenPeaks';

let result = broadenPeaks([
{ x: 5, y: 10, width: 5 },
{ x: 10, y: 10, width: 5 },
{ x: 30, y: 10, width: 5 },
{ x: 5, y: 10, width: 5, left: { x: 2.5 }, right: { x: 7.5 } },
{ x: 10, y: 10, width: 5, left: { x: 7.5 }, right: { x: 12.5 } },
{ x: 30, y: 10, width: 5, left: { x: 27.5 }, right: { x: 32.5 } },
]);
expect(result).toStrictEqual([
{ from: 0, to: 7.5, width: 7.5, x: 5, y: 10 },
{ from: 7.5, to: 15, width: 7.5, x: 10, y: 10 },
{ from: 25, to: 35, width: 10, x: 30, y: 10 },
{
x: 5,
y: 10,
width: 7.5,
left: { x: 2.5 },
right: { x: 7.5 },
from: 0,
to: 7.5,
},
{
x: 10,
y: 10,
width: 7.5,
left: { x: 7.5 },
right: { x: 12.5 },
from: 7.5,
to: 15,
},
{
x: 30,
y: 10,
width: 10,
left: { x: 27.5 },
right: { x: 32.5 },
from: 25,
to: 35,
},
]);

@@ -16,0 +40,0 @@ });

@@ -14,4 +14,9 @@ /**

for (let peak of peakList) {
peak.from = peak.x - (peak.width / 2) * factor;
peak.to = peak.x + (peak.width / 2) * factor;
if (!peak.right || !peak.left) {
peak.from = peak.x - (peak.width / 2) * factor;
peak.to = peak.x + (peak.width / 2) * factor;
} else {
peak.from = peak.x - (peak.x - peak.left.x) * factor;
peak.to = peak.x + (peak.right.x - peak.x) * factor;
}
}

@@ -18,0 +23,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