nmr-processing 9.3.1 → 9.3.3
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/get13CAssignments.js.map +1 -1
- package/lib/assignment/get1HAssignments.js.map +1 -1
- package/lib/assignment/getAssignments.js.map +1 -1
- package/lib/assignment/utils/getAssignment/buildAssignments.js.map +1 -1
- package/lib/prediction/predictAll.js +3 -1
- package/lib/prediction/predictAll.js.map +1 -1
- package/lib/prediction/predictAllSpectra.js +2 -2
- package/lib/prediction/predictAllSpectra.js.map +1 -1
- package/lib/prediction/predictCarbon.d.ts +4 -0
- package/lib/prediction/predictCarbon.js +5 -4
- package/lib/prediction/predictCarbon.js.map +1 -1
- package/lib/prediction/predictProton.d.ts +4 -0
- package/lib/prediction/predictProton.js +1 -1
- package/lib/prediction/predictProton.js.map +1 -1
- package/lib/prediction/utils/getFilteredIDiaIDs.d.ts +2 -3
- package/lib/prediction/utils/getFilteredIDiaIDs.js +5 -6
- package/lib/prediction/utils/getFilteredIDiaIDs.js.map +1 -1
- package/lib/prediction/utils/predict2D.d.ts +4 -0
- package/lib/prediction/utils/predict2D.js +5 -3
- package/lib/prediction/utils/predict2D.js.map +1 -1
- package/lib/ranges/rangesToACS.js +14 -12
- package/lib/ranges/rangesToACS.js.map +1 -1
- package/lib/signal/signalMultiplicityPattern.js +1 -1
- package/lib/signal/signalMultiplicityPattern.js.map +1 -1
- package/lib-esm/assignment/get13CAssignments.js.map +1 -1
- package/lib-esm/assignment/get1HAssignments.js.map +1 -1
- package/lib-esm/assignment/getAssignments.js.map +1 -1
- package/lib-esm/assignment/utils/getAssignment/buildAssignments.js.map +1 -1
- package/lib-esm/prediction/predictAll.js +3 -1
- package/lib-esm/prediction/predictAll.js.map +1 -1
- package/lib-esm/prediction/predictAllSpectra.js +2 -2
- package/lib-esm/prediction/predictAllSpectra.js.map +1 -1
- package/lib-esm/prediction/predictCarbon.js +5 -4
- package/lib-esm/prediction/predictCarbon.js.map +1 -1
- package/lib-esm/prediction/predictProton.js +1 -1
- package/lib-esm/prediction/predictProton.js.map +1 -1
- package/lib-esm/prediction/utils/getFilteredIDiaIDs.js +6 -7
- package/lib-esm/prediction/utils/getFilteredIDiaIDs.js.map +1 -1
- package/lib-esm/prediction/utils/predict2D.js +6 -4
- package/lib-esm/prediction/utils/predict2D.js.map +1 -1
- package/lib-esm/ranges/rangesToACS.js +14 -12
- package/lib-esm/ranges/rangesToACS.js.map +1 -1
- package/lib-esm/signal/signalMultiplicityPattern.js +1 -1
- package/lib-esm/signal/signalMultiplicityPattern.js.map +1 -1
- package/package.json +3 -2
- package/src/assignment/get13CAssignments.ts +1 -1
- package/src/assignment/get1HAssignments.ts +1 -1
- package/src/assignment/getAssignments.ts +1 -1
- package/src/assignment/utils/getAssignment/buildAssignments.ts +1 -1
- package/src/openchemlib-utils.d.ts +9 -0
- package/src/prediction/predictAll.ts +4 -1
- package/src/prediction/predictAllSpectra.ts +2 -2
- package/src/prediction/predictCarbon.ts +16 -9
- package/src/prediction/predictProton.ts +6 -2
- package/src/prediction/utils/getFilteredIDiaIDs.ts +13 -14
- package/src/prediction/utils/predict2D.ts +14 -6
- package/src/ranges/rangesToACS.ts +19 -11
- package/src/signal/signalMultiplicityPattern.ts +1 -1
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { v4 as generateID } from '@lukeed/uuid';
|
|
2
2
|
import { agnes, Cluster } from 'ml-hclust';
|
|
3
3
|
import { Matrix } from 'ml-matrix';
|
|
4
|
-
import { Molecule } from 'openchemlib/full';
|
|
5
4
|
import {
|
|
6
5
|
getGroupedDiastereotopicAtomIDs,
|
|
7
6
|
getPathsInfo,
|
|
7
|
+
groupDiastereotopicAtomIDs,
|
|
8
8
|
} from 'openchemlib-utils';
|
|
9
9
|
import type {
|
|
10
10
|
AtomInfo,
|
|
11
11
|
GroupDiastereotopicAtomIDs,
|
|
12
12
|
PathInfo,
|
|
13
13
|
} from 'openchemlib-utils';
|
|
14
|
+
import { Molecule } from 'openchemlib/full';
|
|
14
15
|
|
|
15
16
|
import { setIDs } from '../../peaks/util/setIDs';
|
|
16
17
|
import type { NMRSignal1D } from '../../signals/NMRSignal1D';
|
|
@@ -86,6 +87,10 @@ export interface Predict2DOptions {
|
|
|
86
87
|
* @default false
|
|
87
88
|
*/
|
|
88
89
|
includeDiagonal?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* diastereotopic atom ids of the molecule.
|
|
92
|
+
*/
|
|
93
|
+
diaIDs?: string[];
|
|
89
94
|
}
|
|
90
95
|
|
|
91
96
|
export interface PredictOptions {
|
|
@@ -125,9 +130,12 @@ export async function predict2D(
|
|
|
125
130
|
) {
|
|
126
131
|
checkFromTo(options);
|
|
127
132
|
|
|
133
|
+
molecule.addImplicitHydrogens();
|
|
134
|
+
|
|
128
135
|
let {
|
|
129
136
|
from,
|
|
130
137
|
to,
|
|
138
|
+
diaIDs,
|
|
131
139
|
minLength = 0,
|
|
132
140
|
maxLength,
|
|
133
141
|
predictOptions = {},
|
|
@@ -137,10 +145,6 @@ export async function predict2D(
|
|
|
137
145
|
includeDiagonal = false,
|
|
138
146
|
} = options;
|
|
139
147
|
|
|
140
|
-
molecule.addImplicitHydrogens();
|
|
141
|
-
|
|
142
|
-
let diaIDs = getGroupedDiastereotopicAtomIDs(molecule);
|
|
143
|
-
|
|
144
148
|
const pathsInfo = getPathsInfo(molecule, {
|
|
145
149
|
fromLabel: from,
|
|
146
150
|
toLabel: to,
|
|
@@ -148,8 +152,12 @@ export async function predict2D(
|
|
|
148
152
|
maxLength,
|
|
149
153
|
});
|
|
150
154
|
|
|
155
|
+
const groupedDiaIDS = diaIDs
|
|
156
|
+
? groupDiastereotopicAtomIDs(diaIDs, molecule)
|
|
157
|
+
: getGroupedDiastereotopicAtomIDs(molecule);
|
|
158
|
+
|
|
151
159
|
let diaIDswithAtomInfo: GroupDiastereotopicAtomIDsWithAtomInfo[] = [];
|
|
152
|
-
for (let diaID of
|
|
160
|
+
for (let diaID of groupedDiaIDS) {
|
|
153
161
|
diaIDswithAtomInfo.push({
|
|
154
162
|
...diaID,
|
|
155
163
|
pathInfo: JSON.parse(
|
|
@@ -149,18 +149,26 @@ function pushDelta(range: NMRRange, acsRanges: string[], options: any) {
|
|
|
149
149
|
options.nbDecimalDelta,
|
|
150
150
|
)}-${Math.max(...fromTo).toFixed(options.nbDecimalDelta)}`;
|
|
151
151
|
strings += ` (${getIntegral(range, options)}`;
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
152
|
+
|
|
153
|
+
if (
|
|
154
|
+
signals.some(
|
|
155
|
+
(signal) =>
|
|
156
|
+
signal.multiplicity || (signal.js && signal.js.length > 0),
|
|
157
|
+
)
|
|
158
|
+
) {
|
|
159
|
+
for (let signal of signals) {
|
|
160
|
+
parenthesis = [];
|
|
161
|
+
if (signal.delta !== undefined) {
|
|
162
|
+
strings = appendSeparator(strings);
|
|
163
|
+
strings += signal.delta.toFixed(options.nbDecimalDelta);
|
|
164
|
+
}
|
|
165
|
+
const range: NMRRange = {
|
|
166
|
+
from: Number.MIN_SAFE_INTEGER,
|
|
167
|
+
to: Number.MAX_SAFE_INTEGER,
|
|
168
|
+
};
|
|
169
|
+
switchFormat(range, signal, parenthesis, options);
|
|
170
|
+
if (parenthesis.length > 0) strings += ` (${parenthesis.join(', ')})`;
|
|
157
171
|
}
|
|
158
|
-
const range: NMRRange = {
|
|
159
|
-
from: Number.MIN_SAFE_INTEGER,
|
|
160
|
-
to: Number.MAX_SAFE_INTEGER,
|
|
161
|
-
};
|
|
162
|
-
switchFormat(range, signal, parenthesis, options);
|
|
163
|
-
if (parenthesis.length > 0) strings += ` (${parenthesis.join(', ')})`;
|
|
164
172
|
}
|
|
165
173
|
strings += ')';
|
|
166
174
|
} else {
|