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,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ function profiling(result, action, options) {
4
+ if (result.profiling) {
5
+ result.profiling.push({
6
+ action,
7
+ time: Date.now() - options.start,
8
+ });
9
+ }
10
+ }
11
+ exports.default = profiling;
12
+ //# sourceMappingURL=profiling.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profiling.js","sourceRoot":"","sources":["../src/profiling.js"],"names":[],"mappings":";;AAAA,SAAwB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO;IACvD,IAAI,MAAM,CAAC,SAAS,EAAE;QACpB,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC;YACpB,MAAM;YACN,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,KAAK;SACjC,CAAC,CAAC;KACJ;AACH,CAAC;AAPD,4BAOC"}
@@ -0,0 +1,2 @@
1
+ export default function simpleChromatogram(result: any): void;
2
+ //# sourceMappingURL=simpleChromatogram.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simpleChromatogram.d.ts","sourceRoot":"","sources":["../src/simpleChromatogram.js"],"names":[],"mappings":"AAAA,8DAWC"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ function simpleChromatogram(result) {
4
+ let data = result.spectra[0].data;
5
+ result.chromatogram = {
6
+ times: data.x.slice(),
7
+ series: {
8
+ intensity: {
9
+ dimension: 1,
10
+ data: data.y.slice(),
11
+ },
12
+ },
13
+ };
14
+ }
15
+ exports.default = simpleChromatogram;
16
+ //# sourceMappingURL=simpleChromatogram.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simpleChromatogram.js","sourceRoot":"","sources":["../src/simpleChromatogram.js"],"names":[],"mappings":";;AAAA,SAAwB,kBAAkB,CAAC,MAAM;IAC/C,IAAI,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAClC,MAAM,CAAC,YAAY,GAAG;QACpB,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE;QACrB,MAAM,EAAE;YACN,SAAS,EAAE;gBACT,SAAS,EAAE,CAAC;gBACZ,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE;aACrB;SACF;KACF,CAAC;AACJ,CAAC;AAXD,qCAWC"}
@@ -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,11 @@
1
+ import convertTo3DZ from './convertTo3DZ';
2
+ import generateContourLines from './generateContourLines';
3
+ export default function add2D(result, options) {
4
+ let zData = convertTo3DZ(result.spectra);
5
+ if (!options.noContour) {
6
+ result.contourLines = generateContourLines(zData, options);
7
+ delete zData.z;
8
+ }
9
+ result.minMax = zData;
10
+ }
11
+ //# sourceMappingURL=add2D.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add2D.js","sourceRoot":"","sources":["../../src/2d/add2D.js"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAE1D,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,MAAM,EAAE,OAAO;IAC3C,IAAI,KAAK,GAAG,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACzC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE;QACtB,MAAM,CAAC,YAAY,GAAG,oBAAoB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAC3D,OAAO,KAAK,CAAC,CAAC,CAAC;KAChB;IACD,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC;AACxB,CAAC"}
@@ -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,53 @@
1
+ import getMedian from 'ml-array-median';
2
+ export default function convertTo3DZ(spectra) {
3
+ let minZ = spectra[0].data.y[0];
4
+ let maxZ = minZ;
5
+ let ySize = spectra.length;
6
+ let xSize = spectra[0].data.x.length;
7
+ let z = new Array(ySize);
8
+ for (let i = 0; i < ySize; i++) {
9
+ z[i] = spectra[i].data.y;
10
+ for (let j = 0; j < xSize; j++) {
11
+ let value = z[i][j];
12
+ if (value < minZ)
13
+ minZ = value;
14
+ if (value > maxZ)
15
+ maxZ = value;
16
+ }
17
+ }
18
+ const firstX = spectra[0].data.x[0];
19
+ 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,...]
20
+ const firstY = spectra[0].pageValue;
21
+ const lastY = spectra[ySize - 1].pageValue;
22
+ // Because the min / max value are the only information about the matrix if we invert
23
+ // min and max we need to invert the array
24
+ if (firstX > lastX) {
25
+ for (let spectrum of z) {
26
+ spectrum.reverse();
27
+ }
28
+ }
29
+ if (firstY > lastY) {
30
+ z.reverse();
31
+ }
32
+ const medians = [];
33
+ for (let i = 0; i < z.length; i++) {
34
+ const row = Float64Array.from(z[i]);
35
+ for (let i = 0; i < row.length; i++) {
36
+ if (row[i] < 0)
37
+ row[i] = -row[i];
38
+ }
39
+ medians.push(getMedian(row));
40
+ }
41
+ const median = getMedian(medians);
42
+ return {
43
+ z: z,
44
+ minX: Math.min(firstX, lastX),
45
+ maxX: Math.max(firstX, lastX),
46
+ minY: Math.min(firstY, lastY),
47
+ maxY: Math.max(firstY, lastY),
48
+ minZ: minZ,
49
+ maxZ: maxZ,
50
+ noise: median,
51
+ };
52
+ }
53
+ //# sourceMappingURL=convertTo3DZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convertTo3DZ.js","sourceRoot":"","sources":["../../src/2d/convertTo3DZ.js"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,iBAAiB,CAAC;AAExC,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC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, 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,160 @@
1
+ export default function generateContourLines(zData, options) {
2
+ let noise = zData.noise;
3
+ let z = zData.z;
4
+ let povarHeight0, povarHeight1, povarHeight2, povarHeight3;
5
+ let isOver0, isOver1, isOver2, isOver3;
6
+ let nbSubSpectra = z.length;
7
+ let nbPovars = z[0].length;
8
+ let pAx, pAy, pBx, pBy;
9
+ let x0 = zData.minX;
10
+ let xN = zData.maxX;
11
+ let dx = (xN - x0) / (nbPovars - 1);
12
+ let y0 = zData.minY;
13
+ let yN = zData.maxY;
14
+ let dy = (yN - y0) / (nbSubSpectra - 1);
15
+ let minZ = zData.minZ;
16
+ let maxZ = zData.maxZ;
17
+ // System.out.prvarln('y0 '+y0+' yN '+yN);
18
+ // -------------------------
19
+ // Povars attribution
20
+ //
21
+ // 0----1
22
+ // | / |
23
+ // | / |
24
+ // 2----3
25
+ //
26
+ // ---------------------d------
27
+ let iter = options.nbContourLevels * 2;
28
+ let contourLevels = new Array(iter);
29
+ let lineZValue;
30
+ for (let level = 0; level < iter; level++) {
31
+ // multiply by 2 for positif and negatif
32
+ let contourLevel = {};
33
+ contourLevels[level] = contourLevel;
34
+ let side = level % 2;
35
+ let factor = (maxZ - options.noiseMultiplier * noise) *
36
+ Math.exp((level >> 1) - options.nbContourLevels);
37
+ if (side === 0) {
38
+ lineZValue = factor + options.noiseMultiplier * noise;
39
+ }
40
+ else {
41
+ lineZValue = 0 - factor - options.noiseMultiplier * noise;
42
+ }
43
+ let lines = [];
44
+ contourLevel.zValue = lineZValue;
45
+ contourLevel.lines = lines;
46
+ if (lineZValue <= minZ || lineZValue >= maxZ)
47
+ continue;
48
+ for (let iSubSpectra = 0; iSubSpectra < nbSubSpectra - 1; iSubSpectra++) {
49
+ let subSpectra = z[iSubSpectra];
50
+ let subSpectraAfter = z[iSubSpectra + 1];
51
+ for (let povar = 0; povar < nbPovars - 1; povar++) {
52
+ povarHeight0 = subSpectra[povar];
53
+ povarHeight1 = subSpectra[povar + 1];
54
+ povarHeight2 = subSpectraAfter[povar];
55
+ povarHeight3 = subSpectraAfter[povar + 1];
56
+ isOver0 = povarHeight0 > lineZValue;
57
+ isOver1 = povarHeight1 > lineZValue;
58
+ isOver2 = povarHeight2 > lineZValue;
59
+ isOver3 = povarHeight3 > lineZValue;
60
+ // Example povar0 is over the plane and povar1 and
61
+ // povar2 are below, we find the varersections and add
62
+ // the segment
63
+ if (isOver0 !== isOver1 && isOver0 !== isOver2) {
64
+ pAx =
65
+ povar + (lineZValue - povarHeight0) / (povarHeight1 - povarHeight0);
66
+ pAy = iSubSpectra;
67
+ pBx = povar;
68
+ pBy =
69
+ iSubSpectra +
70
+ (lineZValue - povarHeight0) / (povarHeight2 - povarHeight0);
71
+ lines.push(pAx * dx + x0);
72
+ lines.push(pAy * dy + y0);
73
+ lines.push(pBx * dx + x0);
74
+ lines.push(pBy * dy + y0);
75
+ }
76
+ // remove push does not help !!!!
77
+ if (isOver3 !== isOver1 && isOver3 !== isOver2) {
78
+ pAx = povar + 1;
79
+ pAy =
80
+ iSubSpectra +
81
+ 1 -
82
+ (lineZValue - povarHeight3) / (povarHeight1 - povarHeight3);
83
+ pBx =
84
+ povar +
85
+ 1 -
86
+ (lineZValue - povarHeight3) / (povarHeight2 - povarHeight3);
87
+ pBy = iSubSpectra + 1;
88
+ lines.push(pAx * dx + x0);
89
+ lines.push(pAy * dy + y0);
90
+ lines.push(pBx * dx + x0);
91
+ lines.push(pBy * dy + y0);
92
+ }
93
+ // test around the diagonal
94
+ if (isOver1 !== isOver2) {
95
+ pAx =
96
+ (povar +
97
+ 1 -
98
+ (lineZValue - povarHeight1) / (povarHeight2 - povarHeight1)) *
99
+ dx +
100
+ x0;
101
+ pAy =
102
+ (iSubSpectra +
103
+ (lineZValue - povarHeight1) / (povarHeight2 - povarHeight1)) *
104
+ dy +
105
+ y0;
106
+ if (isOver1 !== isOver0) {
107
+ pBx =
108
+ povar +
109
+ 1 -
110
+ (lineZValue - povarHeight1) / (povarHeight0 - povarHeight1);
111
+ pBy = iSubSpectra;
112
+ lines.push(pAx);
113
+ lines.push(pAy);
114
+ lines.push(pBx * dx + x0);
115
+ lines.push(pBy * dy + y0);
116
+ }
117
+ if (isOver2 !== isOver0) {
118
+ pBx = povar;
119
+ pBy =
120
+ iSubSpectra +
121
+ 1 -
122
+ (lineZValue - povarHeight2) / (povarHeight0 - povarHeight2);
123
+ lines.push(pAx);
124
+ lines.push(pAy);
125
+ lines.push(pBx * dx + x0);
126
+ lines.push(pBy * dy + y0);
127
+ }
128
+ if (isOver1 !== isOver3) {
129
+ pBx = povar + 1;
130
+ pBy =
131
+ iSubSpectra +
132
+ (lineZValue - povarHeight1) / (povarHeight3 - povarHeight1);
133
+ lines.push(pAx);
134
+ lines.push(pAy);
135
+ lines.push(pBx * dx + x0);
136
+ lines.push(pBy * dy + y0);
137
+ }
138
+ if (isOver2 !== isOver3) {
139
+ pBx =
140
+ povar +
141
+ (lineZValue - povarHeight2) / (povarHeight3 - povarHeight2);
142
+ pBy = iSubSpectra + 1;
143
+ lines.push(pAx);
144
+ lines.push(pAy);
145
+ lines.push(pBx * dx + x0);
146
+ lines.push(pBy * dy + y0);
147
+ }
148
+ }
149
+ }
150
+ }
151
+ }
152
+ return {
153
+ minX: zData.minX,
154
+ maxX: zData.maxX,
155
+ minY: zData.minY,
156
+ maxY: zData.maxY,
157
+ segments: contourLevels,
158
+ };
159
+ }
160
+ //# sourceMappingURL=generateContourLines.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateContourLines.js","sourceRoot":"","sources":["../../src/2d/generateContourLines.js"],"names":[],"mappings":"AAAA,MAAM,CAA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G,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"}
@@ -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,43 @@
1
+ const GC_MS_FIELDS = ['TIC', '.RIC', 'SCANNUMBER'];
2
+ export function complexChromatogram(result) {
3
+ let spectra = result.spectra;
4
+ let length = spectra.length;
5
+ let chromatogram = {
6
+ times: new Array(length),
7
+ series: {
8
+ ms: {
9
+ dimension: 2,
10
+ data: new Array(length),
11
+ },
12
+ },
13
+ };
14
+ let existingGCMSFields = [];
15
+ for (let i = 0; i < GC_MS_FIELDS.length; i++) {
16
+ let label = convertMSFieldToLabel(GC_MS_FIELDS[i]);
17
+ if (spectra[0][label]) {
18
+ existingGCMSFields.push(label);
19
+ chromatogram.series[label] = {
20
+ dimension: 1,
21
+ data: new Array(length),
22
+ };
23
+ }
24
+ }
25
+ for (let i = 0; i < length; i++) {
26
+ let spectrum = spectra[i];
27
+ chromatogram.times[i] = spectrum.pageValue;
28
+ for (let j = 0; j < existingGCMSFields.length; j++) {
29
+ chromatogram.series[existingGCMSFields[j]].data[i] = Number(spectrum[existingGCMSFields[j]]);
30
+ }
31
+ if (spectrum.data) {
32
+ chromatogram.series.ms.data[i] = [spectrum.data.x, spectrum.data.y];
33
+ }
34
+ }
35
+ result.chromatogram = chromatogram;
36
+ }
37
+ export function isMSField(canonicDataLabel) {
38
+ return GC_MS_FIELDS.indexOf(canonicDataLabel) !== -1;
39
+ }
40
+ export function convertMSFieldToLabel(value) {
41
+ return value.toLowerCase().replace(/[^a-z0-9]/g, '');
42
+ }
43
+ //# 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,MAAM,UAAU,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,CAAC,CAAC,CAAC;QACnD,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE;YACrB,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC/B,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG;gBAC3B,SAAS,EAAE,CAAC;gBACZ,IAAI,EAAE,IAAI,KAAK,CAAC,MAAM,CAAC;aACxB,CAAC;SACH;KACF;IAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;QAC/B,IAAI,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QAC1B,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,SAAS,CAAC;QAC3C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,kBAAkB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAClD,YAAY,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,MAAM,CACzD,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAChC,CAAC;SACH;QACD,IAAI,QAAQ,CAAC,IAAI,EAAE;YACjB,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACrE;KACF;IACD,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,gBAAgB;IACxC,OAAO,YAAY,CAAC,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,KAAK;IACzC,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;AACvD,CAAC"}
@@ -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"}