nmr-processing 9.3.5 → 9.3.6
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.
|
@@ -6,9 +6,18 @@ function rangeFromSignal(signal, options) {
|
|
|
6
6
|
const { nucleus = '1h', frequency = 400 } = options;
|
|
7
7
|
const { tolerance = getTolerance(nucleus) / frequency } = options;
|
|
8
8
|
let halfWidth = 0;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
const { js: jCouplings = [], multiplicity } = signal;
|
|
10
|
+
if (jCouplings.length > 0) {
|
|
11
|
+
for (const js of jCouplings) {
|
|
12
|
+
const { coupling, multiplicity = 'd' } = js;
|
|
13
|
+
halfWidth += (couplingValues_1.couplingValues[multiplicity] * coupling) / frequency;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
else if (multiplicity === 'm') {
|
|
17
|
+
halfWidth = 16 / frequency;
|
|
18
|
+
}
|
|
19
|
+
else if (multiplicity === 'b' || multiplicity === 'br s') {
|
|
20
|
+
halfWidth = 7 / frequency;
|
|
12
21
|
}
|
|
13
22
|
halfWidth = tolerance + halfWidth / 2;
|
|
14
23
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rangeFromSignal.js","sourceRoot":"","sources":["../../src/utilities/rangeFromSignal.ts"],"names":[],"mappings":";;;AAAA,gEAA6D;AAoB7D,SAAgB,eAAe,CAC7B,MAAmB,EACnB,OAA+B;IAE/B,MAAM,EAAE,OAAO,GAAG,IAAI,EAAE,SAAS,GAAG,GAAG,EAAE,GAAG,OAAO,CAAC;IACpD,MAAM,EAAE,SAAS,GAAG,YAAY,CAAC,OAAO,CAAC,GAAG,SAAS,EAAE,GAAG,OAAO,CAAC;IAElE,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,
|
|
1
|
+
{"version":3,"file":"rangeFromSignal.js","sourceRoot":"","sources":["../../src/utilities/rangeFromSignal.ts"],"names":[],"mappings":";;;AAA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3,9 +3,18 @@ export function rangeFromSignal(signal, options) {
|
|
|
3
3
|
const { nucleus = '1h', frequency = 400 } = options;
|
|
4
4
|
const { tolerance = getTolerance(nucleus) / frequency } = options;
|
|
5
5
|
let halfWidth = 0;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
const { js: jCouplings = [], multiplicity } = signal;
|
|
7
|
+
if (jCouplings.length > 0) {
|
|
8
|
+
for (const js of jCouplings) {
|
|
9
|
+
const { coupling, multiplicity = 'd' } = js;
|
|
10
|
+
halfWidth += (couplingValues[multiplicity] * coupling) / frequency;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
else if (multiplicity === 'm') {
|
|
14
|
+
halfWidth = 16 / frequency;
|
|
15
|
+
}
|
|
16
|
+
else if (multiplicity === 'b' || multiplicity === 'br s') {
|
|
17
|
+
halfWidth = 7 / frequency;
|
|
9
18
|
}
|
|
10
19
|
halfWidth = tolerance + halfWidth / 2;
|
|
11
20
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rangeFromSignal.js","sourceRoot":"","sources":["../../src/utilities/rangeFromSignal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAoB7D,MAAM,UAAU,eAAe,CAC7B,MAAmB,EACnB,OAA+B;IAE/B,MAAM,EAAE,OAAO,GAAG,IAAI,EAAE,SAAS,GAAG,GAAG,EAAE,GAAG,OAAO,CAAC;IACpD,MAAM,EAAE,SAAS,GAAG,YAAY,CAAC,OAAO,CAAC,GAAG,SAAS,EAAE,GAAG,OAAO,CAAC;IAElE,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,
|
|
1
|
+
{"version":3,"file":"rangeFromSignal.js","sourceRoot":"","sources":["../../src/utilities/rangeFromSignal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAoB7D,MAAM,UAAU,eAAe,CAC7B,MAAmB,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mr-processing",
|
|
3
|
-
"version": "9.3.
|
|
3
|
+
"version": "9.3.6",
|
|
4
4
|
"description": "Pure functions allowing to process NMR spectra.",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"module": "./lib-esm/index.js",
|
|
@@ -41,15 +41,15 @@
|
|
|
41
41
|
"@types/jest": "^29.2.3",
|
|
42
42
|
"cheminfo-build": "^1.1.11",
|
|
43
43
|
"cheminfo-types": "^1.4.0",
|
|
44
|
-
"eslint": "^8.
|
|
44
|
+
"eslint": "^8.34.0",
|
|
45
45
|
"eslint-config-cheminfo-typescript": "^11.2.2",
|
|
46
46
|
"jest": "^29.3.1",
|
|
47
47
|
"jest-matcher-deep-close-to": "^3.0.2",
|
|
48
48
|
"md5": "^2.3.0",
|
|
49
49
|
"nmr-xy-testdata": "^0.5.1",
|
|
50
50
|
"openchemlib": "^8.0.1",
|
|
51
|
-
"prettier": "^2.8.
|
|
52
|
-
"rimraf": "^
|
|
51
|
+
"prettier": "^2.8.4",
|
|
52
|
+
"rimraf": "^4.1.2",
|
|
53
53
|
"ts-jest": "^29.0.3",
|
|
54
54
|
"typescript": "^4.9.3"
|
|
55
55
|
},
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"ml-peak-shape-generator": "^4.1.2",
|
|
75
75
|
"ml-simple-clustering": "^0.1.0",
|
|
76
76
|
"ml-sparse-matrix": "^2.1.0",
|
|
77
|
-
"ml-spectra-processing": "^11.
|
|
77
|
+
"ml-spectra-processing": "^11.17.0",
|
|
78
78
|
"ml-tree-set": "^0.1.1",
|
|
79
79
|
"nmr-correlation": "^2.3.3",
|
|
80
80
|
"nmredata": "^0.9.2",
|
|
@@ -26,12 +26,20 @@ export function rangeFromSignal(
|
|
|
26
26
|
const { tolerance = getTolerance(nucleus) / frequency } = options;
|
|
27
27
|
|
|
28
28
|
let halfWidth = 0;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
const { js: jCouplings = [], multiplicity } = signal;
|
|
30
|
+
if (jCouplings.length > 0) {
|
|
31
|
+
for (const js of jCouplings) {
|
|
32
|
+
const { coupling, multiplicity = 'd' } = js;
|
|
33
|
+
halfWidth += (couplingValues[multiplicity] * coupling) / frequency;
|
|
34
|
+
}
|
|
35
|
+
} else if (multiplicity === 'm') {
|
|
36
|
+
halfWidth = 16 / frequency;
|
|
37
|
+
} else if (multiplicity === 'b' || multiplicity === 'br s') {
|
|
38
|
+
halfWidth = 7 / frequency;
|
|
32
39
|
}
|
|
33
40
|
|
|
34
41
|
halfWidth = tolerance + halfWidth / 2;
|
|
42
|
+
|
|
35
43
|
return {
|
|
36
44
|
from: signal.delta - halfWidth,
|
|
37
45
|
to: signal.delta + halfWidth,
|