nmr-processing 6.0.0 → 6.0.4
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.
- package/lib/assignment/get1HAssignments.d.ts +2 -2
- package/lib/{types → assignment}/nmrAssigment.d.ts +2 -2
- package/lib/{types → assignment}/nmrAssigment.js +0 -0
- package/lib/assignment/nmrAssigment.js.map +1 -0
- package/lib/assignment/utils/createMapPossibleAssignments.d.ts +1 -1
- package/lib/databases/DatabaseNMREntry.d.ts +1 -1
- package/lib/index.d.ts +8 -9
- package/lib/ml-matrix-convolution.d.ts +8 -0
- package/lib/ml-matrix-convolution.js +2 -0
- package/lib/ml-matrix-convolution.js.map +1 -0
- package/lib/ml-simple-clustering.d.ts +8 -0
- package/lib/ml-simple-clustering.js +2 -0
- package/lib/ml-simple-clustering.js.map +1 -0
- package/lib/{types → peaks}/NMRPeak1D.d.ts +0 -0
- package/lib/{types → peaks}/NMRPeak1D.js +0 -0
- package/{lib-esm/types → lib/peaks}/NMRPeak1D.js.map +1 -1
- package/lib/peaks/peaksFilterImpurities.d.ts +1 -1
- package/lib/peaks/peaksFilterImpurities.js.map +1 -1
- package/lib/peaks/peaksToRanges.d.ts +2 -2
- package/lib/peaks/util/determineRealTop.js +2 -5
- package/lib/peaks/util/determineRealTop.js.map +1 -1
- package/lib/peaks/util/jAnalyzer.d.ts +2 -2
- package/lib/peaks/util/joinRanges.d.ts +1 -1
- package/lib/peaks/util/peakOptimizer.d.ts +1 -1
- package/lib/{types → prediction}/dataStructure.d.ts +0 -0
- package/lib/{types → prediction}/dataStructure.js +0 -0
- package/lib/prediction/dataStructure.js.map +1 -0
- package/lib/prediction/predictAll.d.ts +1 -1
- package/lib/prediction/predictAll.js.map +1 -1
- package/lib/prediction/predictCOSY.d.ts +1 -1
- package/lib/prediction/predictCOSY.js.map +1 -1
- package/lib/prediction/predictCarbon.d.ts +2 -2
- package/lib/prediction/predictCarbon.js.map +1 -1
- package/lib/prediction/predictHMBC.d.ts +1 -1
- package/lib/prediction/predictHMBC.js.map +1 -1
- package/lib/prediction/predictHSQC.d.ts +1 -1
- package/lib/prediction/predictHSQC.js.map +1 -1
- package/lib/prediction/predictProton.d.ts +1 -1
- package/lib/prediction/predictProton.js +1 -1
- package/lib/prediction/predictProton.js.map +1 -1
- package/lib/{types → prediction}/prediction1D.d.ts +2 -2
- package/lib/{types → prediction}/prediction1D.js +0 -0
- package/lib/prediction/prediction1D.js.map +1 -0
- package/lib/prediction/utils/fetchPrediction.d.ts +1 -1
- package/lib/prediction/utils/getFilteredIDiaIDs.d.ts +1 -1
- package/lib/prediction/utils/getPredictions.d.ts +1 -1
- package/lib/prediction/utils/getPredictions.js +1 -1
- package/lib/prediction/utils/getPredictions.js.map +1 -1
- package/lib/prediction/utils/predict2D.d.ts +2 -2
- package/lib/prediction/utils/queryByHOSE.d.ts +1 -1
- package/lib/ranges/rangesToACS.d.ts +1 -1
- package/lib/ranges/rangesToACS.js +8 -9
- package/lib/ranges/rangesToACS.js.map +1 -1
- package/lib/ranges/rangesToXY.d.ts +1 -1
- package/lib/ranges/rangesToXY.js.map +1 -1
- package/lib/signal/signalJoinCouplings.d.ts +1 -1
- package/lib/signal/signalMultiplicityPattern.d.ts +1 -1
- package/lib/{types → signals}/NMRSignal1D.d.ts +1 -1
- package/lib/{types → signals}/NMRSignal1D.js +0 -0
- package/lib/{types → signals}/NMRSignal1D.js.map +1 -1
- package/lib/signals/hackSignalsToXY.d.ts +1 -1
- package/lib/{types → signals}/jcoupling.d.ts +0 -0
- package/lib/{types → signals}/jcoupling.js +0 -0
- package/lib/{types → signals}/jcoupling.js.map +1 -1
- package/lib/signals/signals2DToZ.d.ts +1 -1
- package/lib/signals/signalsJoin.d.ts +3 -3
- package/lib/signals/signalsJoin.js.map +1 -1
- package/lib/signals/signalsToRanges.d.ts +2 -2
- package/lib/signals/signalsToRanges.js.map +1 -1
- package/lib/signals/signalsToXY.d.ts +1 -1
- package/lib/signals/simulation/signalsToSpinSystem.d.ts +2 -2
- package/lib/signals/simulation/simulate1D.d.ts +1 -1
- package/lib/signals/simulation/simulate1D.js +2 -1
- package/lib/signals/simulation/simulate1D.js.map +1 -1
- package/lib/signals/simulation/splitSpinSystem.d.ts +1 -1
- package/lib/{types → signals}/spinSystem.d.ts +0 -0
- package/lib/{types → signals}/spinSystem.js +0 -0
- package/lib/{types → signals}/spinSystem.js.map +1 -1
- package/lib/{types → utilities}/MakeMandatory.d.ts +0 -0
- package/lib/{types → utilities}/MakeMandatory.js +0 -0
- package/lib/utilities/MakeMandatory.js.map +1 -0
- package/lib/utilities/rangeFromSignal.d.ts +1 -1
- package/lib/utilities/resurrect.d.ts +1 -1
- package/lib/utilities/resurrectRange.d.ts +1 -1
- package/lib/{types → xy}/NMRRange.d.ts +1 -1
- package/lib/{types → xy}/NMRRange.js +0 -0
- package/lib/{types → xy}/NMRRange.js.map +1 -1
- package/lib/xy/xyAutoRangesPicking.d.ts +2 -2
- package/lib/xy/xyAutoRangesPicking.js.map +1 -1
- package/lib/{types → xyz}/NMRSignal2D.d.ts +0 -1
- package/lib/{types → xyz}/NMRSignal2D.js +0 -0
- package/lib/{types → xyz}/NMRSignal2D.js.map +1 -1
- package/lib/{types → xyz}/NMRZone.d.ts +0 -0
- package/lib/{types → xyz}/NMRZone.js +0 -0
- package/lib/{types → xyz}/NMRZone.js.map +1 -1
- package/lib/xyz/xyzAutoZonesPicking.d.ts +2 -2
- package/lib/xyz/xyzAutoZonesPicking.js.map +1 -1
- package/lib/xyz/xyzJResAnalyzer.d.ts +1 -1
- package/lib/xyz/xyzJResAnalyzer.js.map +1 -1
- package/lib-esm/{types → assignment}/nmrAssigment.js +0 -0
- package/lib-esm/assignment/nmrAssigment.js.map +1 -0
- package/lib-esm/ml-matrix-convolution.js +2 -0
- package/lib-esm/ml-matrix-convolution.js.map +1 -0
- package/lib-esm/ml-simple-clustering.js +2 -0
- package/lib-esm/ml-simple-clustering.js.map +1 -0
- package/lib-esm/{types → peaks}/NMRPeak1D.js +0 -0
- package/{lib/types → lib-esm/peaks}/NMRPeak1D.js.map +1 -1
- package/lib-esm/peaks/peaksFilterImpurities.js.map +1 -1
- package/lib-esm/peaks/util/determineRealTop.js +2 -2
- package/lib-esm/peaks/util/determineRealTop.js.map +1 -1
- package/lib-esm/{types → prediction}/dataStructure.js +0 -0
- package/lib-esm/prediction/dataStructure.js.map +1 -0
- package/lib-esm/prediction/predictAll.js.map +1 -1
- package/lib-esm/prediction/predictCOSY.js.map +1 -1
- package/lib-esm/prediction/predictCarbon.js.map +1 -1
- package/lib-esm/prediction/predictHMBC.js.map +1 -1
- package/lib-esm/prediction/predictHSQC.js.map +1 -1
- package/lib-esm/prediction/predictProton.js +1 -1
- package/lib-esm/prediction/predictProton.js.map +1 -1
- package/lib-esm/{types → prediction}/prediction1D.js +0 -0
- package/lib-esm/prediction/prediction1D.js.map +1 -0
- package/lib-esm/prediction/utils/getPredictions.js +1 -1
- package/lib-esm/prediction/utils/getPredictions.js.map +1 -1
- package/lib-esm/ranges/rangesToACS.js +8 -9
- package/lib-esm/ranges/rangesToACS.js.map +1 -1
- package/lib-esm/ranges/rangesToXY.js.map +1 -1
- package/lib-esm/{types → signals}/NMRSignal1D.js +0 -0
- package/lib-esm/{types → signals}/NMRSignal1D.js.map +1 -1
- package/lib-esm/{types → signals}/jcoupling.js +0 -0
- package/lib-esm/{types → signals}/jcoupling.js.map +1 -1
- package/lib-esm/signals/signalsJoin.js.map +1 -1
- package/lib-esm/signals/signalsToRanges.js.map +1 -1
- package/lib-esm/signals/simulation/simulate1D.js +2 -1
- package/lib-esm/signals/simulation/simulate1D.js.map +1 -1
- package/lib-esm/{types → signals}/spinSystem.js +0 -0
- package/lib-esm/{types → signals}/spinSystem.js.map +1 -1
- package/lib-esm/{types → utilities}/MakeMandatory.js +0 -0
- package/lib-esm/utilities/MakeMandatory.js.map +1 -0
- package/lib-esm/{types → xy}/NMRRange.js +0 -0
- package/lib-esm/{types → xy}/NMRRange.js.map +1 -1
- package/lib-esm/xy/xyAutoRangesPicking.js.map +1 -1
- package/lib-esm/{types → xyz}/NMRSignal2D.js +0 -0
- package/lib-esm/{types → xyz}/NMRSignal2D.js.map +1 -1
- package/lib-esm/{types → xyz}/NMRZone.js +0 -0
- package/lib-esm/{types → xyz}/NMRZone.js.map +1 -1
- package/lib-esm/xyz/xyzAutoZonesPicking.js.map +1 -1
- package/lib-esm/xyz/xyzJResAnalyzer.js.map +1 -1
- package/package.json +20 -32
- package/src/assignment/get13CAssignments.ts +1 -1
- package/src/assignment/get1HAssignments.ts +2 -2
- package/src/{types → assignment}/nmrAssigment.ts +2 -2
- package/src/assignment/utils/createMapPossibleAssignments.ts +1 -1
- package/src/databases/DatabaseNMREntry.ts +1 -1
- package/src/index.ts +8 -9
- package/src/{types/ml-matrix-convolution/index.d.ts → ml-matrix-convolution.ts} +0 -0
- package/src/{types/ml-matrix-peaks-finder/index.d.ts → ml-matrix-peaks-finder.d.ts} +0 -0
- package/src/{types/ml-simple-clustering/index.d.ts → ml-simple-clustering.ts} +0 -0
- package/src/{types/ml-sparse-matrix/index.d.ts → ml-sparse-matrix.d.ts} +0 -0
- package/src/{types/ml-tree-set/index.d.ts → ml-tree-set.d.ts} +0 -0
- package/src/{types/modules/nmr-parser.ts → nmr-parser.d.ts} +0 -0
- package/src/{types/openchemlib-utils/index..d.ts → openchemlib.d.ts} +0 -0
- package/src/{types → peaks}/NMRPeak1D.ts +0 -0
- package/src/peaks/peaksFilterImpurities.ts +2 -1
- package/src/peaks/peaksToRanges.ts +4 -4
- package/src/peaks/util/determineRealTop.ts +2 -2
- package/src/peaks/util/jAnalyzer.ts +2 -2
- package/src/peaks/util/joinRanges.ts +1 -1
- package/src/peaks/util/peakOptimizer.ts +1 -1
- package/src/{types → prediction}/dataStructure.ts +0 -0
- package/src/prediction/predictAll.ts +1 -2
- package/src/prediction/predictCOSY.ts +1 -2
- package/src/prediction/predictCarbon.ts +4 -4
- package/src/prediction/predictHMBC.ts +1 -2
- package/src/prediction/predictHSQC.ts +1 -2
- package/src/prediction/predictProton.ts +4 -3
- package/src/{types → prediction}/prediction1D.ts +2 -2
- package/src/prediction/utils/fetchPrediction.ts +1 -1
- package/src/prediction/utils/getPredictions.ts +2 -2
- package/src/prediction/utils/predict2D.ts +4 -4
- package/src/prediction/utils/queryByHOSE.ts +1 -1
- package/src/ranges/rangesToACS.ts +20 -13
- package/src/ranges/rangesToXY.ts +3 -3
- package/src/signal/signalJoinCouplings.ts +3 -3
- package/src/signal/signalMultiplicityPattern.ts +1 -1
- package/src/{types → signals}/NMRSignal1D.ts +2 -1
- package/src/signals/hackSignalsToXY.ts +2 -2
- package/src/{types → signals}/jcoupling.ts +0 -0
- package/src/signals/signals2DToZ.ts +1 -1
- package/src/signals/signalsJoin.ts +4 -3
- package/src/signals/signalsToRanges.ts +4 -3
- package/src/signals/signalsToXY.ts +3 -3
- package/src/signals/simulation/signalsToSpinSystem.ts +4 -4
- package/src/signals/simulation/simulate1D.ts +3 -2
- package/src/signals/simulation/splitSpinSystem.ts +1 -1
- package/src/{types → signals}/spinSystem.ts +0 -0
- package/src/{types → utilities}/MakeMandatory.ts +0 -0
- package/src/utilities/rangeFromSignal.ts +1 -1
- package/src/utilities/resurrect.ts +1 -1
- package/src/utilities/resurrectRange.ts +2 -2
- package/src/{types → xy}/NMRRange.ts +1 -1
- package/src/xy/xyAutoRangesPicking.ts +3 -2
- package/src/{types → xyz}/NMRSignal2D.ts +0 -2
- package/src/{types → xyz}/NMRZone.ts +0 -0
- package/src/xyz/xyzAutoZonesPicking.ts +4 -3
- package/src/xyz/xyzJResAnalyzer.ts +3 -2
- package/lib/types/MakeMandatory.js.map +0 -1
- package/lib/types/XYNumberArray.d.ts +0 -4
- package/lib/types/XYNumberArray.js +0 -3
- package/lib/types/XYNumberArray.js.map +0 -1
- package/lib/types/dataStructure.js.map +0 -1
- package/lib/types/modules/nmr-parser.d.ts +0 -11
- package/lib/types/modules/nmr-parser.js +0 -2
- package/lib/types/modules/nmr-parser.js.map +0 -1
- package/lib/types/nmrAssigment.js.map +0 -1
- package/lib/types/prediction1D.js.map +0 -1
- package/lib/types/prediction2D.d.ts +0 -0
- package/lib/types/prediction2D.js +0 -2
- package/lib/types/prediction2D.js.map +0 -1
- package/lib-esm/types/MakeMandatory.js.map +0 -1
- package/lib-esm/types/XYNumberArray.js +0 -2
- package/lib-esm/types/XYNumberArray.js.map +0 -1
- package/lib-esm/types/dataStructure.js.map +0 -1
- package/lib-esm/types/modules/nmr-parser.js +0 -2
- package/lib-esm/types/modules/nmr-parser.js.map +0 -1
- package/lib-esm/types/nmrAssigment.js.map +0 -1
- package/lib-esm/types/prediction1D.js.map +0 -1
- package/lib-esm/types/prediction2D.js +0 -2
- package/lib-esm/types/prediction2D.js.map +0 -1
- package/src/types/XYNumberArray.ts +0 -4
- package/src/types/ml-levenberg-marquardt/index.d.ts +0 -13
- package/src/types/ml-spectra-processing/index.d.ts +0 -57
- package/src/types/prediction2D.ts +0 -0
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type { Molecule } from 'openchemlib';
|
|
2
2
|
|
|
3
|
-
import type { Prediction1D } from '../types/prediction1D';
|
|
4
|
-
|
|
5
3
|
import { predictCOSY } from './predictCOSY';
|
|
6
4
|
import { predictCarbon, PredictCarbonOptions } from './predictCarbon';
|
|
7
5
|
import { predictHMBC } from './predictHMBC';
|
|
8
6
|
import { predictHSQC } from './predictHSQC';
|
|
9
7
|
import { predictProton, PredictProtonOptions } from './predictProton';
|
|
8
|
+
import type { Prediction1D } from './prediction1D';
|
|
10
9
|
import { getPredictions } from './utils/getPredictions';
|
|
11
10
|
import type { Predictor } from './utils/predict2D';
|
|
12
11
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Molecule } from 'openchemlib';
|
|
2
2
|
|
|
3
|
-
import type { Prediction1D } from '../types/prediction1D';
|
|
4
|
-
|
|
5
3
|
import { predictProton, PredictProtonOptions } from './predictProton';
|
|
4
|
+
import type { Prediction1D } from './prediction1D';
|
|
6
5
|
import { predict2D, Predictor } from './utils/predict2D';
|
|
7
6
|
|
|
8
7
|
export interface PredictCOSYOptions {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import fetch from 'cross-fetch';
|
|
2
2
|
import type { Molecule } from 'openchemlib';
|
|
3
3
|
|
|
4
|
+
import type { NMRSignal1D } from '../signals/NMRSignal1D';
|
|
4
5
|
import { signalsToRanges } from '../signals/signalsToRanges';
|
|
5
|
-
import type { MakeMandatory } from '../
|
|
6
|
-
import type { NMRSignal1D } from '../types/NMRSignal1D';
|
|
7
|
-
import type { DataBaseStructure } from '../types/dataStructure';
|
|
8
|
-
import type { Prediction1D } from '../types/prediction1D';
|
|
6
|
+
import type { MakeMandatory } from '../utilities/MakeMandatory';
|
|
9
7
|
|
|
8
|
+
import type { DataBaseStructure } from './dataStructure';
|
|
9
|
+
import type { Prediction1D } from './prediction1D';
|
|
10
10
|
import { fetchPrediction } from './utils/fetchPrediction';
|
|
11
11
|
import { flatGroupedDiaIDs } from './utils/flatGroupedDiaIDs';
|
|
12
12
|
import { getFilteredIDiaIDs } from './utils/getFilteredIDiaIDs';
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Molecule } from 'openchemlib';
|
|
2
2
|
|
|
3
|
-
import type { Prediction1D } from '../types/prediction1D';
|
|
4
|
-
|
|
5
3
|
import { predictCarbon } from './predictCarbon';
|
|
6
4
|
import type { PredictCarbonOptions } from './predictCarbon';
|
|
7
5
|
import { predictProton } from './predictProton';
|
|
8
6
|
import type { PredictProtonOptions } from './predictProton';
|
|
7
|
+
import type { Prediction1D } from './prediction1D';
|
|
9
8
|
import { predict2D } from './utils/predict2D';
|
|
10
9
|
import type { Predictor } from './utils/predict2D';
|
|
11
10
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Molecule } from 'openchemlib';
|
|
2
2
|
|
|
3
|
-
import type { Prediction1D } from '../types/prediction1D';
|
|
4
|
-
|
|
5
3
|
import { predictCarbon, PredictCarbonOptions } from './predictCarbon';
|
|
6
4
|
import { predictProton, PredictProtonOptions } from './predictProton';
|
|
5
|
+
import type { Prediction1D } from './prediction1D';
|
|
7
6
|
import { predict2D, Predictor } from './utils/predict2D';
|
|
8
7
|
|
|
9
8
|
export interface PredictHSQCOptions {
|
|
@@ -7,10 +7,11 @@ import {
|
|
|
7
7
|
getDiastereotopicAtomIDs,
|
|
8
8
|
} from 'openchemlib-utils';
|
|
9
9
|
|
|
10
|
+
import type { NMRSignal1D } from '../signals/NMRSignal1D';
|
|
10
11
|
import { signalsJoin } from '../signals/signalsJoin';
|
|
11
12
|
import { signalsToRanges } from '../signals/signalsToRanges';
|
|
12
|
-
|
|
13
|
-
import type { Prediction1D } from '
|
|
13
|
+
|
|
14
|
+
import type { Prediction1D } from './prediction1D';
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* Makes a prediction using proton.
|
|
@@ -45,7 +46,7 @@ export async function predictProton(
|
|
|
45
46
|
formData.append('molfile', molfile);
|
|
46
47
|
const response = await fetch('https://www.nmrdb.org/service/predictor', {
|
|
47
48
|
method: 'POST',
|
|
48
|
-
|
|
49
|
+
// @ts-expect-error RequestInit type does not include FormData.
|
|
49
50
|
body: formData,
|
|
50
51
|
});
|
|
51
52
|
result = await response.text();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Molecule } from 'openchemlib';
|
|
2
2
|
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
3
|
+
import type { NMRSignal1D } from '../signals/NMRSignal1D';
|
|
4
|
+
import type { NMRRange } from '../xy/NMRRange';
|
|
5
5
|
|
|
6
6
|
export interface Prediction1D {
|
|
7
7
|
molfile: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Molecule } from 'openchemlib';
|
|
2
2
|
|
|
3
|
-
import type { Prediction1D } from '
|
|
3
|
+
import type { Prediction1D } from '../prediction1D';
|
|
4
4
|
|
|
5
5
|
import type { Predictions, PredictOptions, Predictors } from './predict2D';
|
|
6
6
|
|
|
@@ -12,7 +12,7 @@ export async function getPredictions(
|
|
|
12
12
|
predictions?: Predictions,
|
|
13
13
|
) {
|
|
14
14
|
let prediction: Prediction1D | undefined;
|
|
15
|
-
if (predictions
|
|
15
|
+
if (predictions?.[key]) {
|
|
16
16
|
prediction = predictions[key];
|
|
17
17
|
} else if (predictor) {
|
|
18
18
|
const fromPredictor = predictor[key];
|
|
@@ -11,12 +11,12 @@ import type {
|
|
|
11
11
|
PathInfo,
|
|
12
12
|
} from 'openchemlib-utils';
|
|
13
13
|
|
|
14
|
-
import type {
|
|
15
|
-
import type {
|
|
16
|
-
import type { NMRSignal2D } from '../../
|
|
17
|
-
import type { Prediction1D } from '../../types/prediction1D';
|
|
14
|
+
import type { NMRSignal1D } from '../../signals/NMRSignal1D';
|
|
15
|
+
import type { MakeMandatory } from '../../utilities/MakeMandatory';
|
|
16
|
+
import type { NMRSignal2D } from '../../xyz/NMRSignal2D';
|
|
18
17
|
import type { PredictCarbon, PredictCarbonOptions } from '../predictCarbon';
|
|
19
18
|
import type { PredictProton, PredictProtonOptions } from '../predictProton';
|
|
19
|
+
import type { Prediction1D } from '../prediction1D';
|
|
20
20
|
|
|
21
21
|
import { getNuclei } from './getNuclei';
|
|
22
22
|
import { getPredictions } from './getPredictions';
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import { signalJoinCouplings } from '../signal/signalJoinCouplings';
|
|
2
2
|
import { signalMultiplicityPattern } from '../signal/signalMultiplicityPattern';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
3
|
+
import type { NMRSignal1D } from '../signals/NMRSignal1D';
|
|
4
|
+
import type { NMRRange } from '../xy/NMRRange';
|
|
5
5
|
|
|
6
|
-
const globalOptions
|
|
6
|
+
const globalOptions: Record<
|
|
7
|
+
string,
|
|
8
|
+
{
|
|
9
|
+
nucleus: string;
|
|
10
|
+
nbDecimalDelta: number;
|
|
11
|
+
nbDecimalJ: number;
|
|
12
|
+
observedFrequency: number;
|
|
13
|
+
}
|
|
14
|
+
> = {
|
|
7
15
|
h: {
|
|
8
16
|
nucleus: '1H',
|
|
9
17
|
nbDecimalDelta: 2,
|
|
@@ -62,9 +70,8 @@ export function rangesToACS(
|
|
|
62
70
|
options: RangesToACSOptions = {},
|
|
63
71
|
) {
|
|
64
72
|
if (!options.nucleus) options.nucleus = '1H';
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
let defaultOptions = globalOptions[nucleus];
|
|
73
|
+
const nucleus = options.nucleus.toLowerCase().replace(/[0-9]/g, '');
|
|
74
|
+
const defaultOptions = globalOptions[nucleus];
|
|
68
75
|
options = Object.assign(
|
|
69
76
|
{},
|
|
70
77
|
defaultOptions,
|
|
@@ -75,13 +82,13 @@ export function rangesToACS(
|
|
|
75
82
|
ranges = JSON.parse(JSON.stringify(ranges));
|
|
76
83
|
if (options.ascending === true) {
|
|
77
84
|
ranges.sort((a, b) => {
|
|
78
|
-
|
|
79
|
-
|
|
85
|
+
const fromA = Math.min(a.from, a.to);
|
|
86
|
+
const fromB = Math.min(b.from, b.to);
|
|
80
87
|
return fromA - fromB;
|
|
81
88
|
});
|
|
82
89
|
}
|
|
83
|
-
let acsString = formatAcs(ranges, options);
|
|
84
90
|
|
|
91
|
+
let acsString = formatAcs(ranges, options);
|
|
85
92
|
if (acsString.length > 0) acsString += '.';
|
|
86
93
|
|
|
87
94
|
return acsString;
|
|
@@ -90,8 +97,8 @@ export function rangesToACS(
|
|
|
90
97
|
function formatAcs(ranges: NMRRange[], options: any) {
|
|
91
98
|
let acs = spectroInformation(options);
|
|
92
99
|
if (acs.length === 0) acs = 'δ ';
|
|
93
|
-
|
|
94
|
-
for (
|
|
100
|
+
const acsRanges: string[] = [];
|
|
101
|
+
for (const range of ranges) {
|
|
95
102
|
if (uselessKind(range.kind, options.filter)) continue;
|
|
96
103
|
pushDelta(range, acsRanges, options);
|
|
97
104
|
}
|
|
@@ -103,7 +110,7 @@ function formatAcs(ranges: NMRRange[], options: any) {
|
|
|
103
110
|
}
|
|
104
111
|
|
|
105
112
|
function spectroInformation(options: any) {
|
|
106
|
-
|
|
113
|
+
const parenthesis = [];
|
|
107
114
|
let strings = `${formatNucleus(options.nucleus)} NMR`;
|
|
108
115
|
if (options.solvent) {
|
|
109
116
|
parenthesis.push(formatMF(options.solvent));
|
|
@@ -122,7 +129,7 @@ function spectroInformation(options: any) {
|
|
|
122
129
|
function pushDelta(range: NMRRange, acsRanges: string[], options: any) {
|
|
123
130
|
let strings = '';
|
|
124
131
|
let parenthesis: any = [];
|
|
125
|
-
|
|
132
|
+
const fromTo = [range.from, range.to];
|
|
126
133
|
|
|
127
134
|
if (range.signals) {
|
|
128
135
|
range.signals = range.signals.filter(
|
package/src/ranges/rangesToXY.ts
CHANGED
|
@@ -3,10 +3,10 @@ import arraySequentialFill from 'ml-array-sequential-fill';
|
|
|
3
3
|
import type { Shape1D } from 'ml-peak-shape-generator';
|
|
4
4
|
import { SpectrumGenerator } from 'spectrum-generator';
|
|
5
5
|
|
|
6
|
+
import type { NMRSignal1D } from '../signals/NMRSignal1D';
|
|
6
7
|
import { hackSignalsToXY } from '../signals/hackSignalsToXY';
|
|
7
|
-
import type { MakeMandatory } from '../
|
|
8
|
-
import type { NMRRange } from '../
|
|
9
|
-
import type { NMRSignal1D } from '../types/NMRSignal1D';
|
|
8
|
+
import type { MakeMandatory } from '../utilities/MakeMandatory';
|
|
9
|
+
import type { NMRRange } from '../xy/NMRRange';
|
|
10
10
|
|
|
11
11
|
type RangeWithSignal = MakeMandatory<NMRRange, 'signals'>;
|
|
12
12
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import sum from 'ml-array-sum';
|
|
2
2
|
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
3
|
+
import type { NMRSignal1D } from '../signals/NMRSignal1D';
|
|
4
|
+
import type { Jcoupling } from '../signals/jcoupling';
|
|
5
|
+
import type { MakeMandatory } from '../utilities/MakeMandatory';
|
|
6
6
|
import { joinPatterns } from '../utilities/joinPatterns';
|
|
7
7
|
|
|
8
8
|
export interface SignalJoinCouplingsOptions {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { couplingPatterns } from '../constants/couplingPatterns';
|
|
2
|
-
import type { NMRSignal1D } from '../types/NMRSignal1D';
|
|
3
|
-
import type { Jcoupling } from '../types/jcoupling';
|
|
4
2
|
|
|
3
|
+
import type { NMRSignal1D } from './NMRSignal1D';
|
|
4
|
+
import type { Jcoupling } from './jcoupling';
|
|
5
5
|
import { OptionsSignalsToXY, signalsToXY } from './signalsToXY';
|
|
6
6
|
|
|
7
7
|
/**
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { generateSpectrum2D } from 'spectrum-generator';
|
|
2
2
|
import type { XYNumber } from 'spectrum-generator';
|
|
3
3
|
|
|
4
|
-
import type { NMRSignal2D } from '../
|
|
4
|
+
import type { NMRSignal2D } from '../xyz/NMRSignal2D';
|
|
5
5
|
|
|
6
6
|
interface Signals2DToZOptions {
|
|
7
7
|
/**
|
|
@@ -3,9 +3,10 @@ import sum from 'ml-array-sum';
|
|
|
3
3
|
|
|
4
4
|
import { signalJoinCouplings } from '../signal/signalJoinCouplings';
|
|
5
5
|
import type { SignalJoinCouplingsOptions } from '../signal/signalJoinCouplings';
|
|
6
|
-
import type { MakeMandatory } from '../
|
|
7
|
-
|
|
8
|
-
import type {
|
|
6
|
+
import type { MakeMandatory } from '../utilities/MakeMandatory';
|
|
7
|
+
|
|
8
|
+
import type { NMRSignal1D } from './NMRSignal1D';
|
|
9
|
+
import type { Jcoupling } from './jcoupling';
|
|
9
10
|
|
|
10
11
|
export interface SignalsJoinOptions {
|
|
11
12
|
/**
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { MakeMandatory } from '../
|
|
2
|
-
import type { NMRRange } from '../types/NMRRange';
|
|
3
|
-
import type { NMRSignal1D } from '../types/NMRSignal1D';
|
|
1
|
+
import type { MakeMandatory } from '../utilities/MakeMandatory';
|
|
4
2
|
import { rangeFromSignal } from '../utilities/rangeFromSignal';
|
|
3
|
+
import type { NMRRange } from '../xy/NMRRange';
|
|
4
|
+
|
|
5
|
+
import type { NMRSignal1D } from './NMRSignal1D';
|
|
5
6
|
|
|
6
7
|
interface SignalsToRangesOptions {
|
|
7
8
|
/**
|
|
@@ -2,10 +2,10 @@ import rescale from 'ml-array-rescale';
|
|
|
2
2
|
import arraySequentialFill from 'ml-array-sequential-fill';
|
|
3
3
|
import type { Shape1D } from 'ml-peak-shape-generator';
|
|
4
4
|
|
|
5
|
-
import type { MakeMandatory } from '../
|
|
6
|
-
import type { NMRSignal1D } from '../types/NMRSignal1D';
|
|
7
|
-
import type { Jcoupling } from '../types/jcoupling';
|
|
5
|
+
import type { MakeMandatory } from '../utilities/MakeMandatory';
|
|
8
6
|
|
|
7
|
+
import type { NMRSignal1D } from './NMRSignal1D';
|
|
8
|
+
import type { Jcoupling } from './jcoupling';
|
|
9
9
|
import { signalsToSpinSystem } from './simulation/signalsToSpinSystem';
|
|
10
10
|
import simulate1D from './simulation/simulate1D';
|
|
11
11
|
import { splitSpinSystem } from './simulation/splitSpinSystem';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Matrix } from 'ml-matrix';
|
|
2
2
|
import simpleClustering from 'ml-simple-clustering';
|
|
3
3
|
|
|
4
|
-
import type { MakeMandatory } from '../../
|
|
5
|
-
import type { NMRSignal1D } from '
|
|
6
|
-
import type { Jcoupling } from '
|
|
7
|
-
import type { SpinSystem } from '
|
|
4
|
+
import type { MakeMandatory } from '../../utilities/MakeMandatory';
|
|
5
|
+
import type { NMRSignal1D } from '../NMRSignal1D';
|
|
6
|
+
import type { Jcoupling } from '../jcoupling';
|
|
7
|
+
import type { SpinSystem } from '../spinSystem';
|
|
8
8
|
|
|
9
9
|
interface Ids {
|
|
10
10
|
[index: number]: number;
|
|
@@ -6,7 +6,7 @@ import type { Shape1D } from 'ml-peak-shape-generator';
|
|
|
6
6
|
import { SparseMatrix } from 'ml-sparse-matrix';
|
|
7
7
|
import { SpectrumGenerator } from 'spectrum-generator';
|
|
8
8
|
|
|
9
|
-
import type { SpinSystem } from '
|
|
9
|
+
import type { SpinSystem } from '../spinSystem';
|
|
10
10
|
|
|
11
11
|
import getPauliMatrix from './getPauliMatrix';
|
|
12
12
|
|
|
@@ -133,7 +133,8 @@ export default function simulate1D(
|
|
|
133
133
|
clusterFake,
|
|
134
134
|
);
|
|
135
135
|
const hamSize = hamiltonian.rows;
|
|
136
|
-
|
|
136
|
+
// TODO: add support for sparse matrix in matrix types.
|
|
137
|
+
// @ts-expect-error sparse matrix not supported
|
|
137
138
|
const evd = new EVD(hamiltonian);
|
|
138
139
|
const V = evd.eigenvectorMatrix;
|
|
139
140
|
const diagB = evd.realEigenvalues;
|
|
@@ -2,7 +2,7 @@ import { agnes } from 'ml-hclust';
|
|
|
2
2
|
import type { Cluster } from 'ml-hclust';
|
|
3
3
|
import { Matrix } from 'ml-matrix';
|
|
4
4
|
|
|
5
|
-
import type { SpinSystem } from '
|
|
5
|
+
import type { SpinSystem } from '../spinSystem';
|
|
6
6
|
|
|
7
7
|
export interface SplitSpinSystemOptions {
|
|
8
8
|
/**
|
|
File without changes
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { NMRSignal1D } from '../signals/NMRSignal1D';
|
|
2
|
+
import type { NMRRange } from '../xy/NMRRange';
|
|
3
3
|
|
|
4
4
|
import { rangeFromSignal } from './rangeFromSignal';
|
|
5
5
|
import { splitParenthesis } from './splitParenthesis';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { DataXY } from 'cheminfo-types';
|
|
2
|
+
|
|
1
3
|
import { peaksFilterImpurities } from '../peaks/peaksFilterImpurities';
|
|
2
4
|
import type { OptionsPeaksFilterImpurities } from '../peaks/peaksFilterImpurities';
|
|
3
5
|
import { OptionsPeaksToRanges, peaksToRanges } from '../peaks/peaksToRanges';
|
|
4
|
-
import type { XYNumberArray } from '../types/XYNumberArray';
|
|
5
6
|
|
|
6
7
|
import { xyAutoPeaksPicking } from './xyAutoPeaksPicking';
|
|
7
8
|
import type { OptionsXYAutoPeaksPicking } from './xyAutoPeaksPicking';
|
|
@@ -16,7 +17,7 @@ interface OptionsXYAutoRangesPicking {
|
|
|
16
17
|
* Detect peaks, optimize parameters and compile multiplicity if required.
|
|
17
18
|
*/
|
|
18
19
|
export function xyAutoRangesPicking(
|
|
19
|
-
data:
|
|
20
|
+
data: DataXY,
|
|
20
21
|
options: OptionsXYAutoRangesPicking = {},
|
|
21
22
|
) {
|
|
22
23
|
let peaks = xyAutoPeaksPicking(data, options.peakPicking);
|
|
File without changes
|
|
@@ -9,7 +9,8 @@ import { determineRealTop } from '../peaks/util/determineRealTop';
|
|
|
9
9
|
import { getKernel } from '../peaks/util/getKernel';
|
|
10
10
|
import type { GetKernelOptions } from '../peaks/util/getKernel';
|
|
11
11
|
import * as PeakOptimizer from '../peaks/util/peakOptimizer';
|
|
12
|
-
|
|
12
|
+
|
|
13
|
+
import type { NMRSignal2D } from './NMRSignal2D';
|
|
13
14
|
|
|
14
15
|
const smallFilter = [
|
|
15
16
|
[0, 0, 1, 2, 2, 2, 1, 0, 0],
|
|
@@ -31,7 +32,7 @@ export interface Data2D {
|
|
|
31
32
|
maxY: number;
|
|
32
33
|
}
|
|
33
34
|
|
|
34
|
-
export interface
|
|
35
|
+
export interface XYZAutoZonesPickingOptions {
|
|
35
36
|
/**
|
|
36
37
|
* 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.
|
|
37
38
|
* @default 14
|
|
@@ -89,7 +90,7 @@ export interface XYZAutoPeaksPickingOptions {
|
|
|
89
90
|
|
|
90
91
|
export function xyzAutoZonesPicking(
|
|
91
92
|
spectraData: Data2D,
|
|
92
|
-
options:
|
|
93
|
+
options: XYZAutoZonesPickingOptions,
|
|
93
94
|
) {
|
|
94
95
|
let {
|
|
95
96
|
sizeToPad = 14,
|
|
@@ -3,8 +3,9 @@ import simpleClustering from 'ml-simple-clustering';
|
|
|
3
3
|
|
|
4
4
|
import type { JAxisKeys } from '../peaks/util/jAnalyzer';
|
|
5
5
|
import jAnalyzer from '../peaks/util/jAnalyzer';
|
|
6
|
-
import type { MakeMandatory } from '../
|
|
7
|
-
|
|
6
|
+
import type { MakeMandatory } from '../utilities/MakeMandatory';
|
|
7
|
+
|
|
8
|
+
import type { NMRSignal2D } from './NMRSignal2D';
|
|
8
9
|
|
|
9
10
|
interface CompilePatternOptions {
|
|
10
11
|
observedFrequencies?: number[] | Float64Array;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MakeMandatory.js","sourceRoot":"","sources":["../../src/types/MakeMandatory.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"XYNumberArray.js","sourceRoot":"","sources":["../../src/types/XYNumberArray.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dataStructure.js","sourceRoot":"","sources":["../../src/types/dataStructure.ts"],"names":[],"mappings":""}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
declare module 'nmr-parser' {
|
|
2
|
-
interface FromBrukerOptions {
|
|
3
|
-
base64?: boolean;
|
|
4
|
-
shiftX?: number;
|
|
5
|
-
info?: any;
|
|
6
|
-
name?: string;
|
|
7
|
-
}
|
|
8
|
-
function fromBruker(zipFile: ArrayBuffer | string, options?: Partial<FromBrukerOptions>): Promise<Array<any>>;
|
|
9
|
-
function fromJCAMP(buffer: string | ArrayBuffer, options?: any): Array<any>;
|
|
10
|
-
function fromJEOL(buffer: ArrayBuffer): any;
|
|
11
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nmr-parser.js","sourceRoot":"","sources":["../../../src/types/modules/nmr-parser.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nmrAssigment.js","sourceRoot":"","sources":["../../src/types/nmrAssigment.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prediction1D.js","sourceRoot":"","sources":["../../src/types/prediction1D.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prediction2D.js","sourceRoot":"","sources":["../../src/types/prediction2D.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MakeMandatory.js","sourceRoot":"","sources":["../../src/types/MakeMandatory.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"XYNumberArray.js","sourceRoot":"","sources":["../../src/types/XYNumberArray.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dataStructure.js","sourceRoot":"","sources":["../../src/types/dataStructure.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nmr-parser.js","sourceRoot":"","sources":["../../../src/types/modules/nmr-parser.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nmrAssigment.js","sourceRoot":"","sources":["../../src/types/nmrAssigment.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prediction1D.js","sourceRoot":"","sources":["../../src/types/prediction1D.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prediction2D.js","sourceRoot":"","sources":["../../src/types/prediction2D.ts"],"names":[],"mappings":""}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
declare module 'ml-levenberg-marquardt' {
|
|
2
|
-
import type { DataXY } from 'cheminfo-types';
|
|
3
|
-
|
|
4
|
-
export default function levenbergMarquardt(
|
|
5
|
-
data: DataXY,
|
|
6
|
-
parametrizedFunction: (p: number[]) => (t: number) => number,
|
|
7
|
-
options?: any,
|
|
8
|
-
): {
|
|
9
|
-
parameterValues: Array<number>;
|
|
10
|
-
parameterError: number;
|
|
11
|
-
iterations: number;
|
|
12
|
-
};
|
|
13
|
-
}
|