ml-gsd
Version:
Global Spectral Deconvolution
58 lines • 2.38 kB
TypeScript
import type { DataXY } from 'cheminfo-types';
import type { SGGOptions } from 'ml-savitzky-golay-generalized';
import type { GSDPeak } from './GSDPeak.ts';
import type { MakeMandatory } from './utils/MakeMandatory.ts';
export interface GSDOptions {
/**
* Options for the Savitzky-Golay generalised algorithm. This algorithm is used
* to calculate the first ans second derivative.
* It is also used when smoothY:true to smooth the spectrum for peak picking.
* The Y values in case of smoothY is true will therefore be lower.
* @default {windowSize:9,polynomial:3}
*/
sgOptions?: SGGOptions;
/**
* Select the peak intensities from a smoothed version of the independent variables
* @default false
*/
smoothY?: boolean;
/**
* Peaks are local maxima (true) or minima (false)
* @default true
*/
maxCriteria?: boolean;
/**
* Peak under the noiseLevel (or over in case of maxCriteria=false) are ignored.
*/
noiseLevel?: number;
/**
* Minimal height of small peaks based on the ratio between min and max
* @default 0.00025
*/
minMaxRatio?: number;
/**
* Use a quadratic optimizations with the peak and its 3 closest neighbors
* @default false
*/
realTopDetection?: boolean;
/**
* Algorithm used for peak detection:
* - 'first': Uses the first derivative to detect peaks, detecting only
* the peaks which first derivative cross the zero.
* - 'second': Uses the second derivative to detect peaks (inflection points).
* - 'auto': Automatically selects the peaks by checking the zero crossing of the first derivative
* or the local minima in the second derivative.
* @default 'second'
*/
peakDetectionAlgorithm?: 'first' | 'second' | 'auto';
}
export type GSDPeakID = MakeMandatory<GSDPeak, 'id'>;
/**
* Global spectra deconvolution
* @param data - Object data with x and y arrays. Values in x has to be growing
* @param options
* @param {number} [options.broadRatio = 0.00] - 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.
*/
export declare function gsd(data: DataXY, options?: GSDOptions): GSDPeakID[];
//# sourceMappingURL=gsd.d.ts.map