import type { AnalyseMultipletOptionsNormal } from 'multiplet-analysis'; import type { AnalyseMultipletOptionsWithDebug } from 'multiplet-analysis'; import type { AnalyseMultipletResult } from 'multiplet-analysis'; import type { AnalyseMultipletResultWithDebug } from 'multiplet-analysis'; import type { Apodization1DFilterOptions } from '@zakodium/nmr-types'; import type { Apodization1DOptions } from '@zakodium/nmr-types'; import type { Apodization2D1Options } from '@zakodium/nmr-types'; import type { Apodization2D2Options } from '@zakodium/nmr-types'; import type { ApodizationDimension1Options } from '@zakodium/nmr-types'; import type { ApodizationDimension2Options } from '@zakodium/nmr-types'; import type { AutoPhaseCorrection2D } from '@zakodium/nmr-types'; import type { BackwardLinearPredictionFilterOptions } from '@zakodium/nmr-types'; import type { BackwardLPDimension1Options } from '@zakodium/nmr-types'; import type { BackwardLPDimension2Options } from '@zakodium/nmr-types'; import type { BackwardLPOptions } from '@zakodium/nmr-types'; import type { BaselineCorrection2DFilterOptions } from '@zakodium/nmr-types'; import type { BaselineCorrectionFilterOptions } from '@zakodium/nmr-types'; import type { BaselineCorrectionOptions } from '@zakodium/nmr-types'; import type { BaselineCorrectionZone } from '@zakodium/nmr-types'; import { BaseRegression } from 'ml-regression-base'; import { DataReIm } from 'ml-spectra-processing'; import type { DataReImMatrix } from 'ml-spectra-processing'; import type { DataXReIm } from 'ml-spectra-processing'; import { DataXY } from 'cheminfo-types'; import type { DigitalFilter2DOptions } from '@zakodium/nmr-types'; import type { DigitalFilterOption } from '@zakodium/nmr-types'; import type { DirectDimensionOptions } from '@zakodium/nmr-types'; import type { DirectOptions } from 'ml-direct'; import type { DoubleArray } from 'cheminfo-types'; import type { EquallySpacedOptions } from '@zakodium/nmr-types'; import type { ExclusionZonesOptions } from '@zakodium/nmr-types'; import type { ExponentialOptions } from '@zakodium/nmr-types'; import { ExponentialRegression } from 'ml-regression-exponential'; import type { FFT1DOptions } from '@zakodium/nmr-types'; import type { FFTDimension1Options } from '@zakodium/nmr-types'; import type { FFTDimension2Options } from '@zakodium/nmr-types'; import type { Filter1DEntry } from '@zakodium/nmr-types'; import type { Filter1DOptions } from '@zakodium/nmr-types'; import type { Filter2DEntry } from '@zakodium/nmr-types'; import type { Filter2DOptions } from '@zakodium/nmr-types'; import * as Filters from 'ml-signal-processing'; import type { FordwardLPDimension1Options } from '@zakodium/nmr-types'; import type { FordwardLPDimension2Options } from '@zakodium/nmr-types'; import type { ForwardLP1DOptions } from '@zakodium/nmr-types'; import type { ForwardLPOptions } from '@zakodium/nmr-types'; import type { FromTo } from 'cheminfo-types'; import type { GaussianOptions } from '@zakodium/nmr-types'; import type { GenerateSpectrumOptions } from 'spectrum-generator'; import type { GroupedDiaID } from 'openchemlib-utils'; import type { GSDOptions } from 'ml-gsd'; import { GSDPeakOptimized } from 'ml-gsd'; import { GSDPeakOptimizedID } from 'ml-gsd'; import type { IndirectDimensionOptions } from '@zakodium/nmr-types'; import type { Info1D } from '@zakodium/nmr-types'; import type { Info2D } from '@zakodium/nmr-types'; import type { Integral } from '@zakodium/nmr-types'; import type { Integrals } from '@zakodium/nmr-types'; import { Jcoupling } from '@zakodium/nmr-types'; import type { JoinBroadPeaksOptions } from 'ml-gsd'; import type { LevenbergMarquardtOptions } from 'ml-levenberg-marquardt'; import type { LightLogger } from 'cheminfo-types'; import type { Logger } from 'cheminfo-types'; import type { Matrix } from 'ml-matrix'; import type { MatrixOptions } from '@zakodium/nmr-types'; import type { Molecule } from 'openchemlib'; import type { NmrData1D } from 'cheminfo-types'; import type { NmrData2D } from 'cheminfo-types'; import type { NmrData2DContent } from 'cheminfo-types'; import type { NmrData2DFt } from 'cheminfo-types'; import type { NMRPeak1D } from '@zakodium/nmr-types'; import { NMRRange } from '@zakodium/nmr-types'; import type { NMRShape1D } from '@zakodium/nmr-types'; import type { NMRSignal1D } from '@zakodium/nmr-types'; import type { NumberArray } from 'cheminfo-types'; import type { NUSDimension2Options } from '@zakodium/nmr-types'; import type { OCLMolecule } from 'cheminfo-types'; import type { OptimizePeaksOptions } from 'ml-gsd'; import type { OptionsSG1D } from 'spectrum-generator'; import type { Peak1D } from '@zakodium/nmr-types'; import type { Peak2D } from 'ml-matrix-peaks-finder'; import type { Peak2D as Peak2D_2 } from '@zakodium/nmr-types'; import type { Peaks } from '@zakodium/nmr-types'; import type { PeakXYWidth } from 'cheminfo-types'; import type { PhaseCorrection1DFilterOptions } from '@zakodium/nmr-types'; import type { PhaseCorrection1DOptions } from '@zakodium/nmr-types'; import type { PhaseCorrection2DOptions } from '@zakodium/nmr-types'; import type { PhaseCorrectionTwoDFilter } from '@zakodium/nmr-types'; import type { PhaseCorrectionTwoDOptions } from '@zakodium/nmr-types'; import { PointXY } from 'cheminfo-types'; import type { ProcessingInfo1D } from '@zakodium/nmr-types'; import type { ProcessingInfo2D } from '@zakodium/nmr-types'; import type { Range as Range_2 } from '@zakodium/nmr-types'; import type { Ranges } from '@zakodium/nmr-types'; import type { Shape1DWithFWHM } from '@zakodium/nmr-types'; import type { Shapes } from '@zakodium/nmr-types'; import type { Shift2DXFilterOptions } from '@zakodium/nmr-types'; import type { Shift2DYFilterOptions } from '@zakodium/nmr-types'; import type { ShiftXFilterOptions } from '@zakodium/nmr-types'; import type { ShiftXOptions } from '@zakodium/nmr-types'; import type { Signal1D } from '@zakodium/nmr-types'; import type { Signal2D } from '@zakodium/nmr-types'; import type { SignalKind } from '@zakodium/nmr-types'; import type { SignalProcessingFilter } from '@zakodium/nmr-types'; import type { SineBellOptions } from '@zakodium/nmr-types'; import type { Spectra } from '@zakodium/nmr-types'; import type { Spectrum } from '@zakodium/nmrium-core'; import type { Spectrum2D } from '@zakodium/nmr-types'; import type { SymmetrizeCosyLikeOptions } from '@zakodium/nmr-types'; import type { TopicMolecule } from 'openchemlib-utils'; import type { TrafOptions } from '@zakodium/nmr-types'; import type { TrimFilterOptions } from '@zakodium/nmr-types'; import type { TrimOptions } from '@zakodium/nmr-types'; import type { XRobustDistributionStats } from 'ml-spectra-processing'; import type { XYNumber } from 'spectrum-generator'; import type { ZeroFillingDimension1Options } from '@zakodium/nmr-types'; import type { ZeroFillingDimension2Options } from '@zakodium/nmr-types'; import type { ZeroFillingFilterOptions } from '@zakodium/nmr-types'; import type { ZeroFillingOptions } from '@zakodium/nmr-types'; import type { Zone } from '@zakodium/nmr-types'; import type { Zones } from '@zakodium/nmr-types'; /** * Adds a link to a correlation. * * @param correlation * @param link */ declare function addLink(correlation: Correlation, link: CorrelationLink): Correlation; declare type Apodization1D = FilterFactory & Pick; declare type ApodizationDimension1 = FilterFactory & Pick; declare type ApodizationDimension2 = FilterFactory & Pick; export declare function apodizationXReIm(data: Required, options: Apodization1DOptions): { x: Float64Array; re: Float64Array; im: Float64Array; }; /** * pure function that applies a window function to the input data. * @param data * @param options */ export declare function apodize(data: DoubleArray, options: ApplyWindowOptions): Float64Array; declare function applyFilter(datum: Entry1D, filter: Filter1DOptions, logger?: Logger): void; declare function applyFilter_2(datum: Entry2D, filter: Filter2DOptions, logger?: Logger): void; declare interface ApplyFilterOptions { /** * reapply all the filters using the original data, even if there is a previous filter applied. */ forceReapply?: boolean; /** * filter position at the moment to add a new filter */ filterIndex?: number; logger?: Logger; } declare interface ApplyFilterOptions_2 { /** * reapply all the filters using the original data, even if there is a previous filter applied. */ forceReapply?: boolean; /** * filter position at the moment to add a new filter */ filterIndex?: number; logger?: Logger; } /*** * @param {object} Filters [{name:'',options:{}},{...}] */ declare function applyFilters(datum: Entry1D, filters?: Filter1DOptions[], options?: ApplyFilterOptions): void; declare function applyFilters_2(datum: Entry2D, filters?: Filter2DOptions[], options?: ApplyFilterOptions_2): void; export declare interface ApplyWindowOptions { /** * data of a window function it should be scaled to max = 1 to ensure compatibility with new apodizations. */ windowData: DoubleArray; /** * output array */ output?: DoubleArray; } declare type Atom = ReturnType[0]; declare interface AtomInput { id: ID; pid: ID; n: string; r: string; nc: number; crcan: number; crrd: number; crnmr: number; o: number; rs: number[]; sf: number[]; fc: number; c: number; c2d: [number, number, number]; c3d: [number, number, number]; p2d: string | null; s: ID | null; } declare interface AtomOutput { id: ID; parentID: ID; name: string; remarks: string; nucleusType: NucleusType; cipRank: { canonical: number; rd: number; nmr: number; }; ordinal: number; stereochemistryFlags: number[]; spinSystemFlags: number[]; formalcharge: number; partialCharge: number; coordinates2D: [number, number, number]; coordinates3D: [number, number, number]; parent2D: string | null; shift: ID | null; } declare type AtomTypes = 'H' | 'C'; export declare function autoPhaseCorrection(spectrum: Entry1D, options?: AutoPhaseCorrectionOptions): { data: DataReIm; ph0: number; ph1: number; }; export declare interface AutoPhaseCorrectionOptions { minRegSize?: number; maxDistanceToJoin?: number; magnitudeMode?: boolean; factorNoise?: number; reverse?: boolean; } declare type BackwardLinearPrediction1D = FilterFactory> & Pick; declare type BackwardLPDimension1 = FilterFactory> & Pick; declare type BackwardLPDimension2 = FilterFactory> & Pick; declare type BaselineCorrection1D = FilterFactory & Pick; declare type BaselineCorrection2D = FilterFactory> & Pick; export declare interface BaselineZoneOptions { /** * The width factor to use to enlarge the peaks width * @default 20 */ widthFactor?: number; /** * The number of zones to find * @default 5 */ nbZones?: number; /** * The space (in percent) from the side that should not be considered * @default 0.05 */ padding?: number; /** * The tolerance (in percent) to select the zone in which the more points are present * @default 0.05 */ tolerance?: number; /** * The minimum width of the zones as a radio to the width * @default 0.02 */ minWidth?: number; } export declare interface BaselineZoneOptionsDietrich extends BaselineZoneOptions { /** * distance in number of points to join zones */ maxDistanceToJoin?: number; } declare interface BondInput { id: ID; b: number; rs: number[]; sf: number[]; a: [ID, ID]; } declare interface BondOutput { id: ID; bondType: string; stereochemistryFlags: number[]; spinSystemFlags: number[]; atoms: [ID, ID]; } /** * Builds a correlation object with some existing default values. * * @param {CorrelationOptions} options */ declare function buildCorrelation(options: CorrelationOptions): Correlation; /** * Builds the correlation data from spectra data and some options. * * @param spectra * @param options */ declare function buildCorrelationData(spectra: Spectrum[], options: CorrelationBuildOptions): CorrelationData; /** * Builds a link object with some existing default values. * * @param options */ declare function buildLink(options: LinkOptions): CorrelationLink; /** * Builds a state from current values and an optional molecular formula. * * @param {CorrelationValues} values * @param {string} mf */ declare function buildState(values: CorrelationValues, mf: string): CorrelationState; /** * Builds the correlation data values from given input spectra and options. * @param spectra * @param options */ declare function buildValues(spectra: Spectra, options: CorrelationBuildOptions): CorrelationValues; declare type CacheResult = EmptyValue | PredictionBase1D | Promise; export declare interface CalculateDiffussionCoefficientOptions { /** * gyromagnetic ratio, it is based in the nucleus */ gyromagneticRatio: number; /** * pulse field gradient duraction, it assume that only the amplitude is variable. */ gradientPulseDuration: number; /** * it depends of the experiment and include the diffusion time. */ timeCorrection: number; } /** * Calculates the frequencies (in MHz) for a pair of nuclei based on the observed spectrometer frequency. * * - The first element of the `nucleus` array is the observed nucleus. * - The second element is the indirect nucleus. * - Returns an array: [frequency of observed nucleus, frequency of indirect nucleus]. * * @param nucleus - Array of two nuclei (e.g., ['1H', '13C']). * - The first element is the observed nucleus. * - The second element is the indirect nucleus. * @param frequency - The spectrometer frequency (in MHz) of the observed nucleus (first element of the nucleus array). * @returns Array of frequencies in MHz: [frequency of observed nucleus, frequency of indirect nucleus]. */ export declare function calculateRelativeFrequency(nucleus: string[], frequency: number): number[]; declare interface CalculateT1Options { optimization?: CalculateT1OptionsOptimization; } declare interface CalculateT1OptionsOptimization { shapeFunc?: (parameters: number[]) => (x: number) => number; options?: Partial & LevenbergMarquardtOptionsOverride; } /** * Common laboratory solvents database (carbon). * @see https://doi.org/10.1021/jo971176v */ export declare const carbonImpurities: DatabaseNMREntry[]; /** * Check whether integral based on its kind can be included in another operation or not. * @param integral - integral * @returns */ export declare function checkIntegralKind(integral: Integral): boolean; /** * Checks for a numeric match within a certain tolerance. * * @param {number} value1 * @param {number} value2 * @param {number} tolerance */ declare function checkMatch(value1: number, value2: number, tolerance: number): boolean; export declare function checkMultiplicity(multiplicity: string, rejected?: OneLetterMultiplet[]): boolean; declare function checkSignalKinds(range: Range_2, kinds: ReadonlySet): boolean; export declare interface Correlation extends CorrelationAndLinkFields { atomType: string; label: Record; link: CorrelationLink[]; equivalence: number; attachment: Record; protonsCount: number[]; hybridization: number[]; } declare interface CorrelationAndLinkFields { id: string; pseudo: boolean; edited: Record; } declare interface CorrelationAndLinkOptions { id?: string; pseudo?: boolean; edited?: Record; } export declare namespace correlationApi { export { Correlation, CorrelationBuildOptions, CorrelationData, CorrelationLink, CorrelationState, CorrelationTolerance, CorrelationValues, buildCorrelationData, buildValues, buildState, addLink, buildCorrelation, buildLink, removeLink, setCorrelation, checkMatch, findLinkedCorrelationsBySignalID, findLinksBySignalID, getAtomCounts, getAtomTypeFromNucleus, getCorrelationDelta, getCorrelationIndex, getCorrelationsByAtomType, getLabel, getLabels, getLinkDelta, getLinkDim, isEditedHSQC, setPathLength } } export declare interface CorrelationBuildOptions { tolerance?: CorrelationTolerance; mf?: string; values?: CorrelationValues; skipDataUpdate?: boolean; } export declare interface CorrelationData { values: CorrelationValues; options: CorrelationBuildOptions; state: CorrelationState; } export declare interface CorrelationLink extends CorrelationAndLinkFields { atomType: string[]; signal: Signal1D | Signal2D; axis: string | undefined; match: number[]; experimentLabel: string; experimentType: string; experimentID: string; } declare interface CorrelationOptions extends CorrelationAndLinkOptions { atomType?: string; label?: Record; link?: CorrelationLink[]; equivalence?: number; attachment?: Record; protonsCount?: number[]; hybridization?: number[]; } declare type CorrelationState = Record; export declare type CorrelationTolerance = Record; export declare type CorrelationValues = Correlation[]; export declare const couplingACSPatterns: string[]; declare interface CouplingGroupInput { id: string; parentID: string; name: string; remarks: string; v: number; vl: number; vh: number; sf: number[]; t: string; } declare interface CouplingInput { id: ID; pid: ID; n: string; r: string; cg: ID; s: [ID, ID]; } export declare const couplingPatterns: OneLetterMultiplet[]; export declare function createApodizationWindowData(options: { windowOptions: { dw: number; length: number; }; shapes: Shapes; }): Float64Array; /** * This function converts a set of 2D-peaks in 2D-signals. Each signal could be composed * of many 2D-peaks, and it has some additional information related to the NMR spectrum. * @private */ export declare interface CreateSignals2DOptions { nCols: number; nRows: number; absoluteData: number[] | Float64Array; originalData: number[] | Float64Array; observedFrequencies: number[] | Float64Array; tolerances: number[]; nuclei: string[]; realTopDetection: boolean; minY: number; maxY: number; minX: number; maxX: number; } declare interface CTJSONConverterOutput { molarFraction: { value: number; low: number; high: number; }; fieldStrength: number; baseItensity: number; intensityLimit: number; spinSystemFlags: number[]; spinSystemType: string; analysisType: number; inchiKey: string; populations: ReturnType; lineShapes: ReturnType; shiftGroups: ReturnType; shifts: ReturnType; couplingGroups: ReturnType; couplings: ReturnType; atoms: ReturnType; bonds: ReturnType; } declare interface CTJSONInput { v: number; vl: number; vh: number; f: number; bi: number; il: number; sf: number[]; sst: number; at: number; ik: string; p: PopulationInput[]; l: LineShapeData[]; sg: ShiftGroupEntry[]; s: ShiftInput[]; cg: CouplingGroupInput[]; c: CouplingInput[]; a: AtomInput[]; b: BondInput[]; } declare interface CTParserResult extends Omit { shifts: ParsedShift[]; couplings: ParsedCoupling[]; } declare interface CTSignal { delta: number; diaIDs: string[]; js: Jcoupling[]; nbAtoms: number; atoms: number[]; } export declare interface DatabaseNMREntry { id: string; ocl?: OCLMolecule; smiles?: string; solvent: string; nucleus: string; jcampURL?: string; names?: string[]; meta?: Record; ranges: NMRRange[]; signals?: NMRSignal1D[]; } export declare interface DataResurrect { info: { solvent?: string; frequency: number; dimension: 1; nucleus: string; }; ranges: NMRRange[]; acsString: string; normalized: string; parts: string[]; } export declare type DataXReOptionalIm = Omit & Partial>; export declare const default1DApodization: Shapes; declare const defaultDirectOptimizationOptions: { iterations: number; }; declare const defaultLMOptimizationOptions: { damping: number; maxIterations: number; errorTolerance: number; }; declare const defaultLMOptimizationOptions_2: { damping: number; maxIterations: number; errorTolerance: number; }; declare function deleteFilter(datum: Entry1D, id?: string, logger?: Logger): void; declare function deleteFilter_2(datum: Entry2D, id?: string, logger?: Logger): void; declare class DiffusionRegression extends BaseRegression { coefficient: number; signalAbsenseDiffussion: number; gyromagneticRatio: number; gradientPulseDuration: number; timeCorrection: number; constructor(coefficient: number, signalAbsenseDiffussion: number, options: CalculateDiffussionCoefficientOptions); _predict(gradientAmplitude: number): number; } declare type DigitalFilter = FilterFactory & Pick; declare type DigitalFilter2D = FilterFactory & Pick; declare type DigitalFilterOptions = DigitalFilterOption['value']; declare type DigitalFilterOptions_2 = DigitalFilter2DOptions['value']; declare interface DirectOptimizationOptions extends DirectOptions { directOptions?: DirectOptions; minValues: ArrayLike; maxValues: ArrayLike; } declare type DirectOptimizationOptionsDefaultsKeys = Extract<'minValues' | 'maxValues' | 'initialValues' | 'gradientDifference' | keyof typeof defaultDirectOptimizationOptions, keyof DirectOptimizationOptions>; declare type EmptyValue = void | undefined | null; declare function enableFilter(datum: Entry1D, options: { id: string; enabled?: boolean; logger?: Logger; }): void; declare function enableFilter_2(datum: Entry2D, options: EnableFilterOptions): void; declare interface EnableFilterOptions { id: string; enabled?: boolean; logger?: Logger; } /** * Takes a potentially invalid signal kind and makes sure a valid kind is returned. */ export declare function ensureValidSignalKind(kind: string | undefined): SignalKind; declare interface Entry1D { id?: string; data: NmrData1D; originalData?: NmrData1D; peaks: Peaks; integrals: Integrals; ranges: Ranges; info: Info1D; originalInfo?: Info1D; filters: Filter1DEntry[]; processingInfo: ProcessingInfo1D; originalProcessingInfo: ProcessingInfo1D; } declare interface Entry2D { id?: string; zones: Zones; info: Info2D; meta?: Record; originalInfo?: Info2D; data: T; originalData?: T; filters: Filter2DEntry[]; processingInfo: ProcessingInfo2D; originalProcessingInfo: ProcessingInfo2D; } declare type EquallySpaced = FilterFactory & Pick; declare type EquallySpacedFilterOptions = EquallySpacedOptions['value']; declare type ExclusionZones = FilterFactory & Pick; declare type ExclusionZonesFilterOptions = ExclusionZonesOptions['value'][number]; declare interface Exponential { kind: 'exponential'; options: ShapeOption; } declare type FFT1D = FilterFactory> & Pick; declare type FFTDimension1 = FilterFactory & Pick; declare type FFTDimension2 = FilterFactory & Pick; export declare function fftDirectDimension(data: DataReImMatrix, options?: DirectDimensionOptions): { re: Float64Array[]; im: Float64Array[]; }; export declare function fftIndirectDimension(data: DataReImMatrix, options?: IndirectDimensionOptions): Record[]>; export declare type Filter1D = FFT1D | BaselineCorrection1D | BackwardLinearPrediction1D | Apodization1D | DigitalFilter | EquallySpaced | ExclusionZones | ForwardLP1D | PhaseCorrection1D | ShiftX | SignalProcessing | Trim | ZeroFilling; export declare type Filter2D = ApodizationDimension1 | ApodizationDimension2 | BaselineCorrection2D | BackwardLPDimension1 | BackwardLPDimension2 | NUSDimension2 | FFTDimension1 | FFTDimension2 | FordwardLPDimension1 | FordwardLPDimension2 | DigitalFilter2D | PhaseCorrection2D | ZeroFillingDimension1 | ZeroFillingDimension2 | SymmetrizeCosyLike | Shift2DX | Shift2DY; export declare interface FilterDomainUpdateRules { updateYDomain: boolean; updateXDomain: boolean; } declare interface FilterFactory { label: string; isApplicable: (datum1D: EntryType, options?: OptionsType) => boolean; /** * Filter function that process the data in place. */ apply: (datum1D: EntryType, options: OptionsType) => void; /** * This function is called when the same filter had been applied * it returns the value should be applied to the filter (reduce) and */ reduce: (previousValue: OptionsType, newValue: OptionsType) => { /** * if it is true and there is only one filter to be applied * FiltersManager will applied the filter on the processed data. */ once: boolean; /** * reduced value of the filter to be applied. */ reduce: OptionsType; }; domainUpdateRules: Readonly; } declare type FilterFunction = Extract; declare type FilterOptions = Extract[1], object>; export declare const Filters1D: { [K in Filter1D['name']]: Extract; }; export declare namespace Filters1DManager { export { applyFilters, reapplyFilters, enableFilter, deleteFilter, applyFilter } } export declare const Filters2D: { [K in Filter2D['name']]: Extract; }; export declare namespace Filters2DManager { export { applyFilters_2 as applyFilters, reapplyFilters_2 as reapplyFilters, enableFilter_2 as enableFilter, deleteFilter_2 as deleteFilter, applyFilter_2 as applyFilter } } declare type FilterSymbols = (typeof Filters)[keyof typeof Filters]; declare function findLinkedCorrelationsBySignalID(correlations: CorrelationValues, signalID: string): Correlation[]; declare function findLinksBySignalID(correlations: CorrelationValues, signalID: string): CorrelationLink[]; /** * Look for a multiplet based on the pattern name or abbreviation. * @param name - pattern name or abbreviation. */ export declare function findMultiplet(name: string): MatchingMultiplicity | undefined; /** * Finds a peak that can serve as a pivot point within specified boundaries. * The pivot is selected based on its y-value being above a threshold and its position * being closest to either boundary (minX or maxX). * @param peaks - Array of points containing x and y coordinates * @param options - Configuration object for finding the pivot * @returns The peak that serves as pivot point * @throws {Error} If peaks array is empty */ export declare function findPivot(peaks: PointXY[], options: XYObjectSidePointOptions): PointXY; declare type FordwardLPDimension1 = FilterFactory> & Pick; declare type FordwardLPDimension2 = FilterFactory> & Pick; declare type ForwardLP1D = FilterFactory> & Pick; declare interface Gaussian { kind: 'gaussian'; options: ShapeOption; } export declare interface GeneralAssignment { score: number; assignment: SpectraDataWithIds[]; } /** * Generate possible 13C assignments for the provided 1D ranges using * predicted carbon shifts for the given molecule. It is based on the paper * Fully automatic assignment of small molecules' NMR spectra without relying * on chemical shift predictions {@link https://doi.org/10.1002/mrc.4272} * * The function: * - Predicts 13C spectra for the provided molecule. * - Ensures signals include atoms, diaIDs and nbAtoms (throws otherwise). * - Normalizes range integrations (missing integration values become 0). * - Builds assignments using buildAssignments and the provided options. * * @param ranges - Array of NMR ranges to assign. Missing integration values are set to 0. * @param molecule - openchemlib Molecule used for shift prediction. * @param {Get13CAssignmentsOptions} options - to control assignment behavior. * @returns Promise resolving to the assignment results produced by buildAssignments. * * @throws If predicted signals do not include required atoms/diaIDs/nbAtoms properties. */ export declare function get13CAssignments(ranges: NMRRange[], molecule: Molecule, options?: Get13CAssignmentsOptions): Promise; /** * Options for get13CAssignments. * * restrictionByCS: Partial restrictions applied to chemical-shift matching when building assignments. * minScore: Minimum score to accept an assignment (default: 1). * maxSolutions: Maximum number of assignment solutions to return (default: 10). * nbAllowedUnAssigned: Number of allowed unassigned signals in a solution (default: 0). * timeout: Time limit in milliseconds to finish the assignment procedure (default: 6000). * predictionOptions: Options forwarded to the carbon prediction routine. */ export declare interface Get13CAssignmentsOptions { /** * Partial restrictions applied to chemical-shift matching. */ restrictionByCS?: Partial; /** * min score to accept an assignment * @default 1 */ minScore?: number; /** * maximal number of assignments to return * @default 10 */ maxSolutions?: number; /** * number of allowed unassignment signals * @default 0 */ nbAllowedUnAssigned?: number; /** * time limit in miliseconds to finish the assignment procedure. * @default 6000 */ timeout?: number; /** * prediction options forwarded to the carbon prediction. */ predictionOptions?: PredictCarbonOptions; } export declare function get1DErrorFactor(spectrum: Entry1D): number; /** * Generate possible 1H assignments for the provided 1D ranges using * predicted proton shifts and integration values for the given molecule. It is based on the paper * Fully automatic assignment of small molecules' NMR spectra without relying * on chemical shift predictions {@link https://doi.org/10.1002/mrc.4272} * * The function: * - Predicts 1H spectra for the provided molecule. * - Ensures signals include atoms, diaIDs and nbAtoms (throws otherwise). * - Normalizes range integrations (missing integration values become 0). * - Builds assignments using buildAssignments and the provided options. * * @param ranges - Array of NMR ranges to assign. Missing integration values are set to 0. * @param molecule - openchemlib Molecule used for shift prediction. * @param {Get1HAssignmentsOptions} options - to control assignment behavior. * @returns Promise resolving to the assignment results produced by buildAssignments. * * @throws If predicted signals do not include required atoms/diaIDs/nbAtoms properties. */ export declare function get1HAssignments(ranges: NMRRange[], molecule: Molecule, options?: Get1HAssignmentsOptions): Promise; export declare interface Get1HAssignmentsOptions { restrictionByCS?: Partial; /** * min score to accept an assignment * @default 1 */ minScore?: number; /** * maximal number of assignments to return * @default 10 */ maxSolutions?: number; /** * number of allowed unassignment signals * @default 0 */ nbAllowedUnAssigned?: number; /** * time limit in miliseconds to finish the assignment procedure. * @default 6000 */ timeout?: number; /** * prediction options */ predictionOptions?: PredictProtonOptions; } export declare function get2DErrorFactor(spectrum: Entry2D): Zone2DError; export declare function getAssignments(input: GetAutoAssignmentInput, options?: GetAssignmentsOptions): Promise; export declare interface GetAssignmentsOptions { justAssign?: AtomTypes[][]; restrictionByCS?: Partial; /** * min score to accept an assignment * @default 1 */ minScore?: number; /** * maximal number of assignments to return * @default 10 */ maxSolutions?: number; /** * number of allowed unassignment signals * @default 0 */ nbAllowedUnAssigned?: Record; /** * time limit in miliseconds to finish the assignment procedure. * @default 6000 */ timeout?: number; /** * predictions */ predictions?: { H?: NMRSignal1D[]; C?: NMRSignal1D[]; }; /** * prediction options */ predictionOptions?: { H?: PredictProtonOptions; C?: PredictCarbonOptions; }; /** * correlation options */ correlation?: { tolerance?: Record; }; } /** * Returns the number of atoms per atom type for a given molecular formula. * * @param {string} mf */ declare function getAtomCounts(mf: string): Record; declare function getAtoms(a: AtomInput[]): AtomOutput[]; /** * Returns the atom type from nucleus. * @param {string} nucleus */ declare function getAtomTypeFromNucleus(nucleus: string): string; export declare interface GetAutoAssignmentInput { spectra: SpectraData[]; /** * Instance of Molecule */ molecule: Molecule; } /** * Compute baseline zones using Dietrich method and convert them to anchors. * Defaults: `numAnchors = 10`, `algorithm = 'median'`. */ export declare function getBaselineAnchors(data: NmrData1D, options?: GetBaselineAnchrosOptions): DataXY; export declare type GetBaselineAnchrosOptions = SelectAnchorOptions & BaselineZoneOptionsDietrich; /** * Need to find where is the baseline (so in fact only noise) * The approach is to find the peaks using GSD and then to enlarge the peaks * to determine the zones where the baseline is not present * @param data * @param options */ export declare function getBaselineZones(data: NmrData1D, options?: BaselineZoneOptions): BaselineCorrectionZone[]; /** * Generate baseline zones by Dietrich method, it uses an iterative thresholding to discard signals zones over a power spectrum. * the implementation is based on the publication of Cobas et al (DOI: {@link https://doi.org/10.1016/j.jmr.2006.07.013}) * @param data * @param options */ export declare function getBaselineZonesByDietrich(data: NmrData1D, options?: BaselineZoneOptionsDietrich): BaselineCorrectionZone[]; declare function getBonds(b: BondInput[]): BondOutput[]; declare function getCorrelationDelta(correlation: Correlation): number | undefined; /** * Returns the array index of a correlation. * * @param correlations * @param correlation */ declare function getCorrelationIndex(correlations: CorrelationValues, correlation: Correlation): number; /** * Returns all correlations of a certain atom type. * * @param correlations * @param atomType */ declare function getCorrelationsByAtomType(correlations: CorrelationValues, atomType: string): CorrelationValues; declare function getCouplingGroups(cg: CouplingGroupInput[]): { id: string; parentID: string; name: string; remarks: string; coupling: { value: number; low: number; high: number; }; spinSystemFlags: number[]; couplingType: string; }[]; declare function getCouplings(c: CouplingInput[]): { id: string; parentID: string; name: string; remarks: string; couplingGroup: string; shifts: { from: string; to: string; }; }[]; export declare function getDatabase(url?: string, options?: { /** * @default 'tsv' */ format?: 'tsv' | 'json'; }): Promise; /** * @deprecated use getRelativeFrequency instead */ export declare const getFrequency: typeof getRelativeFrequency; declare interface GetKernelOptions { sigma?: number; xLength?: number; yLength?: number; } declare function getLabel(correlations: CorrelationValues, correlation: Correlation): string; declare function getLabels(correlations: CorrelationValues, correlation: Correlation, experimentType: string): string[]; declare function getLineShapes(l: LineShapeData[]): LineShapeResult[]; declare function getLinkDelta(link: CorrelationLink): number | undefined; declare function getLinkDim(link: CorrelationLink): number; export declare function getPeakDelta(peak: Peak1D | NMRPeak1D, shiftTarget: ShiftTarget, shift: number): { originalX: number; x: number; }; export declare interface GetPeakListOptions extends GSDOptions, OptimizeNMRPeaksOptions, JoinBroadNMRPeaksOptions { smoothedY: NumberArray; /** * If it is true, the peaks parameters will be optimized. * @default false */ optimize: boolean; /** * frequency used to convert width and fwhm to Hz */ frequency: number; /** * maximum absolute value of the second derivative of the intensity array, if it is not passed * the function will calculate it. */ maxAbsDdY?: number; } declare function getPopulations(p: PopulationInput[]): PopulationOutput[]; /** * calculate the frequency of a nucleus with respect to a reference nucleus * @param nucleus * @param observedNucleusData */ export declare function getRelativeFrequency( /** * nucleus to calculate the frequency */ nucleus: string, observedNucleusData: ObservedNucleusData): number; declare function getShiftGroups(sg: ShiftGroupEntry[]): { id: string; parentID: string; name: string; remarks: string; shift: { value: number; low: number; high: number; }; spin2: number; spinCount: number; exchangeable: boolean; spinSystemFlags: number[]; gamma: number; iterationWeight: number; response: { value: number; low: number; high: number; sf: number[]; }; population: string; lineShape: string; }[]; declare function getShifts(s: ShiftInput[]): ShiftOutput[]; export declare function getShiftX(spectrum: Entry1D): number; declare type GSDNMRPeakOptimizedID = Omit & { shape: NMRShape1D; }; declare interface HOSEPrediction { /** * In case the prediction is based on HOSE codes, this is the sphere * used to make the prediction. */ sphere: number; /** * The HOSE code used to make the prediction. */ hose: string; } declare type ID = string; declare function isEditedHSQC(experiment: Pick): boolean; export declare function isEmptyMolecule(molecule: Molecule): boolean; export declare function isMolfileNotEmpty(molFile?: string): molFile is string; export declare function isRangeExists(range: Pick, spectrum: Entry1D, error: number): boolean; export declare function isZoneExists(zone: Pick, spectrum: Entry2D, error: Zone2DError): boolean; declare type JcouplingFromPrediction = MakeMandatory; declare type JoinBroadNMRPeaksOptions = Omit & { shape?: NMRShape1D; }; declare type LevenbergMarquardtOptimizationOptionsDefaultsKeys = Extract<'minValues' | 'maxValues' | 'initialValues' | 'gradientDifference' | keyof typeof defaultLMOptimizationOptions, keyof LevenbergMarquardtOptions>; declare type LevenbergMarquardtOptionsDefault = Pick; declare type LevenbergMarquardtOptionsOverride = Omit; declare type LevenbergMarquardtOptionsWithDefaultKeys = 'initialValues' | 'minValues' | 'maxValues' | keyof typeof defaultLMOptimizationOptions_2; declare interface LineShapeData { id: string; pid: string; n: string; r: string; sf: number[]; l: { v: number; low: number; high: number; }; g: { v: number; low: number; high: number; }; } declare interface LineShapeResult { id: string; parentID: string; name: string; remarks: string; spinSystemFlags: number[]; lineWidth: { value: number; low: number; high: number; }; gaussian: { value: number; low: number; high: number; }; } declare interface LinkOptions extends CorrelationAndLinkOptions { atomType?: string[]; experimentType?: string; experimentID?: string; signal?: Signal1D | Signal2D; axis?: string; match?: number[]; experimentLabel?: string; } declare type MakeMandatory = T & { [P in K]-?: T[P]; }; export declare function mapIntegrals(integrals: Integral[], spectrum: Entry1D, shiftTarget?: ShiftTarget): Integral[]; declare interface MapOptions { checkIsExisting?: boolean; shiftTarget?: ShiftTarget; } export declare function mapPeaks(peaks: Peak1D[], spectrum: Entry1D, options?: MapOptions): Peak1D[]; export declare function mapRanges(ranges: Range_2[] | NMRRange[], spectrum: Entry1D, options?: MapOptions): Range_2[]; export declare function mapZones(zones: readonly ZoneForMapping[], datum: Entry2D, options?: MapOptions): Zone[]; export declare function markSolventPeaks(input: T[], solventSignals: NMRSignal1D[], options?: MarkSolventPeaksOptions): T[]; declare interface MarkSolventPeaksOptions { /** * The NMR spectrometer frequency in MHz * @default 400 */ frequency?: number; } export declare type MatchingMultiplicity = MultipletDefinition & { match: string; isBroad: boolean; }; export declare function matrixToBoxPlot(input: NumberArray[], options?: { colors?: string[]; }): { color: (string | undefined)[]; max: Float64Array; min: Float64Array; median: Float64Array; q1: Float64Array; q3: Float64Array; }; export declare function matrixToStocsy(matrix: NumberArray[], index: number, options?: MatrixToStocsyOptions): { y: number[]; correlations: Float64Array; color: (string | undefined)[]; }; declare interface MatrixToStocsyOptions { /** * Array of colors to use for the plot * @default "['blue', 'cyan', 'yellow', 'red']" */ colors?: string[]; } declare interface MinMaxContent { z: Float64Array[]; minX: number; maxX: number; minY: number; maxY: number; minZ: number; maxZ: number; } export declare interface MultipletDefinition { label: string; value: OneLetterMultiplet; acs?: string; names: string[]; multiplicity: number | null; } export declare const MultiplicityPatterns: MultipletDefinition[]; export declare interface NMRPeak1DFull extends NMRPeak1D { id: string; shape: Shape1DWithFWHM; width: number; } export declare type NMRPeak1DWithShapeID = MakeMandatory; declare interface NMRRangeWithIds extends Omit { id: string; signals: NMRSignal1DWithId[]; } export declare type NMRRangeWithIntegration = MakeMandatory; export declare type NMRSignal1DFromPrediction = MakeMandatory & { statistics?: XRobustDistributionStats; metadata?: HOSEPrediction; }; export declare type NMRSignal1DWithAtomsAndDiaIDs = MakeMandatory; export declare type NMRSignal1DWithId = MakeMandatory; export declare interface NMRSignal2D { x: Signal2DProjection; y: Signal2DProjection; j?: { pathLength?: number | FromTo; }; id?: string; peaks?: T[]; kind?: SignalKind; } export declare type NMRSignal2DWithID = MakeMandatory, 'id'>; export declare type NMRSignal2DWithId = MakeMandatory; export declare interface NMRZone { x: FromTo; y: FromTo; integration?: number; absolute?: number; id?: string; signals: NMRSignal2D[]; } export declare type NMRZoneWithID = MakeMandatory; declare interface NMRZoneWithIds extends Omit { id: string; signals: NMRSignal2DWithId[]; } /** * The idea is to convert nucleus name like H1, proton or Fluorine19 to 1H and 19F. * @param nucleus */ export declare function normalizeNucleus(nucleus: string): string; declare interface NucleusType { atomicNumber: number; isotope: number; } declare type NumToNumFn = (x: number) => number; declare type NUSDimension2 = FilterFactory & Pick; export declare interface ObservedNucleusData { /** * nucleus to use as reference in the calculation of frequency */ nucleus: string; /** * frequency of the reference nucleus */ frequency: number; } export declare interface OneDimensionalAssignment { score: number; assignment: NMRRangeWithIntegration[]; } declare interface OneDOptions { proton: FromTo; carbon: FromTo; nbPoints: number; lineWidth: number; } export declare type OneLetterMultiplet = 's' | 'd' | 't' | 'q' | 'i' | 'h' | 'p' | 'o' | 'n' | 'm'; declare type OptimizeNMRPeaksOptions = Omit & { shape?: NMRShape1D; }; export declare function optimizeSignals(data: DataXY, signals: Signal[], options: OptimizeSignalsOptions): { delta: number; js: Jcoupling[]; shape: { kind: "gaussian" | "lorentzian" | "pseudoVoigt" | "generalizedLorentzian"; fwhm: number; }; intensity: number; peaks: NMRPeak1DFull[]; }[]; export declare interface OptimizeSignalsOptions { /** * Initial line width in Hz * @default 1 */ lineWidth?: number; /** * @default 'min intensity value' */ baseline?: number; shape?: NMRShape1D; parameters?: ParametersFromOptions; optimization?: OptimizeSignalsOptionsOptimization; simulation: SignalsToPointXYOptions; } declare interface OptimizeSignalsOptionsDirectOptimization { kind: 'direct'; options: Partial> & Omit; } declare interface OptimizeSignalsOptionsLevenbergMarquardtOptimization { kind: 'lm'; options: Partial> & Omit; } export declare type OptimizeSignalsOptionsOptimization = OptimizeSignalsOptionsDirectOptimization | OptimizeSignalsOptionsLevenbergMarquardtOptimization; declare interface OptionsPeaksToRanges { /** * Number of hydrogens or some number to normalize the integration data. If it's zero return the absolute integration value * @default 100 */ integrationSum?: number; /** * Peak shape used to reconstruct additional or filtered peaks when compiling patterns. * @default { kind: 'gaussian' } */ shape?: NMRShape1D; /** * if it is true, it will join any overlaped ranges. * @default true */ joinOverlapRanges?: boolean; /** * If exits it remove all the signals with integration < clean value * @default 0.4 */ clean?: number; /** * If true, the Janalyzer function is run over signals to compile the patterns. * @default true */ compile?: boolean; /** * option to chose between approx area with peaks or the sum of the points of given range ('sum', 'peaks') * @default 'sum' */ integralType?: string; /** * Observed frequency * @default 400 */ frequency?: number; /** * distance limit to clustering peaks. * @default 16 */ frequencyCluster?: number; /** * If true, it will keep the peaks for each signal */ keepPeaks?: boolean; /** * Nucleus * @default '1H' */ nucleus?: string; /** * ratio of heights between the extreme peaks * @default 1.5 */ symRatio?: number; /** * solvent name to assign the signals with kind solvent */ solvent?: string; } export declare interface OptionsSignalsToXY extends Partial { frequency?: number; /** * The low limit of the ordinate variable. * @default 0 */ from?: number; /** * The upper limit of the ordinate variable. * @default 10 */ to?: number; /** * Shape options for ml-spectrum-generator */ shape?: NMRShape1D; /** * The linewidth of the output spectrum, expresed in Hz. * @default 1 */ lineWidth?: number; /** * Number of points of the output spectrum. * @default 16*1024 */ nbPoints?: number; /** * Default height of the simulated spectrum * @default 1e8 */ maxValue?: number; /** * Maximum number of atoms on each cluster that can be considered to be simulated together. It affects the the quality and speed of the simulation. * @default 9 */ maxClusterSize?: number; } export declare interface OptionsXYAutoPeaksPicking extends Partial { /** * Low limit value in the x axis to extract a sub set of points from the input data. */ from?: number; /** * Upper limit value in the x axis to extract a sub set of points from the input data. */ to?: number; /** * the factor that multiplies the noise level to set up a threshold to select peaks with respect to the intensity. * @default 3 */ thresholdFactor?: number; /** * look for peaks in negative, positive or both sense * @default 'positive' */ direction?: 'negative' | 'positive' | 'both'; /** * If it is true, it calculate the noise level by sanPlot method. * @default false */ useSanPlot?: boolean; /** * frequency used to convert width and fwhm to Hz */ frequency: number; /** * Controls the degree of baseline smoothing applied to the data before peak picking. * Higher values (closer to 100) mean less smoothing, while lower values (closer to 1) increase smoothing. * Useful for reducing noise and improving peak detection in spectra with varying baseline quality. * @default 100 */ sensitivity?: number; } export declare type OptionsXYAutoRangesPicking = OptionsXYAutoRangesPickingDefault | OptionsXYAutoRangesPickingCarbonDecoupled | OptionsXYAutoRangesPickingProton; declare interface OptionsXYAutoRangesPickingCarbonDecoupled { peakPicking: OptionsXYAutoPeaksPicking; impurities?: PeaksMarkProtonImpuritiesOptions; identifyNMRSolvent?: boolean; identifyImpurities?: boolean; ranges?: OptionsPeaksToRanges; logger?: Logger; } declare interface OptionsXYAutoRangesPickingDefault { peakPicking: OptionsXYAutoPeaksPicking; ranges?: OptionsPeaksToRanges; logger?: Logger; } declare interface OptionsXYAutoRangesPickingProton { peakPicking: OptionsXYAutoPeaksPicking; impurities?: PeaksMarkProtonImpuritiesOptions; identifyResidualSolvent?: boolean; identifyImpurities?: boolean; ranges?: OptionsPeaksToRanges; logger?: Logger; } declare type Parameter = 'delta' | 'intensity' | 'fwhm' | 'mu' | 'coupling' | 'gamma' | 'fwhmG' | 'fwhmL'; declare type ParametersFromOptions = Record number)>>; declare type ParametersFromSignal = Record>; export declare function parseCT(json: CTJSONInput, molfile: string, options: { logger?: LightLogger; atomicNumber?: number; }): ParseCTOutput; export declare interface ParseCTOutput extends CTParserResult { signals: CTSignal[]; } /** * Interface for coupling data between atoms */ declare interface ParsedCoupling { from: Atom[]; to: Atom[]; value: number; } /** * Interface for chemical shift data */ declare interface ParsedShift { atoms: Atom[]; value: number; } export declare interface Peak2DSeries { x: number[]; y: number[]; z: number[]; } declare interface PeaksMarkProtonImpuritiesOptions { /** * Frequency of the spectrometer to convert peak width from Hz to ppm * @default 400 */ frequency?: number; /** * Solvent name. */ solvent?: string; /** * tolerance in ppm to assign an impurity. * @default 0.025 */ error?: number; } /** * Generates an NMR Free Induction Decay (FID) signal from a list of peaks. * @param peaks - The list of peaks, where: * - `x` is the chemical shift in ppm. * - `y` is the intensity of the peak. * @param options - The options for FID generation. * @param [options.from=0] - The start of the spectral window in ppm. * @param [options.to=10] - The end of the spectral window in ppm. * @param [options.nbPoints=1024] - The number of data points in the FID. * @param [options.frequency=400] - The spectrometer frequency in MHz. * @param [options.t2Relaxation] - An array of T2 relaxation times in milliseconds for each peak. * If not provided, all peaks are assigned a default T2 relaxation time of 100 ms. * @returns - The generated FID signal, where: * - `re` is the real part of the FID. * - `im` is the imaginary part of the FID. */ export declare function peaksToFID(peaks: Array<{ x: number; y: number; }>, options: SignalsToFIDOptions & { t2Relaxation?: NumberArray; }): { re: Float64Array; im: Float64Array; }; export declare function peaksToXY(peaks: NMRPeak1D[], options: PeaksToXYOptions): DataXY>; /** * Convert an array of peaks assuming that width/fwhm is in Hz */ export declare interface PeaksToXYOptions extends OptionsSG1D { /** * First x value (inclusive). * @default `firstPeak.x + firstPeak.width * 3` */ from?: number; /** * Last x value (inclusive). * @default `lastPeak.x + lastPeak.width * 3` */ to?: number; /** * frequency of the spectrum */ frequency: number; } export declare function peakToXY(peak: NMRPeak1D, options: PeaksToXYOptions): DataXY>; declare type PhaseCorrection1D = FilterFactory & Pick; declare type PhaseCorrection2D = FilterFactory & Pick; declare interface PopulationInput { id: ID; pid: ID; n: string; r: string; v: number; vl: number; vh: number; sf: number[]; } declare interface PopulationOutput { id: ID; parentID: ID; name: string; remarks: string; population: { value: number; low: number; high: number; }; spinSystemFlags: number[]; } /** * Generate the 2D correlation nmr peaks based on the number of bonds between a pair of atoms * @param molecule * @param options * @returns - object with molfile, diaIDs, 1D and 2D signals, joined signals, ranges and zones. */ export declare function predict(molecule: Molecule, options?: PredictAllOptions): Promise; export declare interface PredictAllOptions { /** * mono dimensional signal to generate the bidimenionals cross peaks. * The object should has properties with name equal to "H" and "C". */ predictOptions?: PredictionOptionsByExperiment; /** * signals with euclidean distance in ppm less than this it will * joined into a zone. * @default {H:0.05,C:0.5} */ joinDistance?: { H: number; C: number; }; logger?: Logger; } export declare interface PredictAllSpectraOptions { logger?: Logger; prediction?: PredictAllOptions; simulation?: SimulationOptions; } export declare interface PredictCarbonOptions { /** * Predictor function. Will use by default webservice: https://nmr-prediction.service.zakodium.com/v1/predict/carbon * @default defaultCarbonPredictor */ predictor?: PredictorFn; /** * Options to pass to the predictor function. * @default {} */ predictorOptions?: Record; /** * Prediction cache handler. */ cache?: PredictionCacheFn; } declare interface PredictCOSYOptions { /** * maximum number of bonds to take into account. * If either maxLength or minLength is not provided, the function will calculate * the correlation paths based on the coupling constants as defined by the minCoupling option. */ maxLength?: number; /** * minimum number of bonds to take into account * If either maxLength or minLength is not provided, the function will calculate * the correlation paths based on the coupling constants as defined by the minCoupling option. */ minLength?: number; /** * minimum scalar coupling in Hz to draw the cross-peak * @default 1.5 */ minCoupling?: number; /** * signals with euclidean distance in ppm less than this it will * joined into a zone. */ joinDistance?: { H: number; }; /** * mono dimensional signal to generate the bidimenionals cross peaks. * The object should has properties with name equal to "H" and "C". * the value of each prediction should be similar that predictProton and predictCarbon. */ predictions: { [key: string]: PredictionBase1D | undefined; H?: PredictionBase1D; }; /** * if true, the self correlation signal will be add to the prediction. * @default true */ includeDiagonal?: boolean; } export declare interface Predicted { molfile: string; molfileWithH: string; hoses: string[]; diaIDs: string[] | undefined; groupedDiaIDs: GroupedDiaID[]; moleculeWithHydrogens: Molecule; distanceMatrix: NumberArray[]; spectra: PredictedSpectra; } export declare interface Predicted1DSpectra { proton?: PredictionBase1D; carbon?: PredictionBase1D; } export declare interface Predicted2DSpectra { cosy?: PredictionBase2D; hsqc?: PredictionBase2D; hmbc?: PredictionBase2D; } export declare interface PredictedSpectra extends Predicted1DSpectra, Predicted2DSpectra { } declare interface PredictedSpectrum1D { data: { x: NumberArray; re: NumberArray; im: null; }; info: Spectrum1DInfo; ranges: { values: Array<{ from: number; to: number; }>; }; } declare interface PredictedSpectrum2D { data: { rr: MinMaxContent & { noise: number; }; }; info: Spectrum2DInfo; zones: { values: Array<{ x: FromTo; y: FromTo; }>; }; } /** * Generate the correlation bidimensional nmr peaks based on the number of bonds between a pair of atoms * @returns {Promise} - object with molfile, diaIDs, 2D signals joined signals and zones. */ declare interface PredictHMBCOptions { /** * maximum number of bonds to take into account. * @default 3 */ maxLength?: number; /** * minimum number of bonds to take into account * @default 2 */ minLength?: number; /** * signals with euclidean distance in ppm less than this it will * joined into a zone. */ joinDistance?: { H: number; C: number; }; /** * mono dimensional signal to generate the bidimenionals cross peaks. * The object should has properties with name equal to "H" and "C". * the value of each prediction should be similar that predictProton and predictCarbon. */ predictions: { [key: string]: PredictionBase1D | undefined; H?: PredictionBase1D; C?: PredictionBase1D; }; } declare interface PredictHSQCOptions { /** * maximum number of bonds to take into account. * @default 1 */ maxLength?: number; /** * minimum number of bonds to take into account * @default 1 */ minLength?: number; /** * signals with euclidean distance in ppm less than this it will * joined into a zone. * @default {H:0.05,C:0.5} */ joinDistance?: { H: number; C: number; }; /** * mono dimensional signal to generate the bidimenionals cross peaks. * The object should has properties with name equal to "H" and "C". * the value of each prediction should be similar that predictProton and predictCarbon. */ predictions: { [key: string]: PredictionBase1D | undefined; H?: PredictionBase1D; C?: PredictionBase1D; }; } export declare interface Prediction1D extends PredictionBase1D { molfile: string; diaIDs: string[]; molecule: Molecule; } export declare interface Prediction2D extends PredictionBase2D { molfile: string; diaIDs: string[]; molecule: Molecule; } export declare interface PredictionBase1D { nucleus: string; joinedSignals: NMRSignal1DFromPrediction[]; signals: NMRSignal1DFromPrediction[]; ranges: NMRRange[]; } export declare interface PredictionBase2D { nuclei: string[]; joinedSignals: NMRSignal2D[]; signals: NMRSignal2D[]; zones: NMRZone[]; } /** * A function that can be used to cache prediction results or get them from a cache. * The first parameter of the function is a string identifier for the molecule. * When the function is called with only one parameter, a cache entry should be returned, * or an empty value (empty string, null, or undefined) if no cache entry is found. * When the function is called with two parameters, the second parameter is the value that should be put in the cache. */ declare type PredictionCacheFn = (topicMolecule: TopicMolecule, result?: PredictionBase1D) => CacheResult; export declare interface PredictionOptionsByExperiment { H?: Partial; C?: Partial; hsqc?: Partial; cosy?: Partial; hmbc?: Partial; } /** * A function that should make a prediction for the given molecule and return the result. */ declare type PredictorFn = (topicMolecule: TopicMolecule, options?: Record) => Promise | PredictionBase1D; export declare interface PredictProtonOptions { /** * Predictor function. Will use by default webservice: https://nmr-prediction.service.zakodium.com/v1/predict/proton * @default defaultProtonPredictor */ predictor?: PredictorFn; /** * Options to pass to the predictor function. * @default {} */ predictorOptions?: Record; /** * Prediction cache handler. */ cache?: PredictionCacheFn; } export declare function predictSpectra(molecule: Molecule, options?: PredictAllSpectraOptions): Promise; export declare interface PredictSpectraResult { spectra: Array; molecules: Array<{ molfile: string; }>; } /** * Common laboratory solvents database (proton). * @see https://doi.org/10.1021/jo971176v */ export declare const protonImpurities: DatabaseNMREntry[]; export declare function rangeFromSignal(signal: NMRSignal1D, options?: RangeFromSignalOptions): { from: number; to: number; }; export declare interface RangeFromSignalOptions { /** * nucleus * @default '1H' */ nucleus?: string; /** * frequency observedhttps://www.wiley.com/en-us/NMR+Data+Processing-p-9780471039006#content-section * @default 400 */ frequency?: number; /** * tolerance to the halfWidth, default depends on the nucleus */ tolerance?: number; } declare type RangeFullfiled = MakeMandatory; export declare function rangesToACS(ranges: NMRRange[], options?: RangesToACSOptions): string; export declare interface RangesToACSOptions { /** * Nucleus type for the NMR experiment (e.g., '1H', '13C', '19F'). * Determines default formatting and frequency values. * @default '1H' */ nucleus?: string; /** * If true, sorts the chemical shift values in ascending order (low to high ppm). * If false, sorts in descending order (high to low ppm). * @default false */ ascending?: boolean; /** * Specifies which types of information to include for each range or signal in the ACS string output. * Each character in the string represents a data type: * * - 'I': Integral value (e.g., number of protons or integration value) * - 'M': Multiplicity (e.g., singlet, doublet, triplet) * - 'J': Coupling constants (J values in Hz) * - 'A': Assignment (atom or group assignment) * * The order of characters determines the order of information in the output. Any combination or subset is allowed, e.g.: * 'IMJ' (integral, multiplicity, coupling constants) * 'MA' (multiplicity, assignment) * 'I' (only integral) * * Example: 'IMJA' includes all available information in the order: Integral, Multiplicity, Assignment, Coupling constants. * * @default 'IMJA' */ format?: string; /** * Format string for chemical shift (delta) values, using [numeral.js](https://numeraljs.com/) syntax. * The default value depends on the nucleus type: * - '1H' and '19F': '0.00' * - '13C': '0.0' * @default '0.00' for '1H' and '19F', '0.0' for '13C' */ deltaFormat?: string; /** * Format string for scalar coupling constants (J values), using [numeral.js](https://numeraljs.com/) syntax. * Controls the number of decimals for J values in Hz. * @default '0.0' */ couplingFormat?: string; /** * Observed frequency of the NMR experiment in MHz. * The default value depends on the nucleus type: * - '1H' and '19F': 400 * - '13C': 100 * @default 400 for '1H' and '19F', 100 for '13C' */ observedFrequency?: number; /** * If true, filters out ranges or signals with kind 'impurity' or 'solvent'. * If false, includes all ranges and signals. * @default true */ filter?: boolean; /** * Name of the solvent used in the NMR experiment (e.g., 'CDCl3', 'DMSO'). * If provided, it will be included in the ACS string output. */ solvent?: string; } export declare function rangesToTSV(ranges: NMRRange[]): string; export declare function rangesToXY(ranges: NMRRange[], options?: RangesToXYOptions): { x: Float64Array; y: Float64Array; }; export declare interface RangesToXYOptions { nucleus?: string; frequency?: number; nbPoints?: number; lineWidth?: number; shape?: NMRShape1D; from?: number; to?: number; } export declare interface RangeToXYOptions { /** * frequency observed * @default 400 */ frequency: number; /** * line width to draw the signals * @default 1 */ lineWidth: number; /** * lower limit in the spectrum. * @default 0 */ from: number; /** * upper limit in the spectrum. * @default 10 */ to: number; /** * number of points of the spectrum. * @default 16384 */ nbPoints: number; /** * options of signals. default { kind: 'gaussian' } */ shape: NMRShape1D; } export declare namespace RangeUtilities { export { checkSignalKinds } } declare function reapplyFilters(datum: Entry1D, options?: { filters?: Filter1DOptions[]; logger?: Logger; }): void; declare function reapplyFilters_2(datum: Entry2D, options?: { filters?: Filter2DOptions[]; logger?: Logger; }): void; export declare function reimComplexBackwardLinearPrediction(data: DataReIm, options: BackwardLPOptions): { re: Float64Array; im: Float64Array; }; /** * Removes a link by id search. * * @param {Correlation} correlation * @param {string} id */ declare function removeLink(correlation: Correlation, id: string): Correlation; declare interface RestrictionByCS { chemicalShiftRestriction: boolean; tolerance: Record; useChemicalShiftScore: boolean; } declare interface RestrictionByCS1D { chemicalShiftRestriction: boolean; tolerance: number; useChemicalShiftScore: boolean; } export declare function resurrect(acsString: string, options?: ResurrectOptions): DataResurrect; export declare interface ResurrectOptions { logger?: Logger; } declare interface SelectAnchorOptions { /** * The number of anchors to select. * * Must be a positive integer. * @default 10 */ numAnchors?: number; /** * Window size (in number of points) used by the 'median' algorithm when * computing the median around each target x value. * * If omitted, a sensible default of `Math.max(1, Math.floor(y.length / 100))` * is used inside the function. */ windowSize?: number; } /** * Searches for a correlation index by id in correlation data and replaces it with a given correlation. * * @param {CorrelationData} data * @param {string} id * @param {Correlation} correlation */ declare function setCorrelation(data: CorrelationData, id: string, correlation: Correlation): CorrelationData; declare function setPathLength(correlations: CorrelationValues, signalID: string, pathLength: number | FromTo | undefined): CorrelationValues; declare type Shift2DX = FilterFactory & Pick; declare type Shift2DXOptions = Shift2DXFilterOptions['value']; declare type Shift2DY = FilterFactory & Pick; declare type Shift2DYOptions = Shift2DYFilterOptions['value']; declare interface ShiftGroupEntry { id: string; pid: string; n: string; r: string; v: number; vl: number; vh: number; s: number; c: number; ex: boolean; sf: number[]; g: number; iw: number; rs: { v: number; vl: number; vh: number; sf: number[]; }; p: ID; l: ID; } declare interface ShiftInput { id: ID; pid: ID; n: string; r: string; sg: ID; } declare interface ShiftOutput { id: ID; parentID: ID; name: string; remarks: string; shiftGroup: ID; } declare type ShiftTarget = 'origin' | 'current'; declare type ShiftX = FilterFactory & Pick; export declare interface Signal extends NMRSignal1D { intensity?: number; shape?: NMRShape1D; parameters?: ParametersFromSignal; } declare type Signal1DWidthDiaID = MakeMandatory; declare type Signal1DWidthJsAndDiaID = Omit & { js: JcouplingFromPrediction[]; }; export declare interface Signal2DProjection { nucleus?: string; delta: number; resolution?: number; atoms?: number[]; diaIDs?: string[]; } declare type SignalAxisForMapping = Omit & { originalDelta?: number; }; declare type SignalForMapping = Pick & { id?: string; x: SignalAxisForMapping; y: SignalAxisForMapping; peaks?: SignalPeakForMapping[]; }; /** * Join couplings smaller than a defined tolerance. * The resulting coupling should be an average of the existing one. * If pathLength is specified and is not always the same this property will be removed. * @param signal * @param options */ export declare function signalJoinCouplings(signal: S, options?: SignalJoinCouplingsOptions): S; export declare interface SignalJoinCouplingsOptions { /** * if it is true the coupling patterns will be normalized to ACS suggested values * @default false */ acsFormat?: boolean; /** * tolerance to merge the couplings * @default 0.05 */ tolerance?: number; /** * if it's true, the j coupling will be joined by proximity * @default false */ ignoreDiaIDs?: boolean; } export declare const signalKindLabelMapping: Readonly>; export declare const signalKindsToInclude: ReadonlySet; declare type SignalMaybeJcoupling = Pick; /** * Return * @param signal * @param options * @param options.acsFormat */ export declare function signalMultiplicityPattern(signal: NMRSignal1D, options?: { acsFormat?: boolean; }): string; declare type SignalPeakForMapping = Omit & { id?: string; }; declare type SignalProcessing = FilterFactory> & Pick; export declare function signals2DToZ(signals: NMRSignal2D[], options?: Signals2DToZOptions): { minX: number; maxX: number; minY: number; maxY: number; minZ: number; maxZ: number; z: Float64Array[]; }; declare interface Signals2DToZOptions { /** * lower limit in the spectrum, if it is a number the value will be defined for both axes * @default -1 */ from?: number | XYNumber; /** * upper limit in the spectrum, if it is a number the value will be defined for both axes * @default 12 */ to?: number | XYNumber; /** * Number of points of each dimension of the spectrum, * if it is a number the value will be defined for both axes * @default 512 */ nbPoints?: number | XYNumber; /** * full width at half maximum of signals for each dimension, * if it is a number the value will be defined for both axes. * @default 0.02 */ width?: number | XYNumber; factor?: number | XYNumber; } /** * Join signals if all the same diaID * @param signals * @param options * @returns */ export declare function signalsJoin(signals: NMRSignal1D[], options?: SignalsJoinOptions): Signal1DWidthJsAndDiaID[]; export declare interface SignalsJoinOptions { /** * options for signalJoinCouplings * @default {} */ joinCouplings?: SignalJoinCouplingsOptions; } /** * it use the chemical shifts and the coupling between them in order to generate a FID. * It does not propagate the hamiltonian of the spin system, instead it simulate all the * frequencies in the spectrum (including second order) and add all the waves in a real and * imaginary parts, that is why the couplings should be assigned in order to generate the spin system. * @param signals * @param options */ export declare function signalsToFID(signals: NMRSignal1D[], options: SignalsToFIDOptions): { re: Float64Array; im: Float64Array; }; export declare interface SignalsToFIDOptions { /** * at the end of the superposition of all component, an exponential apodization will be applied * in order to have FID like shape. * @default 1 */ lineBroadening?: number; /** * lower limit of the spectrum * @default 0 */ from?: number; /** * upper limit of the spectrum * @default 10 */ to?: number; /** * number of points of the resulting FID */ nbPoints?: number; /** * It is the frequency of the carrier (e.g. SFO1 for bruker spectrometers) */ frequency?: number; /** * Maximum number of atoms on each cluster that can be considered to be simulated together. * It affects the the quality and speed of the simulation. */ maxClusterSize?: number; } declare interface SignalsToPointXYOptions { frequency: number; maxClusterSize?: number; } export declare function signalsToRanges(signals: NMRSignal1D[], options?: SignalsToRangesOptions): RangeFullfiled[]; declare interface SignalsToRangesOptions { /** * minimal artificial width of a signal in ppm * @default 0.05 */ tolerance?: number; /** * Frequency in Hz of the spectrometer. * @default 400 */ frequency?: number; } /** * Generate a spectrum from an array of singals * @param signals * @param options */ export declare function signalsToXY(signals: NMRSignal1D[], options?: OptionsSignalsToXY): DataXY>; /** * This function simulates a one dimensional nmr spectrum. This function returns an array containing the relative intensities of the spectrum in the specified simulation window (from-to). * @param spinSystemInput * @param options */ export declare function simulate1D(spinSystemInput: SpinSystem, options?: Simulate1DOptions): DataXY>; export declare interface Simulate1DOptions extends SimulateXYPeaksOptions { /** * The low limit of the ordinate variable. * @default 0 */ from?: number; /** * The upper limit of the ordinate variable. * @default 10 */ to?: number; /** * Number of points of the output spectrum. * @default 16K */ nbPoints?: number; /** * Shape options * @default {kind:'gaussian'} */ shape?: NMRShape1D; /** * Function to generate or add a baseline */ baseline?: NumToNumFn; /** * Options to add noise to the spectrum */ noise?: Extract; /** * assume the spin system is a 1/2 (proton), if it's doesn't exists * it is defined by checking if all the levels are 2. */ isProton?: boolean; } declare interface SimulateXYPeaksOptions { /** * The frequency in Mhz of the fake spectrometer that records the spectrum. * @default 400 */ frequency?: number; /** * The linewidth of the output spectrum, expresed in Hz. * @default 1 */ lineWidth?: number; /** * Maximum number of atoms on each cluster that can be considered to be simulated together. It affects the the quality and speed of the simulation. * @default 9 */ maxClusterSize?: number; } /** * This function will generate an object compatible with NMR-ium * @param molecule * @param options */ declare interface SimulationOptions { frequency: number; oneD?: Partial; twoD?: Partial; } declare interface SineBell { kind: 'sineBell'; options: ShapeOption; } declare interface SineSquare { kind: 'sineSquare'; options: ShapeOption; } export declare function solventSuppression(peakList: T[], solvent: NMRSignal1D[], options?: { markSolventPeaks?: boolean; solventZoneExtension?: number; }): T[]; export declare type SpectraData = SpectraData1D | SpectraData2D; export declare interface SpectraData1D { id: string; ranges: NMRRange[]; info: Info1D; } export declare interface SpectraData1DWithIds extends Omit { ranges: NMRRangeWithIds[]; } export declare interface SpectraData2D { id: string; zones: NMRZone[]; /** * object with information about the spectrum, it is mandatory at the moment * to generate correlations. */ info: Info2D; } export declare interface SpectraData2DWithIds extends Omit { zones: NMRZoneWithIds[]; } export declare type SpectraDataWithIds = SpectraData1DWithIds | SpectraData2DWithIds; declare interface Spectrum1DInfo { nucleus: string; dimension: number; isComplex: boolean; originFrequency: number; baseFrequency: number; pulseSequence: string; experiment: string; isFt: boolean; } declare interface Spectrum2DInfo { nucleus: string[]; originFrequency: string; baseFrequency: string | number; pulseSequence: string; experiment: string; } export declare interface SpinSystem { /** * isolated clusters from a similarity/connectivity matrix */ clusters?: number[][]; /** * Matrix of coupling values between spins. */ couplingConstants: Matrix | number[][]; /** * Array of chemical shifts of the spin system */ chemicalShifts: number[]; /** * Array of degree of freedom of the spin, it is usually an array of 2. */ levels?: number[]; /** * Binary matrix based on the coupling constants. */ connectivity?: Matrix | number[][]; } /** * split a composed pattern like dt or ddt into an array of objects * @param multiplet - pattern or abbreviation. * @returns */ export declare function splitPatterns(multiplet: string): MatchingMultiplicity[]; export declare interface SplitSpinSystemOptions { /** * @default 400 */ frequency?: number; /** * @default 9 */ maxClusterSize?: number; } declare interface StateAtomType { current: number; total?: number; complete?: boolean; error?: StateAtomTypeError; } declare type StateAtomTypeError = Record; declare type SymmetrizeCosyLike = FilterFactory> & Pick; declare class T1Regression extends BaseRegression { fullMagnetization: number; relaxationT1: number; constructor(fullMagnetization: number, relaxationT1: number); _predict(x: number): number; } export declare type Targets = Record; declare interface Traf { kind: 'traf'; options: ShapeOption; } /** * convert from pattern name to only one letter abbreviation or any supported abbreviation to pattern name. * @param name - pattern name or abbreviation. * @returns */ export declare function translateMultiplet(name: string): string; declare type Trim = FilterFactory & Pick; export declare interface TrimApplyOptions { /** * Percentage (0-100) of points to trim from the low side. If undefined, no percentage-based trimming is applied to the low. * @default undefined */ lowPercentage?: number; /** * Percentage (0-100) of points to trim from the high side. If undefined, no percentage-based trimming is applied to the high. * @default undefined */ highPercentage?: number; /** * Value of the leftmost point to keep. If set, all points to the low of this value are trimmed. * @default undefined */ lowValue?: number; /** * Value of the rightmost point to keep. If set, all points to the high of this value are trimmed. * @default undefined */ highValue?: number; /** * Number of points to remove from the low side. If set, trims this many points from the low. * @default 0 */ lowNbPoints?: number; /** * Number of points to remove from the high side. If set, trims this many points from the high. * @default 0 */ highNbPoints?: number; } /** * Options for specifying the region and resolution of the 2D spectrum */ declare interface TwoDOptions { /** * Defines the chemical shift range for proton and carbon axes */ fromTo: { proton: FromTo; carbon: FromTo; }; /** * Number of points in each dimension (x and y) */ nbPoints: PointXY; /** * Optional peak width in each dimension (x and y), in Hz */ width?: { x: number; y: number; }; } export declare function updateIntegralsRelativeValues(spectrum: Entry1D, forceCalculateIntegral?: boolean): void; export declare function updatePeaksRelativeValues(spectrum: Entry1D, forceCalculateIntegral?: boolean): void; export declare function updateRanges(spectrum: Entry1D): void; export declare function updateRangesRelativeValues(spectrum: Entry1D, forceCalculateIntegral?: boolean): void; export declare type WindowFunctions = Exponential | SineBell | SineSquare | Traf | Gaussian; /** * Predict back points by singular value decomposition. * to append the predicted points is it needed to append nbPoints zeros at the beginning of input data. * @param data * @param options */ export declare function xBackwardLinearPrediction(data: DoubleArray, options: BackwardLPOptions): { output: Float64Array; predicted: Float64Array; }; /** * Predict back points by singular value decomposition. * to append the predicted points is it needed to append nbPoints zeros at the beginning of input data. * @param data * @param options */ export declare function xForwardLinearPrediction(data: DoubleArray, options: ForwardLPOptions): { output: Float64Array; predicted: Float64Array; }; /** * Determination of J couplings by recursive deconvolution in the frequency domain, * it uses the method published by Damien Jeannerat and Geoffrey Bodenhausen @link{https://doi.org/10.1006/jmre.1999.1845} * @param data - Imaginary data is optional for auto phase correction of the region before the analysis. * @param options */ export declare function xreimMultipletAnalysis(data: DataXReOptionalIm, options: XreimMultipletAnalysisOptionsNormal): AnalyseMultipletResult; export declare function xreimMultipletAnalysis(data: DataXReOptionalIm, options: XreimMultipletAnalysisOptionsWithDebug): AnalyseMultipletResultWithDebug; export declare interface XreimMultipletAnalysisOptionsBase { autoPhase?: boolean; } export declare interface XreimMultipletAnalysisOptionsNormal extends XreimMultipletAnalysisOptionsBase { analyzer: AnalyseMultipletOptionsNormal; } export declare interface XreimMultipletAnalysisOptionsWithDebug extends XreimMultipletAnalysisOptionsBase { analyzer: AnalyseMultipletOptionsWithDebug; } export declare type XreimMultipletAnalysisResult = AnalyseMultipletResult; export declare type XreimMultipletAnalysisResultWithDebug = AnalyseMultipletResultWithDebug; /** * Trims the input arrays in the object by removing points from the low and high according to the provided options. * * @param input - The input data containing x (required), re (required), and optionally im arrays. All arrays must be of the same length. * @param options - The trimming options specifying how many points or what range to trim. * @throws Error if the x array is not sorted in ascending order. * @returns A new DataXReOptionalIm object with trimmed x, re, and (if present) im arrays. */ export declare function xreimTrim(input: DataXReOptionalIm, options: TrimApplyOptions): DataXReOptionalIm; export declare function xyAutoPeaksPicking(data: DataXY, options: OptionsXYAutoPeaksPicking): NMRPeak1DWithShapeID[]; /** * error for default windowSize computation * out in data, all data relative to the computation */ export declare class XYAutoPeaksPickingWindowSizeError extends Error { data: Record; constructor(data: Record); } /** * Detect peaks, optimize parameters and compile multiplicity if required. * @param data * @param options */ export declare function xyAutoRangesPicking(data: DataXY, options: OptionsXYAutoRangesPicking): NMRRange[]; export declare function xyBaselineCalculation({ x, y }: { x: Float64Array; y: Float64Array; }, options: BaselineCorrectionOptions): Float64Array | number[]; /** * Estimate the diffusion coefficient of an independent component by fitting of imput data with the Stejskal–Tanner equation. * @param data * @param options */ export declare function xyCalculateDiffussionCoefficient( /** * x is the amplitude of the pulse field gradient * y is the exponential decay signal. */ data: DataXY, options: CalculateDiffussionCoefficientOptions): { regression: DiffusionRegression; coefficient: number; signalAbsenseDiffussion: number; }; export declare function xyCalculateT1(data: DataXY, options?: CalculateT1Options): XYCalculateT1Return; declare interface XYCalculateT1Return { relaxationT1: number; fullMagnetization: number; regression: T1Regression; } export declare function xyGetPivot(data: DataXY, options?: { thresholdFactor?: number; frequency?: number; }): PointXY; export declare function xyKineticFirstOrder(data: DataXY): { regression: ExponentialRegression; rateConstant: number; initialConcentration: number; }; declare interface XYObjectSidePointOptions { minX: number; maxX: number; thresholdFactor?: number; } export declare function xyPeaksOptimization(data: DataXY, peaks: T[], options: XYPeaksOptimizationOptions): (T extends { id: string; } ? GSDPeakOptimizedID : GSDPeakOptimized)[]; export declare function xyPeaksOptimizationByStages(data: DataXY, peaks: PeakXYWidth[], options: XYPeaksOptimizationOptionsByStages): GSDNMRPeakOptimizedID[]; export declare interface XYPeaksOptimizationOptions extends OptimizePeaksOptions { /** * frequency to convert width and fwhm to ppm. */ frequency: number; } export declare interface XYPeaksOptimizationOptionsByStages extends OptimizePeaksOptions { /** * frequency to convert width and fwhm to ppm. */ frequency: number; /** * Custom stage configurations to override the default 4-stage optimization pipeline. * Each stage defines grouping, optimizer settings, and which peak parameters to optimize. */ stages?: OptimizePeaksOptions[]; } /** * Bidimensional automatic phase correction, based in the idea to see the spectrum as a bitmap, * where the number of white pixels will be bigger in a phased spectrum (whitening concept). Further information can be found in the * publication of Balacco and Cobas (DOI: {@link https://doi.org/10.1002/mrc.2394}). This method use a incremental search instead of simplex algorithm. * @param data * @param options */ export declare function xyzAutoPhaseCorrection(data: NmrData2DFt, options?: AutoPhaseCorrection2D): Required; export declare function xyzAutoSignalsPicking(spectraData: NmrData2DContent, options: XYZAutoSignalsPickingOptions): NMRSignal2DWithID[]; export declare interface XYZAutoSignalsPickingOptions { /** * max number of points in any dimension to pad the input data, this is needed to avoid lost peaks when the input matrix is too small. * @default 14 */ sizeToPad?: number; /** * If it's true, try to find the real maximum for each bidimensional peak. * @default true */ realTopDetection?: boolean; /** * positive value filter small peaks by intensity * @default 0.5 */ thresholdFactor?: number; /** * specify the nuclei of each dimension * @default ['1H','1H'] */ nuclei?: string[]; /** * specify the frequency for each dimension. */ observedFrequencies: number[] | Float64Array; /** * If it's true, it try to ajust the shift and add missing cross peaks, useful only for homonuclear data. * @default false */ enhanceSymmetry?: boolean; /** * If it's true, peaks with less than a specific percentage (maxPercentCutOff) of the maximum intensity will be removed. * @default true; */ clean?: boolean; /** * percentage of maximum intensity as cutoff for small peaks. * @default 0.03 */ maxPercentCutOff?: number; /** * Specify the minimum distance in Hz for each dimension to join peaks in a signal. * @default [24,24] */ tolerances?: number[]; /** * If it is true, the convolution will be forced by FFT * @default true */ convolutionByFFT?: boolean; /** * kernel options to calculate a laplacianOfGaussian kernel with a specify size. */ kernel?: GetKernelOptions; } export declare function xyzAutoZonesPicking(spectraData: NmrData2DContent, options: XYZAutoZonesPickingOptions): NMRZoneWithID[]; export declare interface XYZAutoZonesPickingOptions { /** * max number of points in any dimension to pad the input data, this is needed to avoid lost peaks when the input matrix is too small. * @default 14 */ sizeToPad?: number; /** * If it's true, try to find the real maximum for each bidimensional peak. * @default true */ realTopDetection?: boolean; /** * positive value filter small peaks by intensity * @default 0.5 */ thresholdFactor?: number; /** * specify the nuclei of each dimension * @default ['1H','1H'] */ nuclei?: string[]; /** * specify the frequency for each dimension. */ observedFrequencies: number[] | Float64Array; /** * If it's true, it try to ajust the shift and add missing cross peaks, useful only for homonuclear data. * @default false */ enhanceSymmetry?: boolean; /** * If it's true, peaks with less than a specific percentage (maxPercentCutOff) of the maximum intensity will be removed. * @default true; */ clean?: boolean; /** * percentage of maximum intensity as cutoff for small peaks. * @default 0.03 */ maxPercentCutOff?: number; /** * Specify the minimum distance in Hz for each dimension to join peaks in a signal. * @default [24,24] */ tolerances?: number[]; /** * If it is true, the convolution will be forced by FFT * @default true */ convolutionByFFT?: boolean; /** * kernel options to calculate a laplacianOfGaussian kernel with a specify size. */ kernel?: GetKernelOptions; } export declare function xyzPhaseCorrection(data: NmrData2DFt, options: PhaseCorrectionTwoDOptions): NmrData2DFt; /** * Integrates a zone in 2D spectra data assuming the delta X/Y is constant. * the integration and absolute values are the same. */ export declare function xyzZoneIntegration(spectraData: NmrData2DContent, zone: T): T & { integration: number; }; /** * Integrates zones over a 2D NMR spectrum grid. * * This function computes the absolute integrated area for each provided zone * by summing the matrix values inside the zone bounds and multiplying by * the area element (|deltaX * deltaY|). If `options.maxIntegrationValue` * is provided and is not 0, the function normalizes all zone integrations so * that the sum of `integration` values equals `maxIntegrationValue`. * * Assumptions: * - `spectraData.z` is a regular 2D matrix of numbers with dimensions * `[rows][columns]` corresponding to Y and X axis points respectively. * - X and Y axes are uniformly spaced between `minX..maxX` and `minY..maxY`. * * Behavior details: * - The zone coordinates are specified as `FromTo` ranges for `x` and `y`. * - Matrix indices are calculated by rounding the coordinate-to-index mapping * and clamped to the matrix bounds. * - `absolute` is the raw area (sum * |dx * dy|) and `integration` is * either equal to `absolute` or a normalized value depending on options. * * @param spectraData - 2D spectrum content. * @param zones - Array of zones to integrate. Each zone must expose `x` and `y` ranges. * @returns A new array where each zone is extended with numeric properties * `absolute` (raw area) and `integration` (possibly normalized). * * @example * const integrated = xyzZonesIntegration(spectra, zones, { maxIntegrationValue: 100 }); */ export declare function xyzZonesIntegration(spectraData: NmrData2DContent, zones: T[], options?: ZonesIntegrationOptions): Array; declare type ZeroFilling = FilterFactory & Pick; declare type ZeroFillingDimension1 = FilterFactory & Pick; declare type ZeroFillingDimension2 = FilterFactory & Pick; export declare interface Zone2DError { x: number; y: number; } declare type ZoneForMapping = Pick & { signals: SignalForMapping[]; }; export declare interface ZonesIntegrationOptions { /** * If provided and non-zero, the integrations * are scaled so that their max value would be qual this value. * Set to `0` to skip rescaling. * @default 100 */ maxIntegrationValue?: number; } export * from "gyromagnetic-ratio"; export { }