nmr-processing 19.5.1 → 20.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -81,7 +81,7 @@ import type { PhaseCorrection2DOptions } from '@zakodium/nmr-types';
81
81
  import type { PhaseCorrectionTwoDFilter } from '@zakodium/nmr-types';
82
82
  import type { PhaseCorrectionTwoDOptions } from '@zakodium/nmr-types';
83
83
  import { PointXY } from 'cheminfo-types';
84
- import type { Range } from '@zakodium/nmr-types';
84
+ import type { Range as Range_2 } from '@zakodium/nmr-types';
85
85
  import type { Ranges } from '@zakodium/nmr-types';
86
86
  import type { Shape1D } from 'ml-peak-shape-generator';
87
87
  import type { Shapes } from '@zakodium/nmr-types';
@@ -89,6 +89,7 @@ import type { Shift2DXFilterOptions } from '@zakodium/nmr-types';
89
89
  import type { Shift2DYFilterOptions } from '@zakodium/nmr-types';
90
90
  import type { ShiftXFilterOptions } from '@zakodium/nmr-types';
91
91
  import type { ShiftXOptions } from '@zakodium/nmr-types';
92
+ import { SignalKind } from '@zakodium/nmr-types';
92
93
  import type { SignalProcessingFilter } from '@zakodium/nmr-types';
93
94
  import type { SineBellOptions } from '@zakodium/nmr-types';
94
95
  import type { SymmetrizeCosyLikeOptions } from '@zakodium/nmr-types';
@@ -103,8 +104,6 @@ import type { ZeroFillingOptions } from '@zakodium/nmr-types';
103
104
  import type { Zone } from '@zakodium/nmr-types';
104
105
  import type { Zones } from '@zakodium/nmr-types';
105
106
 
106
- declare function addDefaultSignal(range: Range): void;
107
-
108
107
  declare type Apodization1D = FilterFactory<Entry1D, Apodization1DOptions> & Pick<Apodization1DFilterOptions, 'name'>;
109
108
 
110
109
  declare type ApodizationDimension1 = FilterFactory<Entry2D, Apodization2D1Options> & Pick<ApodizationDimension1Options, 'name'>;
@@ -326,10 +325,14 @@ declare interface CalculateT1OptionsOptimization {
326
325
  options?: Partial<LevenbergMarquardtOptionsDefault> & LevenbergMarquardtOptionsOverride;
327
326
  }
328
327
 
328
+ /**
329
+ * Common laboratory solvents database (carbon).
330
+ * @see https://doi.org/10.1021/jo971176v
331
+ */
329
332
  export declare const carbonImpurities: DatabaseNMREntry[];
330
333
 
331
334
  /**
332
- * check whether integral based on its kind can be included in another operation or not
335
+ * Check whether integral based on its kind can be included in another operation or not.
333
336
  * @param integral - integral
334
337
  * @returns
335
338
  */
@@ -337,9 +340,7 @@ export declare function checkIntegralKind(integral: Integral): boolean;
337
340
 
338
341
  export declare function checkMultiplicity(multiplicity: string, rejected?: OneLetterMultiplet[]): boolean;
339
342
 
340
- declare function checkRangeKind(range: Range): boolean;
341
-
342
- declare function checkSignalKinds(range: Range, kinds: string[]): boolean;
343
+ declare function checkSignalKinds(range: Range_2, kinds: ReadonlySet<SignalKind>): boolean;
343
344
 
