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

ml-gsd

Package Overview
Dependencies
Maintainers
9
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 9.0.2 to 9.0.3

4

lib-esm/gsd.d.ts

@@ -33,3 +33,3 @@ import type { DataXY } from 'cheminfo-types';

}
export interface IGSDOptions {
export interface GSDOptions {
noiseLevel?: number;

@@ -49,3 +49,3 @@ sgOptions?: {

}
export declare function gsd(data: DataXY, options?: IGSDOptions): Peak1D[];
export declare function gsd(data: DataXY, options?: GSDOptions): Peak1D[];
//# sourceMappingURL=gsd.d.ts.map

@@ -7,3 +7,3 @@ import type { Peak1D } from '../gsd';

*/
export interface IBroadenPeaksOptions {
export interface BroadenPeaksOptions {
/**

@@ -19,3 +19,3 @@ * @default 2

}
export declare function broadenPeaks(peakList: Peak1D[], options?: IBroadenPeaksOptions): Peak1D[];
export declare function broadenPeaks(peakList: Peak1D[], options?: BroadenPeaksOptions): Peak1D[];
//# sourceMappingURL=broadenPeaks.d.ts.map
import type { DataXY } from 'cheminfo-types';
import type { Shape1D } from 'ml-peak-shape-generator';
import type { IOptimizationOptions } from 'ml-spectra-fitting';
import type { OptimizationOptions } from 'ml-spectra-fitting';
import type { Peak1D } from '../gsd';

@@ -20,3 +20,3 @@ /**

}
export interface IJoinBroadPeaksOptions extends Partial<GetSoftMaskOptions> {
export interface JoinBroadPeaksOptions extends Partial<GetSoftMaskOptions> {
/**

@@ -34,7 +34,7 @@ * width limit to join peaks.

*/
optimization?: IOptimizationOptions;
optimization?: OptimizationOptions;
broadMask?: boolean[];
}
export declare function joinBroadPeaks(data: DataXY, peakList: Peak1D[], options?: IJoinBroadPeaksOptions): Peak1D[];
export declare function joinBroadPeaks(data: DataXY, peakList: Peak1D[], options?: JoinBroadPeaksOptions): Peak1D[];
export {};
//# sourceMappingURL=joinBroadPeaks.d.ts.map
import type { DataXY } from 'cheminfo-types';
import type { Shape1D } from 'ml-peak-shape-generator';
import type { IOptimizationOptions } from 'ml-spectra-fitting';
import type { OptimizationOptions } from 'ml-spectra-fitting';
import type { Peak1D } from '../gsd';

@@ -11,3 +11,3 @@ /**

*/
export interface IOptimizePeaksOptions {
export interface OptimizePeaksOptions {
/**

@@ -30,5 +30,5 @@ * times of width to group peaks.

*/
optimization?: IOptimizationOptions;
optimization?: OptimizationOptions;
}
export declare function optimizePeaks(data: DataXY, peakList: Peak1D[], options?: IOptimizePeaksOptions): Peak1D[];
export declare function optimizePeaks(data: DataXY, peakList: Peak1D[], options?: OptimizePeaksOptions): Peak1D[];
//# sourceMappingURL=optimizePeaks.d.ts.map

@@ -33,3 +33,3 @@ import type { DataXY } from 'cheminfo-types';

}
export interface IGSDOptions {
export interface GSDOptions {
noiseLevel?: number;

@@ -49,3 +49,3 @@ sgOptions?: {

}
export declare function gsd(data: DataXY, options?: IGSDOptions): Peak1D[];
export declare function gsd(data: DataXY, options?: GSDOptions): Peak1D[];
//# sourceMappingURL=gsd.d.ts.map

@@ -7,3 +7,3 @@ import type { Peak1D } from '../gsd';

*/
export interface IBroadenPeaksOptions {
export interface BroadenPeaksOptions {
/**

@@ -19,3 +19,3 @@ * @default 2

}
export declare function broadenPeaks(peakList: Peak1D[], options?: IBroadenPeaksOptions): Peak1D[];
export declare function broadenPeaks(peakList: Peak1D[], options?: BroadenPeaksOptions): Peak1D[];
//# sourceMappingURL=broadenPeaks.d.ts.map
import type { DataXY } from 'cheminfo-types';
import type { Shape1D } from 'ml-peak-shape-generator';
import type { IOptimizationOptions } from 'ml-spectra-fitting';
import type { OptimizationOptions } from 'ml-spectra-fitting';
import type { Peak1D } from '../gsd';

@@ -20,3 +20,3 @@ /**

}
export interface IJoinBroadPeaksOptions extends Partial<GetSoftMaskOptions> {
export interface JoinBroadPeaksOptions extends Partial<GetSoftMaskOptions> {
/**

@@ -34,7 +34,7 @@ * width limit to join peaks.

*/
optimization?: IOptimizationOptions;
optimization?: OptimizationOptions;
broadMask?: boolean[];
}
export declare function joinBroadPeaks(data: DataXY, peakList: Peak1D[], options?: IJoinBroadPeaksOptions): Peak1D[];
export declare function joinBroadPeaks(data: DataXY, peakList: Peak1D[], options?: JoinBroadPeaksOptions): Peak1D[];
export {};
//# sourceMappingURL=joinBroadPeaks.d.ts.map
import type { DataXY } from 'cheminfo-types';
import type { Shape1D } from 'ml-peak-shape-generator';
import type { IOptimizationOptions } from 'ml-spectra-fitting';
import type { OptimizationOptions } from 'ml-spectra-fitting';
import type { Peak1D } from '../gsd';

@@ -11,3 +11,3 @@ /**

*/
export interface IOptimizePeaksOptions {
export interface OptimizePeaksOptions {
/**

@@ -30,5 +30,5 @@ * times of width to group peaks.

*/
optimization?: IOptimizationOptions;
optimization?: OptimizationOptions;
}
export declare function optimizePeaks(data: DataXY, peakList: Peak1D[], options?: IOptimizePeaksOptions): Peak1D[];
export declare function optimizePeaks(data: DataXY, peakList: Peak1D[], options?: OptimizePeaksOptions): Peak1D[];
//# sourceMappingURL=optimizePeaks.d.ts.map
{
"name": "ml-gsd",
"version": "9.0.2",
"version": "9.0.3",
"description": "Global Spectra Deconvolution",

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

"esm": "^3.2.25",
"jest": "^27.3.1",
"jest": "^27.4.2",
"jest-matcher-deep-close-to": "^3.0.2",

@@ -85,5 +85,5 @@ "mf-global": "^1.4.7",

"ml-savitzky-golay-generalized": "2.0.3",
"ml-spectra-fitting": "^3.0.1",
"ml-spectra-fitting": "^3.0.2",
"ml-spectra-processing": "^6.8.0"
}
}

@@ -10,5 +10,5 @@ # global-spectral-deconvolution

`gsd`is using an algorithm that is searching for inflection points to determine the position of peaks and the width of the peaks are between the 2 inflection points. The result of GSD yield to an array of object containing {x, y and width}. However this width is based on the inflection point and may be different from the 'fwhm' (Full Width Half Maximum).
`gsd`is using an algorithm that is searching for inflection points to determine the position of peaks and the width of the peaks are between the 2 inflection points. The result of GSD yield to an array of object containing {x, y fwhm and width}. However this width is based on the inflection point and may be different from the 'fwhm' (Full Width Half Maximum).
The second algorithm (`optimizePeaks`) will optimize the width as a FWHM to match the original peak. After optimization the width with therefore be always FWHM whichever is the function used.
The second algorithm (`optimizePeaks`) will optimize the width and FWHM to match the original peak.

@@ -23,6 +23,2 @@ ## [API documentation](http://mljs.github.io/global-spectral-deconvolution/)

#### broadRatio=0.00 (0-1)
If `broadRatio` is higher than 0, then all the peaks which second derivative smaller than `broadRatio * maxAbsSecondDerivative` will be marked with the soft mask equal to true.
#### noiseLevel=0 (-inf, inf)

@@ -65,2 +61,6 @@

#### broadRatio=0.00 (0-1)
If `broadRatio` is higher than 0, then all the peaks which second derivative smaller than `broadRatio * maxAbsSecondDerivative` will be marked with the soft mask equal to true.
### GSD.optimizePeaks

@@ -85,7 +85,7 @@

});
console.log(peaks); // array of peaks {x,y,width}, width = distance between inflection points
console.log(peaks); // array of peaks {x, y, width, fwhw}, width = distance between inflection points
// GSD
let optimized = optimizePeaks(data, peaks);
console.log(optimized); // array of peaks {x,y,width}, width = FWHM
console.log(optimized); // array of peaks {x, y, width, fwhm}.
```

@@ -92,0 +92,0 @@

@@ -41,3 +41,3 @@ import type { DataXY, DoubleArray } from 'cheminfo-types';

export interface IGSDOptions {
export interface GSDOptions {
noiseLevel?: number;

@@ -58,3 +58,3 @@ sgOptions?: {

export function gsd(data: DataXY, options: IGSDOptions = {}): Peak1D[] {
export function gsd(data: DataXY, options: GSDOptions = {}): Peak1D[] {
let {

@@ -61,0 +61,0 @@ noiseLevel,

@@ -8,3 +8,3 @@ import type { Peak1D } from '../gsd';

*/
export interface IBroadenPeaksOptions {
export interface BroadenPeaksOptions {
/**

@@ -27,3 +27,3 @@ * @default 2

peakList: Peak1D[],
options: IBroadenPeaksOptions = {},
options: BroadenPeaksOptions = {},
): Peak1D[] {

@@ -30,0 +30,0 @@ const { factor = 2, overlap = false } = options;

@@ -5,3 +5,3 @@ import type { DataXY } from 'cheminfo-types';

import { optimize } from 'ml-spectra-fitting';
import type { IOptimizationOptions } from 'ml-spectra-fitting';
import type { OptimizationOptions } from 'ml-spectra-fitting';
import { xFindClosestIndex } from 'ml-spectra-processing';

@@ -28,3 +28,3 @@

export interface IJoinBroadPeaksOptions extends Partial<GetSoftMaskOptions> {
export interface JoinBroadPeaksOptions extends Partial<GetSoftMaskOptions> {
/**

@@ -42,3 +42,3 @@ * width limit to join peaks.

*/
optimization?: IOptimizationOptions;
optimization?: OptimizationOptions;
broadMask?: boolean[];

@@ -50,3 +50,3 @@ }

peakList: Peak1D[],
options: IJoinBroadPeaksOptions = {},
options: JoinBroadPeaksOptions = {},
): Peak1D[] {

@@ -53,0 +53,0 @@ let {

@@ -5,3 +5,3 @@ import type { DataXY } from 'cheminfo-types';

import { optimize } from 'ml-spectra-fitting';
import type { IOptimizationOptions } from 'ml-spectra-fitting';
import type { OptimizationOptions } from 'ml-spectra-fitting';
import { xGetFromToIndex } from 'ml-spectra-processing';

@@ -19,3 +19,3 @@

*/
export interface IOptimizePeaksOptions {
export interface OptimizePeaksOptions {
/**

@@ -38,3 +38,3 @@ * times of width to group peaks.

*/
optimization?: IOptimizationOptions;
optimization?: OptimizationOptions;
}

@@ -45,3 +45,3 @@

peakList: Peak1D[],
options: IOptimizePeaksOptions = {},
options: OptimizePeaksOptions = {},
): Peak1D[] {

@@ -60,3 +60,3 @@ const {

},
}: IOptimizePeaksOptions = options;
}: OptimizePeaksOptions = options;

@@ -63,0 +63,0 @@ if (data.x[0] > data.x[1]) {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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