nmr-processing 3.3.0 → 3.3.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/CHANGELOG.md +28 -0
- package/lib/databases/DatabaseNMREntry.d.ts +1 -1
- package/lib/index.d.ts +9 -0
- package/lib/peaks/peaksToRanges.d.ts +1 -1
- package/lib/peaks/peaksToRanges.js.map +1 -1
- package/lib/peaks/util/determineRealTop.d.ts +1 -1
- package/lib/peaks/util/jAnalyzer.d.ts +2 -2
- package/lib/prediction/predictCOSY.d.ts +3 -3
- package/lib/prediction/predictCarbon.d.ts +1 -1
- package/lib/prediction/predictCarbon.js +5 -5
- package/lib/prediction/predictCarbon.js.map +1 -1
- package/lib/prediction/predictHMBC.d.ts +3 -3
- package/lib/prediction/predictHSQC.d.ts +3 -3
- package/lib/prediction/predictProton.js +2 -2
- package/lib/prediction/predictProton.js.map +1 -1
- package/lib/prediction/utils/getFilteredIDiaIDs.d.ts +1 -1
- package/lib/prediction/utils/predict2D.js +6 -6
- package/lib/prediction/utils/predict2D.js.map +1 -1
- package/lib/prediction/utils/queryByHOSE.d.ts +1 -1
- package/lib/prediction/utils/queryByHOSE.js +1 -1
- package/lib/prediction/utils/queryByHOSE.js.map +1 -1
- package/lib/ranges/rangesToXY.d.ts +2 -2
- package/lib/signal/signalJoinCouplings.d.ts +1 -1
- package/lib/signal/signalJoinCouplings.js +5 -5
- package/lib/signal/signalJoinCouplings.js.map +1 -1
- package/lib/signals/hackSignalsToXY.js +7 -7
- package/lib/signals/hackSignalsToXY.js.map +1 -1
- package/lib/signals/signals2DToZ.js.map +1 -1
- package/lib/signals/signalsJoin.js +1 -1
- package/lib/signals/signalsJoin.js.map +1 -1
- package/lib/signals/signalsToXY.d.ts +2 -2
- package/lib/signals/signalsToXY.js +4 -4
- package/lib/signals/signalsToXY.js.map +1 -1
- package/lib/signals/simulation/signalsToSpinSystem.js +8 -8
- package/lib/signals/simulation/signalsToSpinSystem.js.map +1 -1
- package/lib/signals/simulation/simulate1D.d.ts +3 -3
- package/lib/types/MPFPeak.d.ts +9 -0
- package/lib/types/MPFPeak.js +3 -0
- package/lib/types/MPFPeak.js.map +1 -0
- package/lib/types/MakeMandatory.d.ts +3 -0
- package/lib/types/MakeMandatory.js +3 -0
- package/lib/types/MakeMandatory.js.map +1 -0
- package/lib/types/NMRPeak1D.d.ts +11 -0
- package/lib/types/NMRPeak1D.js +3 -0
- package/lib/types/NMRPeak1D.js.map +1 -0
- package/lib/types/NMRRange.d.ts +11 -0
- package/lib/types/NMRRange.js +3 -0
- package/lib/types/NMRRange.js.map +1 -0
- package/lib/types/NMRSignal1D.d.ts +21 -0
- package/lib/types/NMRSignal1D.js +3 -0
- package/lib/types/NMRSignal1D.js.map +1 -0
- package/lib/types/NMRSignal2D.d.ts +19 -0
- package/lib/types/NMRSignal2D.js +3 -0
- package/lib/types/NMRSignal2D.js.map +1 -0
- package/lib/types/NMRZone.d.ts +11 -0
- package/lib/types/NMRZone.js +3 -0
- package/lib/types/NMRZone.js.map +1 -0
- package/lib/types/XYNumberArray.d.ts +4 -0
- package/lib/types/XYNumberArray.js +3 -0
- package/lib/types/XYNumberArray.js.map +1 -0
- package/lib/types/dataStructure.d.ts +4 -0
- package/lib/types/dataStructure.js +3 -0
- package/lib/types/dataStructure.js.map +1 -0
- package/lib/types/jcoupling.d.ts +8 -0
- package/lib/types/jcoupling.js +3 -0
- package/lib/types/jcoupling.js.map +1 -0
- package/lib/types/nmrAssigment.d.ts +28 -0
- package/lib/types/nmrAssigment.js +3 -0
- package/lib/types/nmrAssigment.js.map +1 -0
- package/lib/types/prediction1D.d.ts +12 -0
- package/lib/types/prediction1D.js +3 -0
- package/lib/types/prediction1D.js.map +1 -0
- package/{src → lib}/types/prediction2D.d.ts +0 -0
- package/lib/types/prediction2D.js +2 -0
- package/lib/types/prediction2D.js.map +1 -0
- package/lib/types/spinSystem.d.ts +8 -0
- package/lib/types/spinSystem.js +3 -0
- package/lib/types/spinSystem.js.map +1 -0
- package/lib/xy/xyAutoRangesPicking.d.ts +1 -1
- package/lib-esm/peaks/peaksToRanges.js.map +1 -1
- package/lib-esm/prediction/predictCarbon.js +5 -5
- package/lib-esm/prediction/predictCarbon.js.map +1 -1
- package/lib-esm/prediction/predictProton.js +2 -2
- package/lib-esm/prediction/predictProton.js.map +1 -1
- package/lib-esm/prediction/utils/predict2D.js +6 -6
- package/lib-esm/prediction/utils/predict2D.js.map +1 -1
- package/lib-esm/prediction/utils/queryByHOSE.js +1 -1
- package/lib-esm/prediction/utils/queryByHOSE.js.map +1 -1
- package/lib-esm/signal/signalJoinCouplings.js +5 -5
- package/lib-esm/signal/signalJoinCouplings.js.map +1 -1
- package/lib-esm/signals/hackSignalsToXY.js +7 -7
- package/lib-esm/signals/hackSignalsToXY.js.map +1 -1
- package/lib-esm/signals/signals2DToZ.js.map +1 -1
- package/lib-esm/signals/signalsJoin.js +1 -1
- package/lib-esm/signals/signalsJoin.js.map +1 -1
- package/lib-esm/signals/signalsToXY.js +4 -4
- package/lib-esm/signals/signalsToXY.js.map +1 -1
- package/lib-esm/signals/simulation/signalsToSpinSystem.js +8 -8
- package/lib-esm/signals/simulation/signalsToSpinSystem.js.map +1 -1
- package/lib-esm/types/MPFPeak.js +2 -0
- package/lib-esm/types/MPFPeak.js.map +1 -0
- package/lib-esm/types/MakeMandatory.js +2 -0
- package/lib-esm/types/MakeMandatory.js.map +1 -0
- package/lib-esm/types/NMRPeak1D.js +2 -0
- package/lib-esm/types/NMRPeak1D.js.map +1 -0
- package/lib-esm/types/NMRRange.js +2 -0
- package/lib-esm/types/NMRRange.js.map +1 -0
- package/lib-esm/types/NMRSignal1D.js +2 -0
- package/lib-esm/types/NMRSignal1D.js.map +1 -0
- package/lib-esm/types/NMRSignal2D.js +2 -0
- package/lib-esm/types/NMRSignal2D.js.map +1 -0
- package/lib-esm/types/NMRZone.js +2 -0
- package/lib-esm/types/NMRZone.js.map +1 -0
- package/lib-esm/types/XYNumberArray.js +2 -0
- package/lib-esm/types/XYNumberArray.js.map +1 -0
- package/lib-esm/types/dataStructure.js +2 -0
- package/lib-esm/types/dataStructure.js.map +1 -0
- package/lib-esm/types/jcoupling.js +2 -0
- package/lib-esm/types/jcoupling.js.map +1 -0
- package/lib-esm/types/nmrAssigment.js +2 -0
- package/lib-esm/types/nmrAssigment.js.map +1 -0
- package/lib-esm/types/prediction1D.js +2 -0
- package/lib-esm/types/prediction1D.js.map +1 -0
- package/lib-esm/types/prediction2D.js +2 -0
- package/lib-esm/types/prediction2D.js.map +1 -0
- package/lib-esm/types/spinSystem.js +2 -0
- package/lib-esm/types/spinSystem.js.map +1 -0
- package/package.json +5 -6
- package/src/databases/DatabaseNMREntry.ts +1 -1
- package/src/index.ts +13 -0
- package/src/peaks/peaksToRanges.ts +3 -4
- package/src/peaks/util/determineRealTop.ts +1 -1
- package/src/peaks/util/jAnalyzer.ts +2 -2
- package/src/prediction/predictCOSY.ts +1 -1
- package/src/prediction/predictCarbon.ts +8 -8
- package/src/prediction/predictHMBC.ts +1 -1
- package/src/prediction/predictHSQC.ts +1 -1
- package/src/prediction/predictProton.ts +2 -2
- package/src/prediction/utils/predict2D.ts +12 -10
- package/src/prediction/utils/queryByHOSE.ts +2 -2
- package/src/ranges/rangesToACS.ts +1 -1
- package/src/ranges/rangesToXY.ts +2 -2
- package/src/signal/signalJoinCouplings.ts +6 -6
- package/src/signals/hackSignalsToXY.ts +8 -8
- package/src/signals/signals2DToZ.ts +0 -1
- package/src/signals/signalsJoin.ts +1 -1
- package/src/signals/signalsToRanges.ts +1 -1
- package/src/signals/signalsToXY.ts +7 -7
- package/src/signals/simulation/signalsToSpinSystem.ts +10 -10
- package/src/signals/simulation/simulate1D.ts +3 -3
- package/src/types/{MPFPeak.d.ts → MPFPeak.ts} +0 -0
- package/src/types/{MakeMandatory.d.ts → MakeMandatory.ts} +0 -0
- package/src/types/{NMRPeak1D.d.ts → NMRPeak1D.ts} +0 -0
- package/src/types/{NMRRange.d.ts → NMRRange.ts} +0 -0
- package/src/types/{NMRSignal1D.d.ts → NMRSignal1D.ts} +4 -4
- package/src/types/{NMRSignal2D.d.ts → NMRSignal2D.ts} +2 -1
- package/src/types/{NMRZone.d.ts → NMRZone.ts} +1 -1
- package/src/types/{XYNumberArray.d.ts → XYNumberArray.ts} +0 -0
- package/src/types/{dataStructure.d.ts → dataStructure.ts} +0 -0
- package/src/types/{jcoupling.d.ts → jcoupling.ts} +1 -1
- package/src/types/{nmrAssigment.d.ts → nmrAssigment.ts} +1 -1
- package/src/types/openchemlib-utils/{index.d.ts → index..d.ts} +0 -0
- package/src/types/{prediction1D.d.ts → prediction1D.ts} +0 -0
- package/src/types/prediction2D.ts +0 -0
- package/src/types/{spinSystem.d.ts → spinSystem.ts} +0 -0
- package/src/xyz/xyzAutoPeaksPicking.ts +1 -1
- package/src/xyz/xyzJResAnalyzer.ts +2 -2
- package/src/types/jest.d.ts +0 -15
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { signalJoinCouplings } from '../signal/signalJoinCouplings';
|
|
2
2
|
import { signalMultiplicityPattern } from '../signal/signalMultiplicityPattern';
|
|
3
3
|
import type { NMRRange } from '../types/NMRRange';
|
|
4
|
-
import { NMRSignal1D } from '../types/NMRSignal1D';
|
|
4
|
+
import type { NMRSignal1D } from '../types/NMRSignal1D';
|
|
5
5
|
|
|
6
6
|
const globalOptions = {
|
|
7
7
|
h: {
|
package/src/ranges/rangesToXY.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DoubleArray } from 'cheminfo-types';
|
|
2
2
|
import arraySequentialFill from 'ml-array-sequential-fill';
|
|
3
3
|
import { SpectrumGenerator } from 'spectrum-generator';
|
|
4
|
-
import type {
|
|
4
|
+
import type { Shape1DOptions } from 'spectrum-generator';
|
|
5
5
|
|
|
6
6
|
import { hackSignalsToXY } from '../signals/hackSignalsToXY';
|
|
7
7
|
import type { MakeMandatory } from '../types/MakeMandatory';
|
|
@@ -41,7 +41,7 @@ export interface RangeToXYOptions {
|
|
|
41
41
|
* options of signals.
|
|
42
42
|
* @default { kind: 'gaussian' }
|
|
43
43
|
*/
|
|
44
|
-
shape:
|
|
44
|
+
shape: Shape1DOptions;
|
|
45
45
|
}
|
|
46
46
|
function checkForSignals(
|
|
47
47
|
ranges: NMRRange[],
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import sum from 'ml-array-sum';
|
|
2
2
|
|
|
3
3
|
import type { MakeMandatory } from '../types/MakeMandatory';
|
|
4
|
-
import { NMRSignal1D } from '../types/NMRSignal1D';
|
|
5
|
-
import { Jcoupling } from '../types/jcoupling';
|
|
4
|
+
import type { NMRSignal1D } from '../types/NMRSignal1D';
|
|
5
|
+
import type { Jcoupling } from '../types/jcoupling';
|
|
6
6
|
import { joinPatterns } from '../utilities/joinPatterns';
|
|
7
7
|
|
|
8
8
|
export interface SignalJoinCouplingsOptions {
|
|
@@ -89,10 +89,10 @@ function groupJCouplings(
|
|
|
89
89
|
signal.js = [];
|
|
90
90
|
for (let group of groups) {
|
|
91
91
|
let coupling = sum(group.map((group) => group.coupling)) / group.length;
|
|
92
|
-
let
|
|
92
|
+
let atoms = distinctValues(
|
|
93
93
|
group
|
|
94
|
-
.filter((group) => group.
|
|
95
|
-
.map((group) => group.
|
|
94
|
+
.filter((group) => group.atoms)
|
|
95
|
+
.map((group) => group.atoms)
|
|
96
96
|
.flat() as number[],
|
|
97
97
|
) as number[];
|
|
98
98
|
|
|
@@ -128,7 +128,7 @@ function groupJCouplings(
|
|
|
128
128
|
if (diaIDs.length === 1) newJ.diaIDs = diaIDs;
|
|
129
129
|
if (distances.length === 1 && distances[0]) newJ.distance = distances[0];
|
|
130
130
|
if (assignment.length > 0) newJ.assignment = assignment;
|
|
131
|
-
if (
|
|
131
|
+
if (atoms.length > 0) newJ.atoms = atoms;
|
|
132
132
|
signal.js.push(newJ);
|
|
133
133
|
}
|
|
134
134
|
return signal;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { couplingPatterns } from '../constants/couplingPatterns';
|
|
2
2
|
import type { NMRSignal1D } from '../types/NMRSignal1D';
|
|
3
|
-
import { Jcoupling } from '../types/jcoupling';
|
|
3
|
+
import type { Jcoupling } from '../types/jcoupling';
|
|
4
4
|
|
|
5
5
|
import { OptionsSignalsToXY, signalsToXY } from './signalsToXY';
|
|
6
6
|
|
|
@@ -16,7 +16,7 @@ export function hackSignalsToXY(
|
|
|
16
16
|
let newSignals = JSON.parse(JSON.stringify(signals));
|
|
17
17
|
|
|
18
18
|
signals.forEach((signal, s) => {
|
|
19
|
-
const { js: jCouplings = [],
|
|
19
|
+
const { js: jCouplings = [], atoms: signalAssignment = [s] } = signal;
|
|
20
20
|
|
|
21
21
|
let { newCouplings, tempSignals } = checkCouplings(
|
|
22
22
|
jCouplings,
|
|
@@ -27,7 +27,7 @@ export function hackSignalsToXY(
|
|
|
27
27
|
if (tempSignals.length > 0) newSignals.push(...tempSignals);
|
|
28
28
|
|
|
29
29
|
newSignals[s].js = newCouplings;
|
|
30
|
-
newSignals[s].
|
|
30
|
+
newSignals[s].atoms = signalAssignment;
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
return signalsToXY(newSignals, options);
|
|
@@ -42,8 +42,8 @@ function checkCouplings(
|
|
|
42
42
|
let tempSignals: NMRSignal1D[] = [];
|
|
43
43
|
const newCouplings = jCouplings.reduce<Jcoupling[]>(
|
|
44
44
|
(newCouplings, jCoupling) => {
|
|
45
|
-
const {
|
|
46
|
-
if (
|
|
45
|
+
const { atoms = [], multiplicity, coupling } = jCoupling;
|
|
46
|
+
if (atoms.length === 0) {
|
|
47
47
|
if (coupling && multiplicity) {
|
|
48
48
|
let tempCouplings: Jcoupling[] = [];
|
|
49
49
|
const nbLinks = couplingPatterns.indexOf(multiplicity);
|
|
@@ -51,7 +51,7 @@ function checkCouplings(
|
|
|
51
51
|
newSignalAssignment++;
|
|
52
52
|
tempCouplings.push({
|
|
53
53
|
coupling,
|
|
54
|
-
|
|
54
|
+
atoms: [newSignalAssignment],
|
|
55
55
|
});
|
|
56
56
|
tempSignals.push(
|
|
57
57
|
formatSignal(coupling, [newSignalAssignment], signalAssignment),
|
|
@@ -75,11 +75,11 @@ function formatSignal(
|
|
|
75
75
|
) {
|
|
76
76
|
return {
|
|
77
77
|
delta: 100000,
|
|
78
|
-
|
|
78
|
+
atoms: newSignalAssignment,
|
|
79
79
|
js: [
|
|
80
80
|
{
|
|
81
81
|
coupling,
|
|
82
|
-
|
|
82
|
+
atoms: signalAssignment,
|
|
83
83
|
},
|
|
84
84
|
],
|
|
85
85
|
};
|
|
@@ -95,7 +95,7 @@ export function signalsJoin(
|
|
|
95
95
|
nbAtoms: sum(group.map((item) => item.nbAtoms || 0)),
|
|
96
96
|
delta: mean(group.map((item) => item.delta)),
|
|
97
97
|
diaIDs: group[0].diaIDs,
|
|
98
|
-
|
|
98
|
+
atoms: group.map((item) => item.atoms || []).flat(),
|
|
99
99
|
js,
|
|
100
100
|
};
|
|
101
101
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MakeMandatory } from '../types/MakeMandatory';
|
|
1
|
+
import type { MakeMandatory } from '../types/MakeMandatory';
|
|
2
2
|
import type { NMRRange } from '../types/NMRRange';
|
|
3
3
|
import type { NMRSignal1D } from '../types/NMRSignal1D';
|
|
4
4
|
import { rangeFromSignal } from '../utilities/rangeFromSignal';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import rescale from 'ml-array-rescale';
|
|
2
2
|
import arraySequentialFill from 'ml-array-sequential-fill';
|
|
3
|
-
import type {
|
|
3
|
+
import type { Shape1DOptions } from 'spectrum-generator';
|
|
4
4
|
|
|
5
|
-
import { MakeMandatory } from '../types/MakeMandatory';
|
|
5
|
+
import type { MakeMandatory } from '../types/MakeMandatory';
|
|
6
6
|
import type { NMRSignal1D } from '../types/NMRSignal1D';
|
|
7
|
-
import { Jcoupling } from '../types/jcoupling';
|
|
7
|
+
import type { Jcoupling } from '../types/jcoupling';
|
|
8
8
|
|
|
9
9
|
import { signalsToSpinSystem } from './simulation/signalsToSpinSystem';
|
|
10
10
|
import simulate1D from './simulation/simulate1D';
|
|
@@ -25,7 +25,7 @@ export interface OptionsSignalsToXY {
|
|
|
25
25
|
/**
|
|
26
26
|
* Shape options for ml-spectrum-generator
|
|
27
27
|
*/
|
|
28
|
-
shape?:
|
|
28
|
+
shape?: Shape1DOptions;
|
|
29
29
|
/**
|
|
30
30
|
* The linewidth of the output spectrum, expresed in Hz.
|
|
31
31
|
* @default 1
|
|
@@ -49,7 +49,7 @@ export interface OptionsSignalsToXY {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
type JcouplingFromPrediction = MakeMandatory<Jcoupling, 'distance'>;
|
|
52
|
-
type Signal1DWidthAtomsIDsAndDiaID = MakeMandatory<NMRSignal1D, '
|
|
52
|
+
type Signal1DWidthAtomsIDsAndDiaID = MakeMandatory<NMRSignal1D, 'atoms'>;
|
|
53
53
|
type Signal1DWidthJsAndDiaID = Omit<Signal1DWidthAtomsIDsAndDiaID, 'js'> & {
|
|
54
54
|
js: JcouplingFromPrediction[];
|
|
55
55
|
};
|
|
@@ -60,10 +60,10 @@ function checkForMandatory(
|
|
|
60
60
|
for (const signal of signals) {
|
|
61
61
|
if (!signal.js) throw new Error('There is not js');
|
|
62
62
|
// if (!signal.diaID) throw new Error('There is not diaID');
|
|
63
|
-
if (!signal.
|
|
63
|
+
if (!signal.atoms) throw new Error('There is not atoms');
|
|
64
64
|
for (const j of signal.js) {
|
|
65
65
|
// if (!j.diaID) throw new Error('There is not diaID');
|
|
66
|
-
if (!j.
|
|
66
|
+
if (!j.atoms) throw new Error('There is not atoms');
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { Matrix } from 'ml-matrix';
|
|
2
2
|
import simpleClustering from 'ml-simple-clustering';
|
|
3
3
|
|
|
4
|
-
import { MakeMandatory } from '../../types/MakeMandatory';
|
|
4
|
+
import type { MakeMandatory } from '../../types/MakeMandatory';
|
|
5
5
|
import type { NMRSignal1D } from '../../types/NMRSignal1D';
|
|
6
|
-
import { Jcoupling } from '../../types/jcoupling';
|
|
6
|
+
import type { Jcoupling } from '../../types/jcoupling';
|
|
7
7
|
import type { SpinSystem } from '../../types/spinSystem';
|
|
8
8
|
|
|
9
9
|
interface Ids {
|
|
10
10
|
[index: number]: number;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
type JcouplingFromPrediction = MakeMandatory<Jcoupling, '
|
|
14
|
-
type Signal1DWidthAtomIDs = MakeMandatory<NMRSignal1D, '
|
|
13
|
+
type JcouplingFromPrediction = MakeMandatory<Jcoupling, 'atoms'>;
|
|
14
|
+
type Signal1DWidthAtomIDs = MakeMandatory<NMRSignal1D, 'atoms'>;
|
|
15
15
|
type Signal1DFromPrediction = Omit<Signal1DWidthAtomIDs, 'js'> & {
|
|
16
16
|
js: JcouplingFromPrediction[];
|
|
17
17
|
};
|
|
@@ -21,9 +21,9 @@ function checkForMandatory(
|
|
|
21
21
|
): asserts signals is Signal1DFromPrediction[] {
|
|
22
22
|
for (const signal of signals) {
|
|
23
23
|
if (!signal.js) throw new Error('there is not js');
|
|
24
|
-
if (!signal.
|
|
24
|
+
if (!signal.atoms) throw new Error('there is not atoms');
|
|
25
25
|
for (const jcoupling of signal.js) {
|
|
26
|
-
if (!jcoupling.
|
|
26
|
+
if (!jcoupling.atoms) throw new Error('there is not atoms');
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -39,16 +39,16 @@ export function signalsToSpinSystem(signals: NMRSignal1D[]): SpinSystem {
|
|
|
39
39
|
for (let i = 0; i < nSpins; i++) {
|
|
40
40
|
multiplicity[i] = 2;
|
|
41
41
|
chemicalShifts[i] = signals[i].delta;
|
|
42
|
-
const index = signals[i].
|
|
42
|
+
const index = signals[i].atoms[0];
|
|
43
43
|
ids[index] = i;
|
|
44
44
|
}
|
|
45
45
|
//create the coupling matrix
|
|
46
46
|
for (let i = 0; i < nSpins; i++) {
|
|
47
|
-
let {
|
|
47
|
+
let { atoms: signalAssignment, js: jCoupling } = signals[i];
|
|
48
48
|
const fromIndex = signalAssignment[0];
|
|
49
49
|
for (const jcoupling of jCoupling) {
|
|
50
|
-
let { coupling,
|
|
51
|
-
const toIndex =
|
|
50
|
+
let { coupling, atoms } = jcoupling;
|
|
51
|
+
const toIndex = atoms[0];
|
|
52
52
|
couplingConstants.set(ids[fromIndex], ids[toIndex], coupling);
|
|
53
53
|
couplingConstants.set(ids[toIndex], ids[fromIndex], coupling);
|
|
54
54
|
}
|
|
@@ -3,9 +3,9 @@ import { Matrix, EVD } from 'ml-matrix';
|
|
|
3
3
|
import type { Matrix as MatrixClassType } from 'ml-matrix';
|
|
4
4
|
import { SparseMatrix } from 'ml-sparse-matrix';
|
|
5
5
|
import { SpectrumGenerator } from 'spectrum-generator';
|
|
6
|
-
import type {
|
|
6
|
+
import type { Shape1DOptions } from 'spectrum-generator';
|
|
7
7
|
|
|
8
|
-
import { SpinSystem } from '../../types/spinSystem';
|
|
8
|
+
import type { SpinSystem } from '../../types/spinSystem';
|
|
9
9
|
|
|
10
10
|
import getPauliMatrix from './getPauliMatrix';
|
|
11
11
|
|
|
@@ -46,7 +46,7 @@ interface Simulate1DOptions {
|
|
|
46
46
|
* Shape options
|
|
47
47
|
* @default {kind:'gaussian'}
|
|
48
48
|
*/
|
|
49
|
-
shape?:
|
|
49
|
+
shape?: Shape1DOptions;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
/**
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
import type { NMRPeak1D } from './NMRPeak1D';
|
|
1
2
|
import type { Jcoupling } from './jcoupling';
|
|
2
|
-
import { GSDPeak } from './ml-gsd/index.d';
|
|
3
3
|
|
|
4
|
-
interface NMRSignal1D {
|
|
4
|
+
export interface NMRSignal1D {
|
|
5
5
|
delta: number;
|
|
6
6
|
js?: Jcoupling[];
|
|
7
|
-
|
|
7
|
+
atoms?: number[];
|
|
8
8
|
assignment?: string;
|
|
9
9
|
kind?: string;
|
|
10
10
|
multiplicity?: string;
|
|
11
11
|
diaIDs?: string[];
|
|
12
12
|
nbAtoms?: number;
|
|
13
13
|
integration?: number;
|
|
14
|
-
peaks?:
|
|
14
|
+
peaks?: NMRPeak1D[];
|
|
15
15
|
statistic?: {
|
|
16
16
|
mean: number;
|
|
17
17
|
sd: number;
|
|
@@ -4,7 +4,7 @@ export interface Signal2DAxisData {
|
|
|
4
4
|
nucleus?: string;
|
|
5
5
|
delta: number;
|
|
6
6
|
resolution?: number;
|
|
7
|
-
|
|
7
|
+
atoms?: number[];
|
|
8
8
|
diaIDs?: string[];
|
|
9
9
|
fromTo?: {
|
|
10
10
|
from: number;
|
|
@@ -15,5 +15,6 @@ export interface NMRSignal2D {
|
|
|
15
15
|
x: Signal2DAxisData;
|
|
16
16
|
y: Signal2DAxisData;
|
|
17
17
|
peaks?: MPFPeak[];
|
|
18
|
+
kind?: string;
|
|
18
19
|
_highlight?: (number | string)[];
|
|
19
20
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -7,7 +7,7 @@ import { determineRealTop } from '../peaks/util/determineRealTop';
|
|
|
7
7
|
import { getKernel } from '../peaks/util/getKernel';
|
|
8
8
|
import type { GetKernelOptions } from '../peaks/util/getKernel';
|
|
9
9
|
import * as PeakOptimizer from '../peaks/util/peakOptimizer';
|
|
10
|
-
import { MPFPeak } from '../types/MPFPeak';
|
|
10
|
+
import type { MPFPeak } from '../types/MPFPeak';
|
|
11
11
|
import type { NMRSignal2D } from '../types/NMRSignal2D';
|
|
12
12
|
|
|
13
13
|
const smallFilter = [
|
|
@@ -2,8 +2,8 @@ import simpleClustering from 'ml-simple-clustering';
|
|
|
2
2
|
|
|
3
3
|
import type { JAxisKeys } from '../peaks/util/jAnalyzer';
|
|
4
4
|
import jAnalyzer from '../peaks/util/jAnalyzer';
|
|
5
|
-
import { MPFPeak } from '../types/MPFPeak';
|
|
6
|
-
import { MakeMandatory } from '../types/MakeMandatory';
|
|
5
|
+
import type { MPFPeak } from '../types/MPFPeak';
|
|
6
|
+
import type { MakeMandatory } from '../types/MakeMandatory';
|
|
7
7
|
import type { NMRSignal2D } from '../types/NMRSignal2D';
|
|
8
8
|
|
|
9
9
|
interface CompilePatternOptions {
|
package/src/types/jest.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
declare namespace jest {
|
|
2
|
-
type Iterable =
|
|
3
|
-
| number
|
|
4
|
-
| Iterable[]
|
|
5
|
-
| { [k: string]: Iterable }
|
|
6
|
-
| string
|
|
7
|
-
| null
|
|
8
|
-
| undefined
|
|
9
|
-
| boolean;
|
|
10
|
-
|
|
11
|
-
interface Matchers<R> {
|
|
12
|
-
toBeDeepCloseTo: (expected: Iterable, decimals?: number) => R;
|
|
13
|
-
toMatchCloseTo: (expected: Iterable, decimals?: number) => R;
|
|
14
|
-
}
|
|
15
|
-
}
|