import type { DataXY, DoubleArray } from 'cheminfo-types'; import type { GetAutocorrelationChartOptions } from './jsgraph/getAutocorrelationChart.js'; import type { GetBoxPlotChartOptions } from './jsgraph/getBoxPlotChart.js'; import type { GetChartOptions } from './jsgraph/getChart.js'; import type { NormalizationFilter } from './jsgraph/getNormalizationAnnotations.js'; import type { GetNormalizedChartOptions } from './jsgraph/getNormalizedChart.js'; import type { GetTrackAnnotationOptions } from './jsgraph/getTrackAnnotation.js'; import type { GetCategoriesStatsOptions } from './metadata/getCategoriesStats.js'; import type { GetClassLabelsOptions } from './metadata/getClassLabels.js'; import type { GetClassesOptions } from './metadata/getClasses.js'; import type { GetMetadataOptions } from './metadata/getMetadata.js'; import type { ParseTextOptions } from './parser/parseText.js'; import type { AutocorrelationResult } from './spectra/getAutocorrelation.js'; import type { GetNormalizedDataOptions, NormalizedDataResult } from './spectra/getNormalizedData.js'; import type { GetNormalizedTextOptions } from './spectra/getNormalizedText.js'; import type { GetPostProcessedDataOptions } from './spectra/getPostProcessedData.js'; import type { GetPostProcessedTextOptions } from './spectra/getPostProcessedText.js'; import type { AxisBoundary, MemoryStats } from './spectrum/Spectrum.js'; import { Spectrum } from './spectrum/Spectrum.js'; export interface NormalizationOptions extends NormalizationFilter { numberOfPoints?: number; applyRangeSelectionFirst?: boolean; filters?: Array<{ name: string; options?: any; }>; } export interface SpectraProcessorOptions { /** * Maximum memory to use for storing original data * @default 256 * 1024 * 1024 (256MB) */ maxMemory?: number; /** * Options to normalize the spectra before comparison */ normalization?: NormalizationOptions; } export interface AddFromDataOptions { /** * Metadata for the spectrum */ meta?: Record; /** * Spectrum identifier */ id?: string; /** * Normalization options */ normalization?: NormalizationOptions; /** * Pre-normalized data */ normalized?: DataXY; } export interface AddFromTextOptions extends ParseTextOptions { /** * Metadata for the spectrum */ meta?: Record; /** * Spectrum identifier */ id?: string; /** * Replace existing spectrum with same ID * @default false */ force?: boolean; } export interface AddFromJcampOptions { /** * Metadata for the spectrum */ meta?: Record; /** * Spectrum identifier */ id?: string; /** * Replace existing spectrum with same ID * @default false */ force?: boolean; } export interface GetAutocorrelationOptions extends GetNormalizedDataOptions { /** * X value if index is undefined */ x?: number; } export interface MinMaxX { min: number; max: number; } /** * Manager for a large number of spectra with the possibility to normalize the data * and skip the original data. */ export declare class SpectraProcessor { normalization?: NormalizationOptions; maxMemory: number; keepOriginal: boolean; spectra: Spectrum[]; /** * Create a SpectraProcessor * @param options - Configuration options */ constructor(options?: SpectraProcessorOptions); getNormalizationAnnotations(): import("./jsgraph/getNormalizationAnnotations.js").RectAnnotation[]; /** * Recalculate the normalized data using the stored original data if available * This will throw an error if the original data is not present * @param normalization - Normalization options */ setNormalization(normalization?: NormalizationOptions): void; getNormalization(): NormalizationOptions | undefined; /** * Returns an object {x:[], y:[]} containing the autocorrelation for the * specified index * @param index - X index of the spectrum to autocorrelate * @param options - Options for autocorrelation * @returns Autocorrelation result */ getAutocorrelation(index: number | undefined, options?: GetAutocorrelationOptions): AutocorrelationResult; /** * Returns a {x:[], y:[]} containing the average of specified spectra * @param options - Options for mean calculation * @returns Mean data */ getMeanData(options?: GetNormalizedDataOptions): DataXY; /** * Returns an object containing 4 parameters with the normalized data * @param options - Options for normalization * @returns */ getNormalizedData(options?: GetNormalizedDataOptions): NormalizedDataResult; /** * Returns a tab separated value containing the normalized data * @param options - Options for export * @returns Text string */ getNormalizedText(options?: GetNormalizedTextOptions): string; /** * Returns a tab separated value containing the post processed data * @param options - Options for export * @returns Text string */ getPostProcessedText(options?: GetPostProcessedTextOptions): string; getMinMaxX(): MinMaxX; /** * Returns an object containing 4 parameters with the scaled data * @param options - Options for post-processing * @returns */ getPostProcessedData(options?: GetPostProcessedDataOptions): import("./spectra/getPostProcessedData.js").PostProcessedDataResult; /** * Add from text * By default TITLE from the jcamp will be in the meta information * @param text - Text data * @param options - Options for parsing */ addFromText(text: string, options?: AddFromTextOptions): void; /** * Add jcamp * By default TITLE from the jcamp will be in the meta information * @param jcamp - JCAMP data * @param options - Options for parsing */ addFromJcamp(jcamp: string, options?: AddFromJcampOptions): void; updateRangesInfo(options?: any): void; /** * Returns the metadata for a set of spectra * @param options - Options for metadata extraction * @returns Metadata array */ getMetadata(options?: GetMetadataOptions): Record[]; /** * Get classes from metadata * @param options - Options for classification * @returns Array of class numbers */ getClasses(options?: GetClassesOptions & GetMetadataOptions): number[]; /** * Get class labels from metadata * @param options - Options for label extraction * @returns Array of class labels */ getClassLabels(options?: GetClassLabelsOptions & GetMetadataOptions): any[]; /** * Get categories statistics * @param options - Options for statistics * @returns Category statistics */ getCategoriesStats(options?: GetCategoriesStatsOptions): import("./metadata/getCategoriesStats.js").CategoryStats; /** * Add a spectrum based on the data * @param data - {x, y} * @param options - Options for adding spectrum * @returns Spectrum */ addFromData(data: DataXY, options?: AddFromDataOptions): void; removeOriginals(): void; /** * Remove the spectrum from the SpectraProcessor for the specified id * @param id - Spectrum identifier * @returns Removed spectrum array */ removeSpectrum(id: string): Spectrum[] | undefined; /** * Remove all the spectra not present in the list * @param ids - Array of ids of the spectra to keep */ removeSpectraNotIn(ids: unknown[]): void; /** * Checks if the ID of a spectrum exists in the SpectraProcessor * @param id - Spectrum identifier * @returns True if spectrum exists */ contains(id: string): boolean; /** * Returns the index of the spectrum in the spectra array * @param id - Spectrum identifier * @returns Index or undefined */ getSpectrumIndex(id: string | undefined): number | undefined; /** * Returns an array of all the ids * @returns Array of IDs */ getIDs(): string[]; /** * Returns an array of spectrum from their ids * @param ids - Array of spectrum IDs * @returns Array of Spectrum */ getSpectra(ids?: unknown[]): Spectrum[]; /** * Returns the spectrum for the given id * @param id - Spectrum identifier * @returns Spectrum or undefined */ getSpectrum(id: string): Spectrum | undefined; /** * Returns a JSGraph chart object for all the spectra * @param options - Chart options * @returns Chart object */ getChart(options?: GetChartOptions): import("./jsgraph/addChartDataStyle.ts").Chart; /** * Returns a JSGraph chart object for autocorrelation * @param index - Index in spectrum * @param options - Chart options * @returns Chart object */ getAutocorrelationChart(index: number, options?: GetAutocorrelationChartOptions): import("./jsgraph/getAutocorrelationChart.js").ColorSpectrum; /** * Returns a JSGraph annotation object for the specified index * @param index - Index in spectrum * @param options - Annotation options * @returns Annotation object */ getTrackAnnotation(index: number, options?: GetTrackAnnotationOptions): import("./jsgraph/getTrackAnnotation.js").LineAnnotation[]; /** * Returns a JSGraph annotation object for box plot * @param options - Chart options * @returns Chart object */ getBoxPlotChart(options?: GetBoxPlotChartOptions & GetNormalizedDataOptions): import("./jsgraph/getBoxPlotChart.js").ColorSpectrum; /** * Returns boxplot information * @param options - Options for box plot * @returns Box plot data */ getBoxPlotData(options?: GetNormalizedDataOptions): import("./spectra/getBoxPlotData.js").BoxPlotData; /** * Returns a JSGraph chart object for all the normalized spectra * @param options - Chart options * @returns Chart object */ getNormalizedChart(options?: GetNormalizedChartOptions & GetNormalizedDataOptions): import("./jsgraph/addChartDataStyle.ts").Chart; /** * Returns a JSGraph chart object for all the scaled normalized spectra * @param options - Options for post-processing * @returns Chart object */ getPostProcessedChart(options?: GetPostProcessedDataOptions): import("./jsgraph/addChartDataStyle.ts").Chart; getMemoryInfo(): MemoryStats & { keepOriginal: boolean; maxMemory: number; }; getNormalizedBoundary(): AxisBoundary; /** * We provide the allowed from / to after normalization * For the X axis we return the smallest common values * For the Y axis we return the largest min / max */ getNormalizedCommonBoundary(): AxisBoundary; /** * Create SpectraProcessor from normalized TSV * @param text - TSV text * @param options - Parsing options * @param options.fs * @returns SpectraProcessor instance */ static fromNormalizedMatrix(text: string, options?: { fs?: string; }): SpectraProcessor; } //# sourceMappingURL=SpectraProcessor.d.ts.map