344
345
  declare interface CompilePatternOptions {
345
346
  observedFrequencies?: number[] | Float64Array;
@@ -488,11 +489,6 @@ export declare interface DataResurrect {
488
489
 
489
490
  export declare type DataXReOptionalIm = Omit<DataXReIm, 'im'> & Partial<Pick<DataXReIm, 'im'>>;
490
491
 
491
- export declare const DatumKind: {
492
- signal: string;
493
- mixed: string;
494
- };
495
-
496
492
  export declare const default1DApodization: Shapes;
497
493
 
498
494
  declare const defaultDirectOptimizationOptions: {
@@ -557,6 +553,11 @@ declare interface EnableFilterOptions {
557
553
  logger?: Logger;
558
554
  }
559
555
 
556
+ /**
557
+ * Takes a potentially invalid signal kind and makes sure a valid kind is returned.
558
+ */
559
+ export declare function ensureValidSignalKind(kind: string | undefined): SignalKind;
560
+
560
561
  declare interface Entry1D {
561
562
  id?: string;
562
563
  data: NmrData1D;
@@ -941,8 +942,6 @@ export declare function getDatabase(url?: string, options?: {
941
942
  format?: 'tsv' | 'json';
942
943
  }): Promise<DatabaseNMREntry[]>;
943
944
 
944
- declare function getDiaIDs(range: Range): string[];
945
-
946
945
  /**
947
946
  * @deprecated use getRelativeFrequency instead
948
947
  */
@@ -956,8 +955,6 @@ declare interface GetKernelOptions {
956
955
 
957
956
  declare function getLineShapes(l: LineShapeData[]): LineShapeResult[];
958
957
 
959
- declare function getNbAtoms(range: Range, signalIndex?: number): number;
960
-
961
958
  export declare function getPeakDelta(peak: Peak1D | NMRPeak1D, shiftTarget: ShiftTarget, shift: number): {
962
959
  originalX: number;
963
960
  x: number;
@@ -1038,22 +1035,11 @@ declare interface HOSEPrediction {
1038
1035
 
1039
1036
  declare type ID = string;
1040
1037
 
1041
- export declare const impurities: SolventImpurities;
1042
-
1043
- export declare type Impurity = Record<string, ImpuritySignal[]>;
1044
-
1045
- export declare interface ImpuritySignal {
1046
- proton: string;
1047
- coupling: number;
1048
- multiplicity: string;
1049
- shift: number;
1050
- }
1051
-
1052
1038
  export declare function isEmptyMolecule(molecule: Molecule): boolean;
1053
1039
 
1054
1040
  export declare function isMolfileNotEmpty(molFile?: string): molFile is string;
1055
1041
 
1056
- export declare function isRangeExists(range: Pick<Range, 'from' | 'to'>, spectrum: Entry1D, error: number): boolean;
1042
+ export declare function isRangeExists(range: Pick<Range_2, 'from' | 'to'>, spectrum: Entry1D, error: number): boolean;
1057
1043
 
1058
1044
  export declare function isZoneExists(zone: Pick<Zone, 'x' | 'y'>, spectrum: Entry2D, error: Zone2DError): boolean;
1059
1045
 
@@ -1113,16 +1099,7 @@ declare type MakeMandatory<T, K extends keyof T> = T & {
1113
1099
  [P in K]-?: T[P];
1114
1100
  };
1115
1101
 
1116
- export declare function mapIntegrals(integrals: Integral[], spectrum: Entry1D, shiftTarget?: ShiftTarget): {
1117
- absolute: number;
1118
- originalFrom: number;
1119
- originalTo: number;
1120
- from: number;
1121
- to: number;
1122
- id: string;
1123
- integral: number;
1124
- kind: string;
1125
- }[];
1102
+ export declare function mapIntegrals(integrals: Integral[], spectrum: Entry1D, shiftTarget?: ShiftTarget): Integral[];
1126
1103
 
1127
1104
  declare interface MapOptions {
1128
1105
  checkIsExisting?: boolean;
@@ -1131,7 +1108,7 @@ declare interface MapOptions {
1131
1108
 
1132
1109
  export declare function mapPeaks(peaks: Peak1D[], spectrum: Entry1D, options?: MapOptions): Peak1D[];
1133
1110
 
1134
- export declare function mapRanges(ranges: Range[] | NMRRange[], spectrum: Entry1D, options?: MapOptions): Range[];
1111
+ export declare function mapRanges(ranges: Range_2[] | NMRRange[], spectrum: Entry1D, options?: MapOptions): Range_2[];
1135
1112
 
1136
1113
  export declare function mapZones(zones: Zone[], datum: Entry2D, options?: MapOptions): {
1137
1114
  signals: {
@@ -1149,7 +1126,7 @@ export declare function mapZones(zones: Zone[], datum: Entry2D, options?: MapOpt
1149
1126
  };
1150
1127
  }[] | undefined;
1151
1128
  id: string;
1152
- kind: string;
1129
+ kind: SignalKind;
1153
1130
  x: {
1154
1131
  originalDelta: number;
1155
1132
  delta: number;
@@ -1167,7 +1144,7 @@ export declare function mapZones(zones: Zone[], datum: Entry2D, options?: MapOpt
1167
1144
  pathLength?: number | FromTo;
1168
1145
  };
1169
1146
  }[];
1170
- kind: string;
1147
+ kind: SignalKind;
1171
1148
  x: {
1172
1149
  from: number;
1173
1150
  to: number;
@@ -1280,7 +1257,7 @@ export declare interface NMRSignal2D<T extends Peak2D = Peak2D> {
1280
1257
  };
1281
1258
  id?: string;
1282
1259
  peaks?: T[];
1283
- kind?: string;
1260
+ kind?: SignalKind;
1284
1261
  }
1285
1262
 
1286
1263
  export declare type NMRSignal2DWithID<T extends Peak2D = Peak2D> = MakeMandatory<NMRSignal2D<T>, 'id'>;
@@ -1380,28 +1357,6 @@ declare interface OptimizeSignalsOptionsLevenbergMarquardtOptimization {
1380
1357
 
1381
1358
  export declare type OptimizeSignalsOptionsOptimization = OptimizeSignalsOptionsDirectOptimization | OptimizeSignalsOptionsLevenbergMarquardtOptimization;
1382
1359
 
1383
- export declare interface OptionsPeaksFilterImpurities {
1384
- /**
1385
- * Frequency of the spectrometer to convert peak width from Hz to ppm
1386
- * @default 400
1387
- */
1388
- frequency?: number;
1389
- /**
1390
- * Solvent name.
1391
- */
1392
- solvent?: string;
1393
- /**
1394
- * tolerance in ppm to assign a impurity.
1395
- * @default 0.025
1396
- */
1397
- error?: number;
1398
- /**
1399
- * If it is true, it remove the peaks otherwise it assigns the kind of the signal with the name of the impurity
1400
- * @default false
1401
- */
1402
- remove?: boolean;
1403
- }
1404
-
1405
1360
  declare interface OptionsPeaksToRanges {
1406
1361
  /**
1407
1362
  * Number of hydrogens or some number to normalize the integration data. If it's zero return the absolute integration value
@@ -1531,7 +1486,7 @@ export declare interface OptionsXYAutoPeaksPicking extends Partial<GetPeakListOp
1531
1486
 
1532
1487
  declare interface OptionsXYAutoRangesPicking {
1533
1488
  peakPicking: OptionsXYAutoPeaksPicking;
1534
- impurities?: OptionsPeaksFilterImpurities;
1489
+ impurities?: PeaksMarkProtonLabSolventsOptions;
1535
1490
  ranges?: OptionsPeaksToRanges;
1536
1491
  logger?: Logger;
1537
1492
  }
@@ -1579,14 +1534,22 @@ export declare interface Peak2DSeries {
1579
1534
  z: number[];
1580
1535
  }
1581
1536
 
1582
- /**
1583
- * Filters impurities from a list of NMR peaks based on the specified options.
1584
- * @template T - The type of NMR peaks.
1585
- * @param peaks - The list of NMR peaks to be filtered.
1586
- * @param [options={}] - The options for filtering impurities.
1587
- * @returns The filtered list of NMR peaks.
1588
- */
1589
- export declare function peaksFilterImpurities<T extends NMRPeak1D>(peaks: T[], options?: OptionsPeaksFilterImpurities): T[];
1537
+ declare interface PeaksMarkProtonLabSolventsOptions {
1538
+ /**
1539
+ * Frequency of the spectrometer to convert peak width from Hz to ppm
1540
+ * @default 400
1541
+ */
1542
+ frequency?: number;
1543
+ /**
1544
+ * Solvent name.
1545
+ */
1546
+ solvent?: string;
1547
+ /**
1548
+ * tolerance in ppm to assign an impurity.
1549
+ * @default 0.025
1550
+ */
1551
+ error?: number;
1552
+ }
1590
1553
 
1591
1554
  /**
1592
1555
  * Generates an NMR Free Induction Decay (FID) signal from a list of peaks.
@@ -1718,10 +1681,14 @@ export declare interface PredictCarbonOptions {
1718
1681
  declare interface PredictCOSYOptions {
1719
1682
  /**
1720
1683
  * maximum number of bonds to take into account.
1684
+ * If either maxLength or minLength is not provided, the function will calculate
1685
+ * the correlation paths based on the coupling constants as defined by the minCoupling option.
1721
1686
  */
1722
1687
  maxLength?: number;
1723
1688
  /**
1724
1689
  * minimum number of bonds to take into account
1690
+ * If either maxLength or minLength is not provided, the function will calculate
1691
+ * the correlation paths based on the coupling constants as defined by the minCoupling option.
1725
1692
  */
1726
1693
  minLength?: number;
1727
1694
  /**
@@ -1948,6 +1915,10 @@ export declare interface PredictSpectraResult {
1948
1915
  }>;
1949
1916
  }
1950
1917
 
1918
+ /**
1919
+ * Common laboratory solvents database (proton).
1920
+ * @see https://doi.org/10.1021/jo971176v
1921
+ */
1951
1922
  export declare const protonImpurities: DatabaseNMREntry[];
1952
1923
 
1953
1924
  export declare function rangeFromSignal(signal: NMRSignal1D, options?: RangeFromSignalOptions): {
@@ -2094,13 +2065,6 @@ export declare interface RangeToXYOptions {
2094
2065
 
2095
2066
  export declare namespace RangeUtilities {
2096
2067
  export {
2097
- getDiaIDs,
2098
- getNbAtoms,
2099
- setNbAtoms,
2100
- resetDiaIDs,
2101
- unlink,
2102
- addDefaultSignal,
2103
- checkRangeKind,
2104
2068
  checkSignalKinds
2105
2069
  }
2106
2070
  }
@@ -2120,8 +2084,6 @@ export declare function reimComplexBackwardLinearPrediction(data: DataReIm, opti
2120
2084
  im: Float64Array<ArrayBuffer>;
2121
2085
  };
2122
2086
 
2123
- declare function resetDiaIDs(range: Range): void;
2124
-
2125
2087
  declare interface RestrictionByCS {
2126
2088
  chemicalShiftRestriction: boolean;
2127
2089
  tolerance: Record<string, number>;
@@ -2140,8 +2102,6 @@ export declare interface ResurrectOptions {
2140
2102
  logger?: Logger;
2141
2103
  }
2142
2104
 
2143
- declare function setNbAtoms(range: Range, signalIndex?: number): void;
2144
-
2145
2105
  declare type Shape1DWithFWHM = Omit<Shape1D, 'fwhm'> & {
2146
2106
  fwhm: number;
2147
2107
  };
@@ -2245,12 +2205,9 @@ export declare interface SignalJoinCouplingsOptions {
2245
2205
  ignoreDiaIDs?: boolean;
2246
2206
  }
2247
2207
 
2248
- export declare const SignalKinds: Array<{
2249
- label: string;
2250
- value: string;
2251
- }>;
2208
+ export declare const signalKindLabelMapping: Readonly<Record<SignalKind, string>>;
2252
2209
 
2253
- export declare const SignalKindsToInclude: string[];
2210
+ export declare const signalKindsToInclude: ReadonlySet<SignalKind>;
2254
2211
 
2255
2212
  /**
2256
2213
  * Return
@@ -2470,8 +2427,6 @@ declare interface SineSquare<ShapeOption = SineBellOptions> {
2470
2427
  options: ShapeOption;
2471
2428
  }
2472
2429
 
2473
- export declare type SolventImpurities = Record<string, Impurity>;
2474
-
2475
2430
  export declare function solventSuppression<T extends NMRPeak1D>(peakList: T[], solvent: NMRSignal1D[], options?: {
2476
2431
  markSolventPeaks?: boolean;
2477
2432
  solventZoneExtension?: number;
@@ -2612,301 +2567,286 @@ declare interface TwoDOptions {
2612
2567
  };
2613
2568
  }
2614
2569
 
2615
- declare function unlink(range: Range, options?: UnlinkOptions): Range;
2570
+ export declare function updateIntegralsRelativeValues(spectrum: Entry1D, forceCalculateIntegral?: boolean): void;
2571
+
2572
+ export declare function updateRanges(spectrum: Entry1D): void;
2573
+
2574
+ export declare function updateRangesRelativeValues(spectrum: Entry1D, forceCalculateIntegral?: boolean): void;
2575
+
2576
+ export declare type WindowFunctions = Exponential | SineBell | SineSquare | Traf | Gaussian;
2616
2577
 
2617
2578
  /**
2618
- *
2619
- * @param {object} range
2620
- * @param {String('both' | 'range' | 'signal')} unlinkType
2621
- * @param {object} options
2622
- * @param {number} [options.signalIndex]
2623
- * @returns {object}
2624
- */
2625
- declare interface UnlinkOptions {
2626
- unlinkType?: 'both' | 'range' | 'signal';
2627
- signalIndex?: number;
2628
- }
2629
-
2630
- export declare function updateIntegralsRelativeValues(spectrum: Entry1D, forceCalculateIntegral?: boolean): void;
2631
-
2632
- export declare function updateRanges(spectrum: Entry1D): void;
2633
-
2634
- export declare function updateRangesRelativeValues(spectrum: Entry1D, forceCalculateIntegral?: boolean): void;
2635
-
2636
- export declare type WindowFunctions = Exponential | SineBell | SineSquare | Traf | Gaussian;
2637
-
2638
- /**
2639
- * Predict back points by singular value decomposition.
2640
- * to append the predicted points is it needed to append nbPoints zeros at the beginning of input data.
2641
- * @param data
2642
- * @param options
2643
- */
2644
- export declare function xBackwardLinearPrediction(data: DoubleArray, options: BackwardLPOptions): {
2645
- output: Float64Array<ArrayBufferLike>;
2646
- predicted: Float64Array<ArrayBuffer>;
2647
- };
2648
-
2649
- /**
2650
- * Predict back points by singular value decomposition.
2651
- * to append the predicted points is it needed to append nbPoints zeros at the beginning of input data.
2652
- * @param data
2653
- * @param options
2654
- */
2655
- export declare function xForwardLinearPrediction(data: DoubleArray, options: ForwardLPOptions): {
2656
- output: Float64Array<ArrayBufferLike>;
2657
- predicted: Float64Array<ArrayBuffer>;
2658
- };
2659
-
2660
- export declare interface XreimMultipletAnalysis {
2661
- analyzer?: AnalizeMultipletOptions;
2662
- autoPhase?: boolean;
2663
- }
2664
-
2665
- /**
2666
- * Determination of J couplings by recursive deconvolution in the frequency domain,
2667
- * it use the method published by Damien Jeannerat and Geoffrey Bodenhausen @link{https://doi.org/10.1006/jmre.1999.1845}
2668
- * @param data
2669
- * @param options
2670
- */
2671
- export declare function xreimMultipletAnalysis(
2672
- /**
2673
- * Imaginary data is optional for auto phase correction of the region before the analysis.
2674
- */
2675
- data: DataXReOptionalIm, options?: XreimMultipletAnalysis): any;
2676
-
2677
- export declare function xyAutoPeaksPicking(data: DataXY<Float64Array>, options: OptionsXYAutoPeaksPicking): NMRPeak1DWithShapeID[];
2678
-
2679
- /**
2680
- * error for default windowSize computation
2681
- * out in data, all data relative to the computation
2682
- */
2683
- export declare class XYAutoPeaksPickingWindowSizeError extends Error {
2684
- data: Record<string, unknown>;
2685
- constructor(data: Record<string, unknown>);
2686
- }
2687
-
2688
- /**
2689
- * Detect peaks, optimize parameters and compile multiplicity if required.
2690
- * @param data
2691
- * @param options
2692
- */
2693
- export declare function xyAutoRangesPicking(data: DataXY<Float64Array>, options: OptionsXYAutoRangesPicking): NMRRange[];
2694
-
2695
- /**
2696
- * Estimate the diffusion coefficient of an independent component by fitting of imput data with the Stejskal–Tanner equation.
2697
- * @param data
2698
- * @param options
2699
- */
2700
- export declare function xyCalculateDiffussionCoefficient(
2701
- /**
2702
- * x is the amplitude of the pulse field gradient
2703
- * y is the exponential decay signal.
2704
- */
2705
- data: DataXY, options: CalculateDiffussionCoefficientOptions): {
2706
- regression: DiffusionRegression;
2707
- coefficient: number;
2708
- signalAbsenseDiffussion: number;
2709
- };
2710
-
2711
- export declare function xyCalculateT1(data: DataXY, options?: CalculateT1Options): XYCalculateT1Return;
2712
-
2713
- declare interface XYCalculateT1Return {
2714
- relaxationT1: number;
2715
- fullMagnetization: number;
2716
- regression: T1Regression;
2717
- }
2718
-
2719
- export declare function xyGetPivot(data: DataXY<Float64Array>, options?: {
2720
- thresholdFactor?: number;
2721
- frequency?: number;
2722
- }): PointXY;
2723
-
2724
- export declare function xyKineticFirstOrder(data: DataXY): {
2725
- regression: ExponentialRegression;
2726
- rateConstant: number;
2727
- initialConcentration: number;
2728
- };
2729
-
2730
- declare interface XYObjectSidePointOptions {
2731
- minX: number;
2732
- maxX: number;
2733
- thresholdFactor?: number;
2734
- }
2735
-
2736
- export declare function xyPeaksOptimization<T extends PeakXYWidth>(data: DataXY, peaks: T[], options: XYPeaksOptimizationOptions): (T extends {
2737
- id: string;
2738
- } ? GSDPeakOptimizedID : GSDPeakOptimized)[];
2739
-
2740
- export declare interface XYPeaksOptimizationOptions extends OptimizePeaksOptions {
2741
- /**
2742
- * frequency to convert width and fwhm to ppm.
2743
- */
2744
- frequency: number;
2745
- }
2746
-
2747
- /**
2748
- * Bidimensional automatic phase correction, based in the idea to see the spectrum as a bitmap,
2749
- * where the number of white pixels will be bigger in a phased spectrum (whitening concept). Further information can be found in the
2750
- * publication of Balacco and Cobas (DOI: {@link https://doi.org/10.1002/mrc.2394}). This method use a incremental search instead of simplex algorithm.
2751
- * @param data
2752
- * @param options
2753
- */
2754
- export declare function xyzAutoPhaseCorrection(data: NmrData2DFt, options?: AutoPhaseCorrection2D): Required<PhaseCorrectionTwoDOptions>;
2755
-
2756
- export declare function xyzAutoSignalsPicking(spectraData: NmrData2DContent, options: XYZAutoSignalsPickingOptions): NMRSignal2DWithID<Peak2D & {
2757
- id: string;
2758
- }>[];
2759
-
2760
- export declare interface XYZAutoSignalsPickingOptions {
2761
- /**
2762
- * 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.
2763
- * @default 14
2764
- */
2765
- sizeToPad?: number;
2766
- /**
2767
- * If it's true, try to find the real maximum for each bidimensional peak.
2768
- * @default true
2769
- */
2770
- realTopDetection?: boolean;
2771
- /**
2772
- * positive value filter small peaks by intensity
2773
- * @default 0.5
2774
- */
2775
- thresholdFactor?: number;
2776
- /**
2777
- * specify the nuclei of each dimension
2778
- * @default ['1H','1H']
2779
- */
2780
- nuclei?: string[];
2781
- /**
2782
- * specify the frequency for each dimension.
2783
- */
2784
- observedFrequencies: number[] | Float64Array;
2785
- /**
2786
- * If it's true, it try to ajust the shift and add missing cross peaks, useful only for homonuclear data.
2787
- * @default false
2788
- */
2789
- enhanceSymmetry?: boolean;
2790
- /**
2791
- * If it's true, peaks with less than a specific percentage (maxPercentCutOff) of the maximum intensity will be removed.
2792
- * @default true;
2793
- */
2794
- clean?: boolean;
2795
- /**
2796
- * percentage of maximum intensity as cutoff for small peaks.
2797
- * @default 0.03
2798
- */
2799
- maxPercentCutOff?: number;
2800
- /**
2801
- * Specify the minimum distance in Hz for each dimension to join peaks in a signal.
2802
- * @default [24,24]
2803
- */
2804
- tolerances?: number[];
2805
- /**
2806
- * If it is true, the convolution will be forced by FFT
2807
- * @default true
2808
- */
2809
- convolutionByFFT?: boolean;
2810
- /**
2811
- * kernel options to calculate a laplacianOfGaussian kernel with a specify size.
2812
- */
2813
- kernel?: GetKernelOptions;
2814
- }
2815
-
2816
- export declare function xyzAutoZonesPicking(spectraData: NmrData2DContent, options: XYZAutoZonesPickingOptions): NMRZoneWithID[];
2817
-
2818
- export declare interface XYZAutoZonesPickingOptions {
2819
- /**
2820
- * 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.
2821
- * @default 14
2822
- */
2823
- sizeToPad?: number;
2824
- /**
2825
- * If it's true, try to find the real maximum for each bidimensional peak.
2826
- * @default true
2827
- */
2828
- realTopDetection?: boolean;
2829
- /**
2830
- * positive value filter small peaks by intensity
2831
- * @default 0.5
2832
- */
2833
- thresholdFactor?: number;
2834
- /**
2835
- * specify the nuclei of each dimension
2836
- * @default ['1H','1H']
2837
- */
2838
- nuclei?: string[];
2839
- /**
2840
- * specify the frequency for each dimension.
2841
- */
2842
- observedFrequencies: number[] | Float64Array;
2843
- /**
2844
- * If it's true, it try to ajust the shift and add missing cross peaks, useful only for homonuclear data.
2845
- * @default false
2846
- */
2847
- enhanceSymmetry?: boolean;
2848
- /**
2849
- * If it's true, peaks with less than a specific percentage (maxPercentCutOff) of the maximum intensity will be removed.
2850
- * @default true;
2851
- */
2852
- clean?: boolean;
2853
- /**
2854
- * percentage of maximum intensity as cutoff for small peaks.
2855
- * @default 0.03
2856
- */
2857
- maxPercentCutOff?: number;
2858
- /**
2859
- * Specify the minimum distance in Hz for each dimension to join peaks in a signal.
2860
- * @default [24,24]
2861
- */
2862
- tolerances?: number[];
2863
- /**
2864
- * If it is true, the convolution will be forced by FFT
2865
- * @default true
2866
- */
2867
- convolutionByFFT?: boolean;
2868
- /**
2869
- * kernel options to calculate a laplacianOfGaussian kernel with a specify size.
2870
- */
2871
- kernel?: GetKernelOptions;
2872
- }
2873
-
2874
- export declare function xyzJResAnalyzer(signals: NMRSignal2D[], options?: XYZJResAnalyzerOptions): NMRZoneWithID[] | (NMRSignal2D<Peak2D> & {
2875
- id: string;
2876
- })[];
2877
-
2878
- declare interface XYZJResAnalyzerOptions extends CompilePatternOptions {
2879
- /**
2880
- * maximum difference in Hz to discard if the signal is symmetric.
2881
- * @default 0.08
2882
- */
2883
- referenceMaxShiftError?: number;
2884
- /**
2885
- * reference value in Hz
2886
- * @default 0
2887
- */
2888
- reference?: number;
2889
- /**
2890
- * if it is true returns zones instead of signals 2D
2891
- * @default false
2892
- */
2893
- getZones?: boolean;
2894
- }
2895
-
2896
- export declare function xyzPhaseCorrection(data: NmrData2DFt, options: PhaseCorrectionTwoDOptions): NmrData2DFt;
2897
-
2898
- declare type ZeroFilling = FilterFactory<Entry1D, ZeroFillingOptions> & Pick<ZeroFillingFilterOptions, 'name'>;
2899
-
2900
- declare type ZeroFillingDimension1 = FilterFactory<Entry2D, ZeroFillingOptions> & Pick<ZeroFillingDimension1Options, 'name'>;
2901
-
2902
- declare type ZeroFillingDimension2 = FilterFactory<Entry2D, ZeroFillingOptions> & Pick<ZeroFillingDimension2Options, 'name'>;
2903
-
2904
- export declare interface Zone2DError {
2905
- x: number;
2906
- y: number;
2907
- }
2908
-
2909
-
2910
- export * from "gyromagnetic-ratio";
2911
-
2912
- export { }
2579
+ * Predict back points by singular value decomposition.
2580
+ * to append the predicted points is it needed to append nbPoints zeros at the beginning of input data.
2581
+ * @param data
2582
+ * @param options
2583
+ */
2584
+ export declare function xBackwardLinearPrediction(data: DoubleArray, options: BackwardLPOptions): {
2585
+ output: Float64Array<ArrayBufferLike>;
2586
+ predicted: Float64Array<ArrayBuffer>;
2587
+ };
2588
+
2589
+ /**
2590
+ * Predict back points by singular value decomposition.
2591
+ * to append the predicted points is it needed to append nbPoints zeros at the beginning of input data.
2592
+ * @param data
2593
+ * @param options
2594
+ */
2595
+ export declare function xForwardLinearPrediction(data: DoubleArray, options: ForwardLPOptions): {
2596
+ output: Float64Array<ArrayBufferLike>;
2597
+ predicted: Float64Array<ArrayBuffer>;
2598
+ };
2599
+
2600
+ export declare interface XreimMultipletAnalysis {
2601
+ analyzer?: AnalizeMultipletOptions;
2602
+ autoPhase?: boolean;
2603
+ }
2604
+
2605
+ /**
2606
+ * Determination of J couplings by recursive deconvolution in the frequency domain,
2607
+ * it use the method published by Damien Jeannerat and Geoffrey Bodenhausen @link{https://doi.org/10.1006/jmre.1999.1845}
2608
+ * @param data
2609
+ * @param options
2610
+ */
2611
+ export declare function xreimMultipletAnalysis(
2612
+ /**
2613
+ * Imaginary data is optional for auto phase correction of the region before the analysis.
2614
+ */
2615
+ data: DataXReOptionalIm, options?: XreimMultipletAnalysis): any;
2616
+
2617
+ export declare function xyAutoPeaksPicking(data: DataXY<Float64Array>, options: OptionsXYAutoPeaksPicking): NMRPeak1DWithShapeID[];
2618
+
2619
+ /**
2620
+ * error for default windowSize computation
2621
+ * out in data, all data relative to the computation
2622
+ */
2623
+ export declare class XYAutoPeaksPickingWindowSizeError extends Error {
2624
+ data: Record<string, unknown>;
2625
+ constructor(data: Record<string, unknown>);
2626
+ }
2627
+
2628
+ /**
2629
+ * Detect peaks, optimize parameters and compile multiplicity if required.
2630
+ * @param data
2631
+ * @param options
2632
+ */
2633
+ export declare function xyAutoRangesPicking(data: DataXY<Float64Array>, options: OptionsXYAutoRangesPicking): NMRRange[];
2634
+
2635
+ /**
2636
+ * Estimate the diffusion coefficient of an independent component by fitting of imput data with the Stejskal–Tanner equation.
2637
+ * @param data
2638
+ * @param options
2639
+ */
2640
+ export declare function xyCalculateDiffussionCoefficient(
2641
+ /**
2642
+ * x is the amplitude of the pulse field gradient
2643
+ * y is the exponential decay signal.
2644
+ */
2645
+ data: DataXY, options: CalculateDiffussionCoefficientOptions): {
2646
+ regression: DiffusionRegression;
2647
+ coefficient: number;
2648
+ signalAbsenseDiffussion: number;
2649
+ };
2650
+
2651
+ export declare function xyCalculateT1(data: DataXY, options?: CalculateT1Options): XYCalculateT1Return;
2652
+
2653
+ declare interface XYCalculateT1Return {
2654
+ relaxationT1: number;
2655
+ fullMagnetization: number;
2656
+ regression: T1Regression;
2657
+ }
2658
+
2659
+ export declare function xyGetPivot(data: DataXY<Float64Array>, options?: {
2660
+ thresholdFactor?: number;
2661
+ frequency?: number;
2662
+ }): PointXY;
2663
+
2664
+ export declare function xyKineticFirstOrder(data: DataXY): {
2665
+ regression: ExponentialRegression;
2666
+ rateConstant: number;
2667
+ initialConcentration: number;
2668
+ };
2669
+
2670
+ declare interface XYObjectSidePointOptions {
2671
+ minX: number;
2672
+ maxX: number;
2673
+ thresholdFactor?: number;
2674
+ }
2675
+
2676
+ export declare function xyPeaksOptimization<T extends PeakXYWidth>(data: DataXY, peaks: T[], options: XYPeaksOptimizationOptions): (T extends {
2677
+ id: string;
2678
+ } ? GSDPeakOptimizedID : GSDPeakOptimized)[];
2679
+
2680
+ export declare interface XYPeaksOptimizationOptions extends OptimizePeaksOptions {
2681
+ /**
2682
+ * frequency to convert width and fwhm to ppm.
2683
+ */
2684
+ frequency: number;
2685
+ }
2686
+
2687
+ /**
2688
+ * Bidimensional automatic phase correction, based in the idea to see the spectrum as a bitmap,
2689
+ * where the number of white pixels will be bigger in a phased spectrum (whitening concept). Further information can be found in the
2690
+ * publication of Balacco and Cobas (DOI: {@link https://doi.org/10.1002/mrc.2394}). This method use a incremental search instead of simplex algorithm.
2691
+ * @param data
2692
+ * @param options
2693
+ */
2694
+ export declare function xyzAutoPhaseCorrection(data: NmrData2DFt, options?: AutoPhaseCorrection2D): Required<PhaseCorrectionTwoDOptions>;
2695
+
2696
+ export declare function xyzAutoSignalsPicking(spectraData: NmrData2DContent, options: XYZAutoSignalsPickingOptions): NMRSignal2DWithID<Peak2D & {
2697
+ id: string;
2698
+ }>[];
2699
+
2700
+ export declare interface XYZAutoSignalsPickingOptions {
2701
+ /**
2702
+ * 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.
2703
+ * @default 14
2704
+ */
2705
+ sizeToPad?: number;
2706
+ /**
2707
+ * If it's true, try to find the real maximum for each bidimensional peak.
2708
+ * @default true
2709
+ */
2710
+ realTopDetection?: boolean;
2711
+ /**
2712
+ * positive value filter small peaks by intensity
2713
+ * @default 0.5
2714
+ */
2715
+ thresholdFactor?: number;
2716
+ /**
2717
+ * specify the nuclei of each dimension
2718
+ * @default ['1H','1H']
2719
+ */
2720
+ nuclei?: string[];
2721
+ /**
2722
+ * specify the frequency for each dimension.
2723
+ */
2724
+ observedFrequencies: number[] | Float64Array;
2725
+ /**
2726
+ * If it's true, it try to ajust the shift and add missing cross peaks, useful only for homonuclear data.
2727
+ * @default false
2728
+ */
2729
+ enhanceSymmetry?: boolean;
2730
+ /**
2731
+ * If it's true, peaks with less than a specific percentage (maxPercentCutOff) of the maximum intensity will be removed.
2732
+ * @default true;
2733
+ */
2734
+ clean?: boolean;
2735
+ /**
2736
+ * percentage of maximum intensity as cutoff for small peaks.
2737
+ * @default 0.03
2738
+ */
2739
+ maxPercentCutOff?: number;
2740
+ /**
2741
+ * Specify the minimum distance in Hz for each dimension to join peaks in a signal.
2742
+ * @default [24,24]
2743
+ */
2744
+ tolerances?: number[];
2745
+ /**
2746
+ * If it is true, the convolution will be forced by FFT
2747
+ * @default true
2748
+ */
2749
+ convolutionByFFT?: boolean;
2750
+ /**
2751
+ * kernel options to calculate a laplacianOfGaussian kernel with a specify size.
2752
+ */
2753
+ kernel?: GetKernelOptions;
2754
+ }
2755
+
2756
+ export declare function xyzAutoZonesPicking(spectraData: NmrData2DContent, options: XYZAutoZonesPickingOptions): NMRZoneWithID[];
2757
+
2758
+ export declare interface XYZAutoZonesPickingOptions {
2759
+ /**
2760
+ * 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.
2761
+ * @default 14
2762
+ */
2763
+ sizeToPad?: number;
2764
+ /**
2765
+ * If it's true, try to find the real maximum for each bidimensional peak.
2766
+ * @default true
2767
+ */
2768
+ realTopDetection?: boolean;
2769
+ /**
2770
+ * positive value filter small peaks by intensity
2771
+ * @default 0.5
2772
+ */
2773
+ thresholdFactor?: number;
2774
+ /**
2775
+ * specify the nuclei of each dimension
2776
+ * @default ['1H','1H']
2777
+ */
2778
+ nuclei?: string[];
2779
+ /**
2780
+ * specify the frequency for each dimension.
2781
+ */
2782
+ observedFrequencies: number[] | Float64Array;
2783
+ /**
2784
+ * If it's true, it try to ajust the shift and add missing cross peaks, useful only for homonuclear data.
2785
+ * @default false
2786
+ */
2787
+ enhanceSymmetry?: boolean;
2788
+ /**
2789
+ * If it's true, peaks with less than a specific percentage (maxPercentCutOff) of the maximum intensity will be removed.
2790
+ * @default true;
2791
+ */
2792
+ clean?: boolean;
2793
+ /**
2794
+ * percentage of maximum intensity as cutoff for small peaks.
2795
+ * @default 0.03
2796
+ */
2797
+ maxPercentCutOff?: number;
2798
+ /**
2799
+ * Specify the minimum distance in Hz for each dimension to join peaks in a signal.
2800
+ * @default [24,24]
2801
+ */
2802
+ tolerances?: number[];
2803
+ /**
2804
+ * If it is true, the convolution will be forced by FFT
2805
+ * @default true
2806
+ */
2807
+ convolutionByFFT?: boolean;
2808
+ /**
2809
+ * kernel options to calculate a laplacianOfGaussian kernel with a specify size.
2810
+ */
2811
+ kernel?: GetKernelOptions;
2812
+ }
2813
+
2814
+ export declare function xyzJResAnalyzer(signals: NMRSignal2D[], options?: XYZJResAnalyzerOptions): NMRZoneWithID[] | (NMRSignal2D<Peak2D> & {
2815
+ id: string;
2816
+ })[];
2817
+
2818
+ declare interface XYZJResAnalyzerOptions extends CompilePatternOptions {
2819
+ /**
2820
+ * maximum difference in Hz to discard if the signal is symmetric.
2821
+ * @default 0.08
2822
+ */
2823
+ referenceMaxShiftError?: number;
2824
+ /**
2825
+ * reference value in Hz
2826
+ * @default 0
2827
+ */
2828
+ reference?: number;
2829
+ /**
2830
+ * if it is true returns zones instead of signals 2D
2831
+ * @default false
2832
+ */
2833
+ getZones?: boolean;
2834
+ }
2835
+
2836
+ export declare function xyzPhaseCorrection(data: NmrData2DFt, options: PhaseCorrectionTwoDOptions): NmrData2DFt;
2837
+
2838
+ declare type ZeroFilling = FilterFactory<Entry1D, ZeroFillingOptions> & Pick<ZeroFillingFilterOptions, 'name'>;
2839
+
2840
+ declare type ZeroFillingDimension1 = FilterFactory<Entry2D, ZeroFillingOptions> & Pick<ZeroFillingDimension1Options, 'name'>;
2841
+
2842
+ declare type ZeroFillingDimension2 = FilterFactory<Entry2D, ZeroFillingOptions> & Pick<ZeroFillingDimension2Options, 'name'>;
2843
+
2844
+ export declare interface Zone2DError {
2845
+ x: number;
2846
+ y: number;
2847
+ }
2848
+
2849
+
2850
+ export * from "gyromagnetic-ratio";
2851
+
2852
+ export { }