export class MSComparator { /** * Create a class that will be able to get the similarity between 2 spectra * The similarity is based on 'cosine' similarity. The goal is 2 prepare 2 vectors * on which the similarity is calculated. * The vectors are created by taking the mass and the intensity of the peaks. * @param {object} [options={}] * @param {number} [options.nbPeaks] - Before comparing spectra how many peaks should be kept * @param {number} [options.minNbCommonPeaks] - Minimum number of peaks in common to consider any similarity * @param {number} [options.minIntensity] - What is the minimal relative intensity to keep a peak * @param {number} [options.massPower=3] - High power will give more weight to the mass. If you would prefer to observe fragments you should use a number less than 1 * @param {number} [options.intensityPower=0.6] - How important is the intensity. By default we don't give to much importance to it * @param {number[]} [options.selectedMasses] - List of allowed masses. * @param {number|Function} [options.delta=0.1] - Tolerance in Da (u) to consider 2 peaks as aligned. If a function is provided it will be called with the mass of the peak */ constructor(options?: { nbPeaks?: number | undefined; minNbCommonPeaks?: number | undefined; minIntensity?: number | undefined; massPower?: number | undefined; intensityPower?: number | undefined; selectedMasses?: number[] | undefined; delta?: number | Function | undefined; }); options: { nbPeaks?: number | undefined; minNbCommonPeaks?: number | undefined; minIntensity?: number | undefined; massPower: number; intensityPower: number; selectedMasses?: number[] | undefined; delta: number | Function; }; cache: WeakMap; /** * Get the similarity between a spectrum and a list of masses. * The main issue is that we don't have the intensity of the peaks. * So we will use the intensity of the closest peak. * @param {import('cheminfo-types').DataXY} dataXY * @param {number[]} masses */ getSimilarityToMasses(dataXY: import("cheminfo-types").DataXY, masses: number[]): { nbCommonPeaks: number; nbPeaks1: number; nbPeaks2: number; tanimoto: number; cosine: number; }; /** * * @param {import('cheminfo-types').DataXY} dataXY1 * @param {import('cheminfo-types').DataXY} dataXY2 */ getSimilarity(dataXY1: import("cheminfo-types").DataXY, dataXY2: import("cheminfo-types").DataXY): { nbCommonPeaks: number; nbPeaks1: number; nbPeaks2: number; tanimoto: number; cosine: number; }; } //# sourceMappingURL=MSComparator.d.ts.map