jcampconverter 8.2.2 → 8.2.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.
Files changed (140) hide show
  1. package/lib/2d/add2D.d.ts +2 -0
  2. package/lib/2d/add2D.d.ts.map +1 -0
  3. package/lib/2d/add2D.js +17 -0
  4. package/lib/2d/add2D.js.map +1 -0
  5. package/lib/2d/convertTo3DZ.d.ts +11 -0
  6. package/lib/2d/convertTo3DZ.d.ts.map +1 -0
  7. package/lib/2d/convertTo3DZ.js +59 -0
  8. package/lib/2d/convertTo3DZ.js.map +1 -0
  9. package/lib/2d/generateContourLines.d.ts +8 -0
  10. package/lib/2d/generateContourLines.d.ts.map +1 -0
  11. package/lib/2d/generateContourLines.js +163 -0
  12. package/lib/2d/generateContourLines.js.map +1 -0
  13. package/lib/complexChromatogram.d.ts +4 -0
  14. package/lib/complexChromatogram.d.ts.map +1 -0
  15. package/lib/complexChromatogram.js +49 -0
  16. package/lib/complexChromatogram.js.map +1 -0
  17. package/lib/convert.d.ts +139 -0
  18. package/lib/convert.d.ts.map +1 -0
  19. package/lib/convert.js +383 -0
  20. package/lib/convert.js.map +1 -0
  21. package/lib/convertToFloatArray.d.ts +2 -0
  22. package/lib/convertToFloatArray.d.ts.map +1 -0
  23. package/lib/convertToFloatArray.js +11 -0
  24. package/lib/convertToFloatArray.js.map +1 -0
  25. package/lib/createTree.d.ts +29 -0
  26. package/lib/createTree.d.ts.map +1 -0
  27. package/lib/createTree.js +98 -0
  28. package/lib/createTree.js.map +1 -0
  29. package/lib/index.d.ts +3 -0
  30. package/lib/index.d.ts.map +1 -0
  31. package/lib/index.js +8 -1214
  32. package/lib/index.js.map +1 -0
  33. package/lib/parse/fastParseXYData.d.ts +2 -0
  34. package/lib/parse/fastParseXYData.d.ts.map +1 -0
  35. package/lib/parse/fastParseXYData.js +192 -0
  36. package/lib/parse/fastParseXYData.js.map +1 -0
  37. package/lib/parse/parsePeakTable.d.ts +2 -0
  38. package/lib/parse/parsePeakTable.d.ts.map +1 -0
  39. package/lib/parse/parsePeakTable.js +67 -0
  40. package/lib/parse/parsePeakTable.js.map +1 -0
  41. package/lib/parse/parseXYA.d.ts +2 -0
  42. package/lib/parse/parseXYA.d.ts.map +1 -0
  43. package/lib/parse/parseXYA.js +17 -0
  44. package/lib/parse/parseXYA.js.map +1 -0
  45. package/lib/postProcessing.d.ts +2 -0
  46. package/lib/postProcessing.d.ts.map +1 -0
  47. package/lib/postProcessing.js +50 -0
  48. package/lib/postProcessing.js.map +1 -0
  49. package/lib/postProcessingNMR.d.ts +2 -0
  50. package/lib/postProcessingNMR.d.ts.map +1 -0
  51. package/lib/postProcessingNMR.js +94 -0
  52. package/lib/postProcessingNMR.js.map +1 -0
  53. package/lib/prepareNtuplesDatatable.d.ts +2 -0
  54. package/lib/prepareNtuplesDatatable.d.ts.map +1 -0
  55. package/lib/prepareNtuplesDatatable.js +87 -0
  56. package/lib/prepareNtuplesDatatable.js.map +1 -0
  57. package/lib/prepareSpectrum.d.ts +2 -0
  58. package/lib/prepareSpectrum.d.ts.map +1 -0
  59. package/lib/prepareSpectrum.js +10 -0
  60. package/lib/prepareSpectrum.js.map +1 -0
  61. package/lib/profiling.d.ts +2 -0
  62. package/lib/profiling.d.ts.map +1 -0
  63. package/lib/profiling.js +12 -0
  64. package/lib/profiling.js.map +1 -0
  65. package/lib/simpleChromatogram.d.ts +2 -0
  66. package/lib/simpleChromatogram.d.ts.map +1 -0
  67. package/lib/simpleChromatogram.js +16 -0
  68. package/lib/simpleChromatogram.js.map +1 -0
  69. package/lib-esm/2d/add2D.d.ts +2 -0
  70. package/lib-esm/2d/add2D.d.ts.map +1 -0
  71. package/lib-esm/2d/add2D.js +11 -0
  72. package/lib-esm/2d/add2D.js.map +1 -0
  73. package/lib-esm/2d/convertTo3DZ.d.ts +11 -0
  74. package/lib-esm/2d/convertTo3DZ.d.ts.map +1 -0
  75. package/lib-esm/2d/convertTo3DZ.js +53 -0
  76. package/lib-esm/2d/convertTo3DZ.js.map +1 -0
  77. package/lib-esm/2d/generateContourLines.d.ts +8 -0
  78. package/lib-esm/2d/generateContourLines.d.ts.map +1 -0
  79. package/lib-esm/2d/generateContourLines.js +160 -0
  80. package/lib-esm/2d/generateContourLines.js.map +1 -0
  81. package/lib-esm/complexChromatogram.d.ts +4 -0
  82. package/lib-esm/complexChromatogram.d.ts.map +1 -0
  83. package/lib-esm/complexChromatogram.js +43 -0
  84. package/lib-esm/complexChromatogram.js.map +1 -0
  85. package/lib-esm/convert.d.ts +139 -0
  86. package/lib-esm/convert.d.ts.map +1 -0
  87. package/lib-esm/convert.js +376 -0
  88. package/lib-esm/convert.js.map +1 -0
  89. package/lib-esm/convertToFloatArray.d.ts +2 -0
  90. package/lib-esm/convertToFloatArray.d.ts.map +1 -0
  91. package/lib-esm/convertToFloatArray.js +8 -0
  92. package/lib-esm/convertToFloatArray.js.map +1 -0
  93. package/lib-esm/createTree.d.ts +29 -0
  94. package/lib-esm/createTree.d.ts.map +1 -0
  95. package/lib-esm/createTree.js +94 -0
  96. package/lib-esm/createTree.js.map +1 -0
  97. package/lib-esm/index.d.ts +3 -0
  98. package/lib-esm/index.d.ts.map +1 -0
  99. package/lib-esm/index.js +3 -0
  100. package/lib-esm/index.js.map +1 -0
  101. package/lib-esm/parse/fastParseXYData.d.ts +2 -0
  102. package/lib-esm/parse/fastParseXYData.d.ts.map +1 -0
  103. package/lib-esm/parse/fastParseXYData.js +189 -0
  104. package/lib-esm/parse/fastParseXYData.js.map +1 -0
  105. package/lib-esm/parse/parsePeakTable.d.ts +2 -0
  106. package/lib-esm/parse/parsePeakTable.d.ts.map +1 -0
  107. package/lib-esm/parse/parsePeakTable.js +64 -0
  108. package/lib-esm/parse/parsePeakTable.js.map +1 -0
  109. package/lib-esm/parse/parseXYA.d.ts +2 -0
  110. package/lib-esm/parse/parseXYA.d.ts.map +1 -0
  111. package/lib-esm/parse/parseXYA.js +14 -0
  112. package/lib-esm/parse/parseXYA.js.map +1 -0
  113. package/lib-esm/postProcessing.d.ts +2 -0
  114. package/lib-esm/postProcessing.d.ts.map +1 -0
  115. package/lib-esm/postProcessing.js +44 -0
  116. package/lib-esm/postProcessing.js.map +1 -0
  117. package/lib-esm/postProcessingNMR.d.ts +2 -0
  118. package/lib-esm/postProcessingNMR.d.ts.map +1 -0
  119. package/lib-esm/postProcessingNMR.js +91 -0
  120. package/lib-esm/postProcessingNMR.js.map +1 -0
  121. package/lib-esm/prepareNtuplesDatatable.d.ts +2 -0
  122. package/lib-esm/prepareNtuplesDatatable.d.ts.map +1 -0
  123. package/lib-esm/prepareNtuplesDatatable.js +84 -0
  124. package/lib-esm/prepareNtuplesDatatable.js.map +1 -0
  125. package/lib-esm/prepareSpectrum.d.ts +2 -0
  126. package/lib-esm/prepareSpectrum.d.ts.map +1 -0
  127. package/lib-esm/prepareSpectrum.js +7 -0
  128. package/lib-esm/prepareSpectrum.js.map +1 -0
  129. package/lib-esm/profiling.d.ts +2 -0
  130. package/lib-esm/profiling.d.ts.map +1 -0
  131. package/lib-esm/profiling.js +9 -0
  132. package/lib-esm/profiling.js.map +1 -0
  133. package/lib-esm/simpleChromatogram.d.ts +2 -0
  134. package/lib-esm/simpleChromatogram.d.ts.map +1 -0
  135. package/lib-esm/simpleChromatogram.js +13 -0
  136. package/lib-esm/simpleChromatogram.js.map +1 -0
  137. package/package.json +22 -17
  138. package/src/convert.js +57 -13
  139. package/src/createTree.js +16 -3
  140. package/CHANGELOG.md +0 -427
