nmr-processing 22.21.0 → 22.22.1

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.
@@ -18,7 +18,7 @@ import type { BaselineCorrectionFilterOptions } from '@zakodium/nmr-types';
18
18
  import type { BaselineCorrectionOptions } from '@zakodium/nmr-types';
19
19
  import type { BaselineCorrectionZone } from '@zakodium/nmr-types';
20
20
  import { BaseRegression } from 'ml-regression-base';
21
- import type { DataReIm } from 'ml-spectra-processing';
21
+ import { DataReIm } from 'ml-spectra-processing';
22
22
  import type { DataReImMatrix } from 'ml-spectra-processing';
23
23
  import type { DataXReIm } from 'ml-spectra-processing';
24
24
  import { DataXY } from 'cheminfo-types';
@@ -69,6 +69,7 @@ import type { NmrData2DContent } from 'cheminfo-types';
69
69
  import type { NmrData2DFt } from 'cheminfo-types';
70
70
  import type { NMRPeak1D } from '@zakodium/nmr-types';
71
71
  import { NMRRange } from '@zakodium/nmr-types';
72
+ import type { NMRShape1D } from '@zakodium/nmr-types';
72
73
  import type { NMRSignal1D } from '@zakodium/nmr-types';
73
74
  import type { NumberArray } from 'cheminfo-types';
74
75
  import type { NUSDimension2Options } from '@zakodium/nmr-types';
@@ -88,7 +89,6 @@ import type { PhaseCorrectionTwoDOptions } from '@zakodium/nmr-types';
88
89
  import { PointXY } from 'cheminfo-types';
89
90
  import type { Range as Range_2 } from '@zakodium/nmr-types';
90
91
  import type { Ranges } from '@zakodium/nmr-types';
91
- import type { Shape1D } from 'ml-peak-shape-generator';
92
92
  import type { Shape1DWithFWHM } from '@zakodium/nmr-types';
93
93
  import type { Shapes } from '@zakodium/nmr-types';
94
94
  import type { Shift2DXFilterOptions } from '@zakodium/nmr-types';