@@ -0,0 +1,2 @@
1
+ export default function add2D(result: any, options: any): void;
2
+ //# sourceMappingURL=add2D.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add2D.d.ts","sourceRoot":"","sources":["../../src/2d/add2D.js"],"names":[],"mappings":"AAGA,+DAOC"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const convertTo3DZ_1 = __importDefault(require("./convertTo3DZ"));
7
+ const generateContourLines_1 = __importDefault(require("./generateContourLines"));
8
+ function add2D(result, options) {
9
+ let zData = (0, convertTo3DZ_1.default)(result.spectra);
10
+ if (!options.noContour) {
11
+ result.contourLines = (0, generateContourLines_1.default)(zData, options);
12
+ delete zData.z;
13
+ }
14
+ result.minMax = zData;
15
+ }
16
+ exports.default = add2D;
17
+ //# sourceMappingURL=add2D.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add2D.js","sourceRoot":"","sources":["../../src/2d/add2D.js"],"names":[],"mappings":";;;;;AAAA,kEAA0C;AAC1C,kFAA0D;AAE1D,SAAwB,KAAK,CAAC,MAAM,EAAE,OAAO;IAC3C,IAAI,KAAK,GAAG,IAAA,sBAAY,EAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACzC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE;QACtB,MAAM,CAAC,YAAY,GAAG,IAAA,8BAAoB,EAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAC3D,OAAO,KAAK,CAAC,CAAC,CAAC;KAChB;IACD,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC;AACxB,CAAC;AAPD,wBAOC"}
@@ -0,0 +1,11 @@
1
+ export default function convertTo3DZ(spectra: any): {
2
+ z: any[];
3
+ minX: number;
4
+ maxX: number;
5
+ minY: number;
6
+ maxY: number;
7
+ minZ: any;
8
+ maxZ: any;
9
+ noise: number;
10
+ };
11
+ //# sourceMappingURL=convertTo3DZ.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convertTo3DZ.d.ts","sourceRoot":"","sources":["../../src/2d/convertTo3DZ.js"],"names":[],"mappings":"AAEA;;;;;;;;;EAoDC"}
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const ml_array_median_1 = __importDefault(require("ml-array-median"));
7
+ function convertTo3DZ(spectra) {
8
+ let minZ = spectra[0].data.y[0];
9
+ let maxZ = minZ;
10
+ let ySize = spectra.length;
11
+ let xSize = spectra[0].data.x.length;
12
+ let z = new Array(ySize);
13
+ for (let i = 0; i < ySize; i++) {
14
+ z[i] = spectra[i].data.y;
15
+ for (let j = 0; j < xSize; j++) {
16
+ let value = z[i][j];
17
+ if (value < minZ)
18
+ minZ = value;
19
+ if (value > maxZ)
20
+ maxZ = value;
21
+ }
22
+ }
23
+ const firstX = spectra[0].data.x[0];
24
+ const lastX = spectra[0].data.x[spectra[0].data.x.length - 1]; // has to be -2 because it is a 1D array [x,y,x,y,...]
25
+ const firstY = spectra[0].pageValue;
26
+ const lastY = spectra[ySize - 1].pageValue;
27
+ // Because the min / max value are the only information about the matrix if we invert
28
+ // min and max we need to invert the array
29
+ if (firstX > lastX) {
30
+ for (let spectrum of z) {
31
+ spectrum.reverse();
32
+ }
33
+ }
34
+ if (firstY > lastY) {
35
+ z.reverse();
36
+ }
37
+ const medians = [];
38
+ for (let i = 0; i < z.length; i++) {
39
+ const row = Float64Array.from(z[i]);
40
+ for (let i = 0; i < row.length; i++) {
41
+ if (row[i] < 0)
42
+ row[i] = -row[i];
43
+ }
44
+ medians.push((0, ml_array_median_1.default)(row));
45
+ }
46
+ const median = (0, ml_array_median_1.default)(medians);
47
+ return {
48
+ z: z,
49
+ minX: Math.min(firstX, lastX),
50
+ maxX: Math.max(firstX, lastX),
51
+ minY: Math.min(firstY, lastY),
52
+ maxY: Math.max(firstY, lastY),
53
+ minZ: minZ,
54
+ maxZ: maxZ,
55
+ noise: median,
56
+ };
57
+ }
58
+ exports.default = convertTo3DZ;
59
+ //# sourceMappingURL=convertTo3DZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convertTo3DZ.js","sourceRoot":"","sources":["../../src/2d/convertTo3DZ.js"],"names":[],"mappings":";;;;;A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,CAAC;AApDD,+BAoDC"}
@@ -0,0 +1,8 @@
1
+ export default function generateContourLines(zData: any, options: any): {
2
+ minX: any;
3
+ maxX: any;
4
+ minY: any;
5
+ maxY: any;
6
+ segments: any[];
7
+ };
8
+ //# sourceMappingURL=generateContourLines.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateContourLines.d.ts","sourceRoot":"","sources":["../../src/2d/generateContourLines.js"],"names":[],"mappings":"AAAA;;;;;;EAqKC"}
@@ -0,0 +1,163 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ function generateContourLines(zData, options) {
4
+ let noise = zData.noise;
5
+ let z = zData.z;
6
+ let povarHeight0, povarHeight1, povarHeight2, povarHeight3;
7
+ let isOver0, isOver1, isOver2, isOver3;
8
+ let nbSubSpectra = z.length;
9
+ let nbPovars = z[0].length;
10
+ let pAx, pAy, pBx, pBy;
11
+ let x0 = zData.minX;
12
+ let xN = zData.maxX;
13
+ let dx = (xN - x0) / (nbPovars - 1);
14
+ let y0 = zData.minY;
15
+ let yN = zData.maxY;
16
+ let dy = (yN - y0) / (nbSubSpectra - 1);
17
+ let minZ = zData.minZ;
18
+ let maxZ = zData.maxZ;
19
+ // System.out.prvarln('y0 '+y0+' yN '+yN);
20
+ // -------------------------
21
+ // Povars attribution
22
+ //
23
+ // 0----1
24
+ // | / |
25
+ // | / |
26
+ // 2----3
27
+ //
28
+ // ---------------------d------
29
+ let iter = options.nbContourLevels * 2;
30
+ let contourLevels = new Array(iter);
31
+ let lineZValue;
32
+ for (let level = 0; level < iter; level++) {
33
+ // multiply by 2 for positif and negatif
34
+ let contourLevel = {};
35
+ contourLevels[level] = contourLevel;
36
+ let side = level % 2;
37
+ let factor = (maxZ - options.noiseMultiplier * noise) *
38
+ Math.exp((level >> 1) - options.nbContourLevels);
39
+ if (side === 0) {
40
+ lineZValue = factor + options.noiseMultiplier * noise;
41
+ }
42
+ else {
43
+ lineZValue = 0 - factor - options.noiseMultiplier * noise;
44
+ }
45
+ let lines = [];
46
+ contourLevel.zValue = lineZValue;
47
+ contourLevel.lines = lines;
48
+ if (lineZValue <= minZ || lineZValue >= maxZ)
49
+ continue;
50
+ for (let iSubSpectra = 0; iSubSpectra < nbSubSpectra - 1; iSubSpectra++) {
51
+ let subSpectra = z[iSubSpectra];
52
+ let subSpectraAfter = z[iSubSpectra + 1];
53
+ for (let povar = 0; povar < nbPovars - 1; povar++) {
54
+ povarHeight0 = subSpectra[povar];
55
+ povarHeight1 = subSpectra[povar + 1];
56
+ povarHeight2 = subSpectraAfter[povar];
57
+ povarHeight3 = subSpectraAfter[povar + 1];
58
+ isOver0 = povarHeight0 > lineZValue;
59
+ isOver1 = povarHeight1 > lineZValue;
60
+ isOver2 = povarHeight2 > lineZValue;
61
+ isOver3 = povarHeight3 > lineZValue;
62
+ // Example povar0 is over the plane and povar1 and
63
+ // povar2 are below, we find the varersections and add
64
+ // the segment
65
+ if (isOver0 !== isOver1 && isOver0 !== isOver2) {
66
+ pAx =
67
+ povar + (lineZValue - povarHeight0) / (povarHeight1 - povarHeight0);
68
+ pAy = iSubSpectra;
69
+ pBx = povar;
70
+ pBy =
71
+ iSubSpectra +
72
+ (lineZValue - povarHeight0) / (povarHeight2 - povarHeight0);
73
+ lines.push(pAx * dx + x0);
74
+ lines.push(pAy * dy + y0);
75
+ lines.push(pBx * dx + x0);
76
+ lines.push(pBy * dy + y0);
77
+ }
78
+ // remove push does not help !!!!
79
+ if (isOver3 !== isOver1 && isOver3 !== isOver2) {
80
+ pAx = povar + 1;
81
+ pAy =
82
+ iSubSpectra +
83
+ 1 -
84
+ (lineZValue - povarHeight3) / (povarHeight1 - povarHeight3);
85
+ pBx =
86
+ povar +
87
+ 1 -
88
+ (lineZValue - povarHeight3) / (povarHeight2 - povarHeight3);
89
+ pBy = iSubSpectra + 1;
90
+ lines.push(pAx * dx + x0);
91
+ lines.push(pAy * dy + y0);
92
+ lines.push(pBx * dx + x0);
93
+ lines.push(pBy * dy + y0);
94
+ }
95
+ // test around the diagonal
96
+ if (isOver1 !== isOver2) {
97
+ pAx =
98
+ (povar +
99
+ 1 -
100
+ (lineZValue - povarHeight1) / (povarHeight2 - povarHeight1)) *
101
+ dx +
102
+ x0;
103
+ pAy =
104
+ (iSubSpectra +
105
+ (lineZValue - povarHeight1) / (povarHeight2 - povarHeight1)) *
106
+ dy +
107
+ y0;
108
+ if (isOver1 !== isOver0) {
109
+ pBx =
110
+ povar +
111
+ 1 -
112
+ (lineZValue - povarHeight1) / (povarHeight0 - povarHeight1);
113
+ pBy = iSubSpectra;
114
+ lines.push(pAx);
115
+ lines.push(pAy);
116
+ lines.push(pBx * dx + x0);
117
+ lines.push(pBy * dy + y0);
118
+ }
119
+ if (isOver2 !== isOver0) {
120
+ pBx = povar;
121
+ pBy =
122
+ iSubSpectra +
123
+ 1 -
124
+ (lineZValue - povarHeight2) / (povarHeight0 - povarHeight2);
125
+ lines.push(pAx);
126
+ lines.push(pAy);
127
+ lines.push(pBx * dx + x0);
128
+ lines.push(pBy * dy + y0);
129
+ }
130
+ if (isOver1 !== isOver3) {
131
+ pBx = povar + 1;
132
+ pBy =
133
+ iSubSpectra +
134
+ (lineZValue - povarHeight1) / (povarHeight3 - povarHeight1);
135
+ lines.push(pAx);
136
+ lines.push(pAy);
137
+ lines.push(pBx * dx + x0);
138
+ lines.push(pBy * dy + y0);
139
+ }
140
+ if (isOver2 !== isOver3) {
141
+ pBx =
142
+ povar +
143
+ (lineZValue - povarHeight2) / (povarHeight3 - povarHeight2);
144
+ pBy = iSubSpectra + 1;
145
+ lines.push(pAx);
146
+ lines.push(pAy);
147
+ lines.push(pBx * dx + x0);
148
+ lines.push(pBy * dy + y0);
149
+ }
150
+ }
151
+ }
152
+ }
153
+ }
154
+ return {
155
+ minX: zData.minX,
156
+ maxX: zData.maxX,
157
+ minY: zData.minY,
158
+ maxY: zData.maxY,
159
+ segments: contourLevels,
160
+ };
161
+ }
162
+ exports.default = generateContourLines;
163
+ //# sourceMappingURL=generateContourLines.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateContourLines.js","sourceRoot":"","sources":["../../src/2d/generateContourLines.js"],"names":[],"mappings":";;AAAA,SAAwB,oBAAoB,CAAC,KAAK,EAAE,OAAO;IACzD,IAAI,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IACxB,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;IAChB,IAAI,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,CAAC;IAC3D,IAAI,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC;IACvC,IAAI,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5B,IAAI,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAC3B,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IAEvB,IAAI,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC;IACpB,IAAI,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC;IACpB,IAAI,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC;IACpC,IAAI,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC;IACpB,IAAI,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC;IACpB,IAAI,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;IACxC,IAAI,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IACtB,IAAI,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IAEtB,0CAA0C;IAC1C,4BAA4B;IAC5B,qBAAqB;IACrB,EAAE;IACF,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,EAAE;IACF,+BAA+B;IAE/B,IAAI,IAAI,GAAG,OAAO,CAAC,eAAe,GAAG,CAAC,CAAC;IACv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CAAC,IAAI,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;wBAC1B,KAAK,CAAC,IAAI,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;qBAC3B;iBACF;aACF;SACF;KACF;IAED,OAAO;QACL,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,QAAQ,EAAE,aAAa;KACxB,CAAC;AACJ,CAAC;AArKD,uCAqKC"}
@@ -0,0 +1,4 @@
1
+ export function complexChromatogram(result: any): void;
2
+ export function isMSField(canonicDataLabel: any): boolean;
3
+ export function convertMSFieldToLabel(value: any): any;
4
+ //# sourceMappingURL=complexChromatogram.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"complexChromatogram.d.ts","sourceRoot":"","sources":["../src/complexChromatogram.js"],"names":[],"mappings":"AAEA,uDAsCC;AAED,0DAEC;AAED,uDAEC"}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.convertMSFieldToLabel = exports.isMSField = exports.complexChromatogram = void 0;
4
+ const GC_MS_FIELDS = ['TIC', '.RIC', 'SCANNUMBER'];
5
+ function complexChromatogram(result) {
6
+ let spectra = result.spectra;
7
+ let length = spectra.length;
8
+ let chromatogram = {
9
+ times: new Array(length),
10
+ series: {
11
+ ms: {
12
+ dimension: 2,
13
+ data: new Array(length),
14
+ },
15
+ },
16
+ };
17
+ let existingGCMSFields = [];
18
+ for (let i = 0; i < GC_MS_FIELDS.length; i++) {
19
+ let label = convertMSFieldToLabel(GC_MS_FIELDS[i]);
20
+ if (spectra[0][label]) {
21
+ existingGCMSFields.push(label);
22
+ chromatogram.series[label] = {
23
+ dimension: 1,
24
+ data: new Array(length),
25
+ };
26
+ }
27
+ }
28
+ for (let i = 0; i < length; i++) {
29
+ let spectrum = spectra[i];
30
+ chromatogram.times[i] = spectrum.pageValue;
31
+ for (let j = 0; j < existingGCMSFields.length; j++) {
32
+ chromatogram.series[existingGCMSFields[j]].data[i] = Number(spectrum[existingGCMSFields[j]]);
33
+ }
34
+ if (spectrum.data) {
35
+ chromatogram.series.ms.data[i] = [spectrum.data.x, spectrum.data.y];
36
+ }
37
+ }
38
+ result.chromatogram = chromatogram;
39
+ }
40
+ exports.complexChromatogram = complexChromatogram;
41
+ function isMSField(canonicDataLabel) {
42
+ return GC_MS_FIELDS.indexOf(canonicDataLabel) !== -1;
43
+ }
44
+ exports.isMSField = isMSField;
45
+ function convertMSFieldToLabel(value) {
46
+ return value.toLowerCase().replace(/[^a-z0-9]/g, '');
47
+ }
48
+ exports.convertMSFieldToLabel = convertMSFieldToLabel;
49
+ //# sourceMappingURL=complexChromatogram.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"complexChromatogram.js","sourceRoot":"","sources":["../src/complexChromatogram.js"],"names":[],"mappings":";;;AAAA,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;AAEnD,SAAgB,mBAAmB,CAAC,MAAM;IACxC,IAAI,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IAC7B,IAAI,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAC5B,IAAI,YAAY,GAAG;QACjB,KAAK,EAAE,IAAI,KAAK,CAAC,MAAM,CAAC;QACxB,MAAM,EAAE;YACN,EAAE,EAAE;gBACF,SAAS,EAAE,CAAC;gBACZ,IAAI,EAAE,IAAI,KAAK,CAAC,MAAM,CAAC;aACxB;SACF;KACF,CAAC;IAEF,IAAI,kBAAkB,GAAG,EAAE,CAAC;IAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAC5C,IAAI,KAAK,GAAG,qBAAqB,CAAC,YAAY,CAAC,CAAC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,EAAE,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;AACvD,CAAC;AAFD,sDAEC"}
@@ -0,0 +1,139 @@
1
+ /**
2
+ *
3
+ * @typedef {object} ConvertOptions
4
+ * @property {RegExp} [options.keepRecordsRegExp=/^$/] - By default we don't keep meta information.
5
+ * @property {boolean} [options.canonicDataLabels=true] - Canonize the Labels (uppercase without symbol).
6
+ * @property {boolean} [options.canonicMetadataLabels=false] - Canonize the metadata Labels (uppercase without symbol).
7
+ * @property {boolean} [options.dynamicTyping=false] - Convert numbers to Number.
8
+ * @property {boolean} [options.withoutXY=false] - Remove the XY data.
9
+ * @property {boolean} [options.chromatogram=false] - Special post-processing for GC / HPLC / MS.
10
+ * @property {boolean} [options.keepSpectra=false] - Force to keep the spectra in case of 2D.
11
+ * @property {boolean} [options.noContour=false] - Don't calculate countour in case of 2D.
12
+ * @property {number} [options.nbContourLevels=7] - Number of positive / negative contour levels to calculate.
13
+ * @property {number} [options.noiseMultiplier=5] - Define for 2D the level as 5 times the median as default.
14
+ * @property {boolean} [options.profiling=false] - Add profiling information.
15
+ */
16
+ /**
17
+ *
18
+ * @typedef {object} Ntuples
19
+ * @property {string[]} [varname]
20
+ * @property {string[]} [symbol]
21
+ * @property {string[]} [vartype]
22
+ * @property {string[]} [varform]
23
+ * @property {number[]} [vardim]
24
+ * @property {string[]} [units]
25
+ * @property {number[]} [factor]
26
+ * @property {number[]} [first]
27
+ * @property {number[]} [last]
28
+ * @property {number[]} [min]
29
+ * @property {number[]} [max]
30
+ * @property {string[]} [nucleus]
31
+ */
32
+ /**
33
+ *
34
+ * @typedef { object } Entry
35
+ * @property {Spectrum[]} spectra
36
+ * @property {Ntuples} ntuples
37
+ * @property {object} meta
38
+ * @property {object} tmp
39
+ * @property {string} [title]
40
+ * @property {string} [dataType]
41
+ * @property {string} [dataClass]
42
+ * @property {boolean} [twoD]
43
+ */
44
+ /**
45
+ *
46
+ * @typedef { object } ConvertResult
47
+ * @property { object[] | boolean } profiling
48
+ * @property { string[] } logs
49
+ * @property { object[] } entries
50
+ * @property { Entry[] } flatten
51
+ */
52
+ /**
53
+ * Parse a jcamp.
54
+ *
55
+ * @param {string|ArrayBuffer|Uint8Array} jcamp
56
+ * @param {ConvertOptions} [options]
57
+ * @returns {ConvertResult}
58
+ */
59
+ export function convert(jcamp: string | ArrayBuffer | Uint8Array, options?: ConvertOptions | undefined): ConvertResult;
60
+ export type ConvertOptions = {
61
+ /**
62
+ * - By default we don't keep meta information.
63
+ */
64
+ keepRecordsRegExp?: RegExp | undefined;
65
+ /**
66
+ * - Canonize the Labels (uppercase without symbol).
67
+ */
68
+ canonicDataLabels?: boolean | undefined;
69
+ /**
70
+ * - Canonize the metadata Labels (uppercase without symbol).
71
+ */
72
+ canonicMetadataLabels?: boolean | undefined;
73
+ /**
74
+ * - Convert numbers to Number.
75
+ */
76
+ dynamicTyping?: boolean | undefined;
77
+ /**
78
+ * - Remove the XY data.
79
+ */
80
+ withoutXY?: boolean | undefined;
81
+ /**
82
+ * - Special post-processing for GC / HPLC / MS.
83
+ */
84
+ chromatogram?: boolean | undefined;
85
+ /**
86
+ * - Force to keep the spectra in case of 2D.
87
+ */
88
+ keepSpectra?: boolean | undefined;
89
+ /**
90
+ * - Don't calculate countour in case of 2D.
91
+ */
92
+ noContour?: boolean | undefined;
93
+ /**
94
+ * - Number of positive / negative contour levels to calculate.
95
+ */
96
+ nbContourLevels?: number | undefined;
97
+ /**
98
+ * - Define for 2D the level as 5 times the median as default.
99
+ */
100
+ noiseMultiplier?: number | undefined;
101
+ /**
102
+ * - Add profiling information.
103
+ */
104
+ profiling?: boolean | undefined;
105
+ };
106
+ export type Ntuples = {
107
+ varname?: string[] | undefined;
108
+ symbol?: string[] | undefined;
109
+ vartype?: string[] | undefined;
110
+ varform?: string[] | undefined;
111
+ vardim?: number[] | undefined;
112
+ units?: string[] | undefined;
113
+ factor?: number[] | undefined;
114
+ first?: number[] | undefined;
115
+ last?: number[] | undefined;
116
+ min?: number[] | undefined;
117
+ max?: number[] | undefined;
118
+ nucleus?: string[] | undefined;
119
+ };
120
+ export type Entry = {
121
+ spectra: Spectrum[];
122
+ ntuples: Ntuples;
123
+ meta: object;
124
+ tmp: object;
125
+ title?: string | undefined;
126
+ dataType?: string | undefined;
127
+ dataClass?: string | undefined;
128
+ twoD?: boolean | undefined;
129
+ };
130
+ export type ConvertResult = {
131
+ profiling: object[] | boolean;
132
+ logs: string[];
133
+ entries: object[];
134
+ flatten: Entry[];
135
+ };
136
+ declare class Spectrum {
137
+ }
138
+ export {};
139
+ //# sourceMappingURL=convert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../src/convert.js"],"names":[],"mappings":"AAgCA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;;;;;;;;;GAeG;AAEH;;;;;;;;;;;GAWG;AAEH;;;;;;;GAOG;AAEH;;;;;;GAMG;AAEH,+BALW,MAAM,GAAC,WAAW,GAAC,UAAU,yCAE3B,aAAa,CA+RzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAvTa,QAAQ,EAAE;aACV,OAAO;UACP,MAAM;SACN,MAAM;;;;;;;eAUL,MAAM,EAAE,GAAG,OAAO;UAClB,MAAM,EAAE;aACR,MAAM,EAAE;aACR,KAAK,EAAE;;AApEtB;CAAiB"}