@@ -224,6 +224,12 @@ declare interface AtomOutput {
224
224
 
225
225
  declare type AtomTypes = 'H' | 'C';
226
226
 
227
+ export declare function autoPhaseCorrection(spectrum: Entry1D, options?: AutoPhaseCorrectionOptions): {
228
+ data: DataReIm;
229
+ ph0: number;
230
+ ph1: number;
231
+ };
232
+
227
233
  export declare interface AutoPhaseCorrectionOptions {
228
234
  minRegSize?: number;
229
235
  maxDistanceToJoin?: number;
@@ -962,7 +968,7 @@ export declare function getPeakDelta(peak: Peak1D | NMRPeak1D, shiftTarget: Shif
962
968
  x: number;
963
969
  };
964
970
 
965
- export declare interface GetPeakListOptions extends GSDOptions, OptimizePeaksOptions, JoinBroadPeaksOptions {
971
+ export declare interface GetPeakListOptions extends GSDOptions, OptimizeNMRPeaksOptions, JoinBroadNMRPeaksOptions {
966
972
  smoothedY: NumberArray;
967
973
  /**
968
974
  * If it is true, the peaks parameters will be optimized.
@@ -1023,6 +1029,10 @@ declare function getShifts(s: ShiftInput[]): ShiftOutput[];
1023
1029
 
1024
1030
  export declare function getShiftX(spectrum: Entry1D): number;
1025
1031
 
1032
+ declare type GSDNMRPeakOptimizedID = Omit<GSDPeakOptimizedID, 'shape'> & {
1033
+ shape: NMRShape1D;
1034
+ };
1035
+
1026
1036
  declare interface HOSEPrediction {
1027
1037
  /**
1028
1038
  * In case the prediction is based on HOSE codes, this is the sphere
@@ -1047,6 +1057,10 @@ export declare function isZoneExists(zone: Pick<Zone, 'x' | 'y'>, spectrum: Entr
1047
1057
 
1048
1058
  declare type JcouplingFromPrediction = MakeMandatory<Jcoupling, 'multiplicity' | 'diaIDs' | 'pathLength'>;
1049
1059
 
1060
+ declare type JoinBroadNMRPeaksOptions = Omit<JoinBroadPeaksOptions, 'shape'> & {
1061
+ shape?: NMRShape1D;
1062
+ };
1063
+
1050
1064
  declare type LevenbergMarquardtOptimizationOptionsDefaultsKeys = Extract<'minValues' | 'maxValues' | 'initialValues' | 'gradientDifference' | keyof typeof defaultLMOptimizationOptions, keyof LevenbergMarquardtOptions>;
1051
1065
 
1052
1066
  declare type LevenbergMarquardtOptionsDefault = Pick<LevenbergMarquardtOptions, LevenbergMarquardtOptionsWithDefaultKeys>;
@@ -1263,11 +1277,15 @@ declare interface OneDOptions {
1263
1277
 
1264
1278
  export declare type OneLetterMultiplet = 's' | 'd' | 't' | 'q' | 'i' | 'h' | 'p' | 'o' | 'n' | 'm';
1265
1279
 
1280
+ declare type OptimizeNMRPeaksOptions = Omit<OptimizePeaksOptions, 'shape'> & {
1281
+ shape?: NMRShape1D;
1282
+ };
1283
+
1266
1284
  export declare function optimizeSignals(data: DataXY, signals: Signal[], options: OptimizeSignalsOptions): {
1267
1285
  delta: number;
1268
1286
  js: Jcoupling[];
1269
1287
  shape: {
1270
- kind: "gaussian" | "lorentzian" | "pseudoVoigt" | "lorentzianDispersive" | "generalizedLorentzian" | "pseudoVoigtTCH";
1288
+ kind: "gaussian" | "lorentzian" | "pseudoVoigt" | "generalizedLorentzian";
1271
1289
  fwhm: number;
1272
1290
  };
1273
1291
  intensity: number;
@@ -1284,7 +1302,7 @@ export declare interface OptimizeSignalsOptions {
1284
1302
  * @default 'min intensity value'
1285
1303
  */
1286
1304
  baseline?: number;
1287
- shape?: Shape1D;
1305
+ shape?: NMRShape1D;
1288
1306
  parameters?: ParametersFromOptions;
1289
1307
  optimization?: OptimizeSignalsOptionsOptimization;
1290
1308
  simulation: SignalsToPointXYOptions;
@@ -1312,7 +1330,7 @@ declare interface OptionsPeaksToRanges {
1312
1330
  * Peak shape used to reconstruct additional or filtered peaks when compiling patterns.
1313
1331
  * @default { kind: 'gaussian' }
1314
1332
  */
1315
- shape?: Shape1D;
1333
+ shape?: NMRShape1D;
1316
1334
  /**
1317
1335
  * if it is true, it will join any overlaped ranges.
1318
1336
  * @default true
@@ -1378,7 +1396,7 @@ export declare interface OptionsSignalsToXY extends Partial<Simulate1DOptions> {
1378
1396
  /**
1379
1397
  * Shape options for ml-spectrum-generator
1380
1398
  */
1381
- shape?: Shape1D;
1399
+ shape?: NMRShape1D;
1382
1400
  /**
1383
1401
  * The linewidth of the output spectrum, expresed in Hz.
1384
1402
  * @default 1
@@ -1468,7 +1486,7 @@ declare type Parameter = 'delta' | 'intensity' | 'fwhm' | 'mu' | 'coupling' | 'g
1468
1486
 
1469
1487
  declare type ParametersFromOptions = Record<Parameter, Record<string, number | ((options?: {
1470
1488
  signal?: Signal;
1471
- shape?: Shape1D;
1489
+ shape?: NMRShape1D;
1472
1490
  index?: number;
1473
1491
  jCoupling?: Jcoupling;
1474
1492
  }) => number)>>;
@@ -1999,7 +2017,7 @@ export declare interface RangesToXYOptions {
1999
2017
  frequency?: number;
2000
2018
  nbPoints?: number;
2001
2019
  lineWidth?: number;
2002
- shape?: Shape1D;
2020
+ shape?: NMRShape1D;
2003
2021
  from?: number;
2004
2022
  to?: number;
2005
2023
  }
@@ -2033,7 +2051,7 @@ export declare interface RangeToXYOptions {
2033
2051
  /**
2034
2052
  * options of signals. default { kind: 'gaussian' }
2035
2053
  */
2036
- shape: Shape1D;
2054
+ shape: NMRShape1D;
2037
2055
  }
2038
2056
 
2039
2057
  export declare namespace RangeUtilities {
@@ -2147,7 +2165,7 @@ declare type ShiftX = FilterFactory<Entry1D, ShiftXOptions> & Pick<ShiftXFilterO
2147
2165
 
2148
2166
  export declare interface Signal extends NMRSignal1D {
2149
2167
  intensity?: number;
2150
- shape?: Shape1D;
2168
+ shape?: NMRShape1D;
2151
2169
  parameters?: ParametersFromSignal;
2152
2170
  }
2153
2171
 
@@ -2376,7 +2394,7 @@ export declare interface Simulate1DOptions extends SimulateXYPeaksOptions {
2376
2394
  * Shape options
2377
2395
  * @default {kind:'gaussian'}
2378
2396
  */
2379
- shape?: Shape1D;
2397
+ shape?: NMRShape1D;
2380
2398
  /**
2381
2399
  * Function to generate or add a baseline
2382
2400
  */
@@ -2742,7 +2760,7 @@ export declare function xyPeaksOptimization<T extends PeakXYWidth>(data: DataXY,
2742
2760
  id: string;
2743
2761
  } ? GSDPeakOptimizedID : GSDPeakOptimized)[];
2744
2762
 
2745
- export declare function xyPeaksOptimizationByStages(data: DataXY, peaks: PeakXYWidth[], options: XYPeaksOptimizationOptionsByStages): GSDPeakOptimizedID[];
2763
+ export declare function xyPeaksOptimizationByStages(data: DataXY, peaks: PeakXYWidth[], options: XYPeaksOptimizationOptionsByStages): GSDNMRPeakOptimizedID[];
2746
2764
 
2747
2765
  export declare interface XYPeaksOptimizationOptions extends OptimizePeaksOptions {
2748
2766
  /**