jcampconverter 9.2.0 → 9.2.2

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 (156) hide show
  1. package/jcampconverter.cjs +8 -0
  2. package/{lib/convert.d.ts → jcampconverter.d.ts} +222 -182
  3. package/jcampconverter.mjs +8 -0
  4. package/package.json +27 -19
  5. package/lib/2d/add2D.d.ts +0 -2
  6. package/lib/2d/add2D.d.ts.map +0 -1
  7. package/lib/2d/add2D.js +0 -17
  8. package/lib/2d/add2D.js.map +0 -1
  9. package/lib/2d/convertTo3DZ.d.ts +0 -11
  10. package/lib/2d/convertTo3DZ.d.ts.map +0 -1
  11. package/lib/2d/convertTo3DZ.js +0 -59
  12. package/lib/2d/convertTo3DZ.js.map +0 -1
  13. package/lib/2d/generateContourLines.d.ts +0 -8
  14. package/lib/2d/generateContourLines.d.ts.map +0 -1
  15. package/lib/2d/generateContourLines.js +0 -163
  16. package/lib/2d/generateContourLines.js.map +0 -1
  17. package/lib/complexChromatogram.d.ts +0 -4
  18. package/lib/complexChromatogram.d.ts.map +0 -1
  19. package/lib/complexChromatogram.js +0 -49
  20. package/lib/complexChromatogram.js.map +0 -1
  21. package/lib/convert.d.ts.map +0 -1
  22. package/lib/convert.js +0 -412
  23. package/lib/convert.js.map +0 -1
  24. package/lib/convertToFloatArray.d.ts +0 -2
  25. package/lib/convertToFloatArray.d.ts.map +0 -1
  26. package/lib/convertToFloatArray.js +0 -11
  27. package/lib/convertToFloatArray.js.map +0 -1
  28. package/lib/createTree.d.ts +0 -29
  29. package/lib/createTree.d.ts.map +0 -1
  30. package/lib/createTree.js +0 -101
  31. package/lib/createTree.js.map +0 -1
  32. package/lib/index.d.ts +0 -3
  33. package/lib/index.d.ts.map +0 -1
  34. package/lib/index.js +0 -8
  35. package/lib/index.js.map +0 -1
  36. package/lib/parse/fastParseXYData.d.ts +0 -2
  37. package/lib/parse/fastParseXYData.d.ts.map +0 -1
  38. package/lib/parse/fastParseXYData.js +0 -193
  39. package/lib/parse/fastParseXYData.js.map +0 -1
  40. package/lib/parse/parsePeakTable.d.ts +0 -2
  41. package/lib/parse/parsePeakTable.d.ts.map +0 -1
  42. package/lib/parse/parsePeakTable.js +0 -67
  43. package/lib/parse/parsePeakTable.js.map +0 -1
  44. package/lib/parse/parseXYA.d.ts +0 -2
  45. package/lib/parse/parseXYA.d.ts.map +0 -1
  46. package/lib/parse/parseXYA.js +0 -51
  47. package/lib/parse/parseXYA.js.map +0 -1
  48. package/lib/postProcessing.d.ts +0 -2
  49. package/lib/postProcessing.d.ts.map +0 -1
  50. package/lib/postProcessing.js +0 -93
  51. package/lib/postProcessing.js.map +0 -1
  52. package/lib/postProcessingNMR.d.ts +0 -2
  53. package/lib/postProcessingNMR.d.ts.map +0 -1
  54. package/lib/postProcessingNMR.js +0 -95
  55. package/lib/postProcessingNMR.js.map +0 -1
  56. package/lib/prepareNtuplesDatatable.d.ts +0 -2
  57. package/lib/prepareNtuplesDatatable.d.ts.map +0 -1
  58. package/lib/prepareNtuplesDatatable.js +0 -87
  59. package/lib/prepareNtuplesDatatable.js.map +0 -1
  60. package/lib/prepareSpectrum.d.ts +0 -2
  61. package/lib/prepareSpectrum.d.ts.map +0 -1
  62. package/lib/prepareSpectrum.js +0 -10
  63. package/lib/prepareSpectrum.js.map +0 -1
  64. package/lib/profiling.d.ts +0 -2
  65. package/lib/profiling.d.ts.map +0 -1
  66. package/lib/profiling.js +0 -13
  67. package/lib/profiling.js.map +0 -1
  68. package/lib/simpleChromatogram.d.ts +0 -2
  69. package/lib/simpleChromatogram.d.ts.map +0 -1
  70. package/lib/simpleChromatogram.js +0 -16
  71. package/lib/simpleChromatogram.js.map +0 -1
  72. package/lib-esm/2d/add2D.d.ts +0 -2
  73. package/lib-esm/2d/add2D.d.ts.map +0 -1
  74. package/lib-esm/2d/add2D.js +0 -11
  75. package/lib-esm/2d/add2D.js.map +0 -1
  76. package/lib-esm/2d/convertTo3DZ.d.ts +0 -11
  77. package/lib-esm/2d/convertTo3DZ.d.ts.map +0 -1
  78. package/lib-esm/2d/convertTo3DZ.js +0 -53
  79. package/lib-esm/2d/convertTo3DZ.js.map +0 -1
  80. package/lib-esm/2d/generateContourLines.d.ts +0 -8
  81. package/lib-esm/2d/generateContourLines.d.ts.map +0 -1
  82. package/lib-esm/2d/generateContourLines.js +0 -160
  83. package/lib-esm/2d/generateContourLines.js.map +0 -1
  84. package/lib-esm/complexChromatogram.d.ts +0 -4
  85. package/lib-esm/complexChromatogram.d.ts.map +0 -1
  86. package/lib-esm/complexChromatogram.js +0 -43
  87. package/lib-esm/complexChromatogram.js.map +0 -1
  88. package/lib-esm/convert.d.ts +0 -182
  89. package/lib-esm/convert.d.ts.map +0 -1
  90. package/lib-esm/convert.js +0 -405
  91. package/lib-esm/convert.js.map +0 -1
  92. package/lib-esm/convertToFloatArray.d.ts +0 -2
  93. package/lib-esm/convertToFloatArray.d.ts.map +0 -1
  94. package/lib-esm/convertToFloatArray.js +0 -8
  95. package/lib-esm/convertToFloatArray.js.map +0 -1
  96. package/lib-esm/createTree.d.ts +0 -29
  97. package/lib-esm/createTree.d.ts.map +0 -1
  98. package/lib-esm/createTree.js +0 -97
  99. package/lib-esm/createTree.js.map +0 -1
  100. package/lib-esm/index.d.ts +0 -3
  101. package/lib-esm/index.d.ts.map +0 -1
  102. package/lib-esm/index.js +0 -3
  103. package/lib-esm/index.js.map +0 -1
  104. package/lib-esm/parse/fastParseXYData.d.ts +0 -2
  105. package/lib-esm/parse/fastParseXYData.d.ts.map +0 -1
  106. package/lib-esm/parse/fastParseXYData.js +0 -190
  107. package/lib-esm/parse/fastParseXYData.js.map +0 -1
  108. package/lib-esm/parse/parsePeakTable.d.ts +0 -2
  109. package/lib-esm/parse/parsePeakTable.d.ts.map +0 -1
  110. package/lib-esm/parse/parsePeakTable.js +0 -64
  111. package/lib-esm/parse/parsePeakTable.js.map +0 -1
  112. package/lib-esm/parse/parseXYA.d.ts +0 -2
  113. package/lib-esm/parse/parseXYA.d.ts.map +0 -1
  114. package/lib-esm/parse/parseXYA.js +0 -48
  115. package/lib-esm/parse/parseXYA.js.map +0 -1
  116. package/lib-esm/postProcessing.d.ts +0 -2
  117. package/lib-esm/postProcessing.d.ts.map +0 -1
  118. package/lib-esm/postProcessing.js +0 -87
  119. package/lib-esm/postProcessing.js.map +0 -1
  120. package/lib-esm/postProcessingNMR.d.ts +0 -2
  121. package/lib-esm/postProcessingNMR.d.ts.map +0 -1
  122. package/lib-esm/postProcessingNMR.js +0 -92
  123. package/lib-esm/postProcessingNMR.js.map +0 -1
  124. package/lib-esm/prepareNtuplesDatatable.d.ts +0 -2
  125. package/lib-esm/prepareNtuplesDatatable.d.ts.map +0 -1
  126. package/lib-esm/prepareNtuplesDatatable.js +0 -84
  127. package/lib-esm/prepareNtuplesDatatable.js.map +0 -1
  128. package/lib-esm/prepareSpectrum.d.ts +0 -2
  129. package/lib-esm/prepareSpectrum.d.ts.map +0 -1
  130. package/lib-esm/prepareSpectrum.js +0 -7
  131. package/lib-esm/prepareSpectrum.js.map +0 -1
  132. package/lib-esm/profiling.d.ts +0 -2
  133. package/lib-esm/profiling.d.ts.map +0 -1
  134. package/lib-esm/profiling.js +0 -10
  135. package/lib-esm/profiling.js.map +0 -1
  136. package/lib-esm/simpleChromatogram.d.ts +0 -2
  137. package/lib-esm/simpleChromatogram.d.ts.map +0 -1
  138. package/lib-esm/simpleChromatogram.js +0 -13
  139. package/lib-esm/simpleChromatogram.js.map +0 -1
  140. package/src/2d/add2D.js +0 -11
  141. package/src/2d/convertTo3DZ.js +0 -55
  142. package/src/2d/generateContourLines.js +0 -166
  143. package/src/complexChromatogram.js +0 -49
  144. package/src/convert.js +0 -412
  145. package/src/convertToFloatArray.js +0 -7
  146. package/src/createTree.js +0 -100
  147. package/src/index.js +0 -2
  148. package/src/parse/fastParseXYData.js +0 -175
  149. package/src/parse/parsePeakTable.js +0 -69
  150. package/src/parse/parseXYA.js +0 -50
  151. package/src/postProcessing.js +0 -93
  152. package/src/postProcessingNMR.js +0 -99
  153. package/src/prepareNtuplesDatatable.js +0 -85
  154. package/src/prepareSpectrum.js +0 -4
  155. package/src/profiling.js +0 -9
  156. package/src/simpleChromatogram.js +0 -12
@@ -1,182 +0,0 @@
1
- /**
2
- * Conversion options
3
- * @typedef {object} ConvertOptions
4
- * @property {RegExp} [keepRecordsRegExp=/^$/] - By default we don't keep meta information.
5
- * @property {boolean} [canonicDataLabels=true] - Canonize the Labels (uppercase without symbol).
6
- * @property {boolean} [canonicMetadataLabels=false] - Canonize the metadata Labels (uppercase without symbol).
7
- * @property {boolean} [dynamicTyping=false] - Convert numbers to Number.
8
- * @property {boolean} [withoutXY=false] - Remove the XY data.
9
- * @property {boolean} [chromatogram=false] - Special post-processing for GC / HPLC / MS.
10
- * @property {boolean} [keepSpectra=false] - Force to keep the spectra in case of 2D.
11
- * @property {boolean} [noContour=false] - Don't calculate countour in case of 2D.
12
- * @property {number} [nbContourLevels=7] - Number of positive / negative contour levels to calculate.
13
- * @property {number} [noiseMultiplier=5] - Define for 2D the level as 5 times the median as default.
14
- * @property {import('cheminfo-types').Logger} [logger] - A logger like 'pino'
15
- * @property {boolean} [profiling=false] - Add profiling information.
16
- */
17
- /**
18
- *
19
- * @typedef {object} Ntuples
20
- * @property {string[]} [varname]
21
- * @property {string[]} [symbol]
22
- * @property {string[]} [vartype]
23
- * @property {string[]} [varform]
24
- * @property {number[]} [vardim]
25
- * @property {string[]} [units]
26
- * @property {number[]} [factor]
27
- * @property {number[]} [first]
28
- * @property {number[]} [last]
29
- * @property {number[]} [min]
30
- * @property {number[]} [max]
31
- * @property {string[]} [nucleus]
32
- */
33
- /**
34
- * @typedef { Record<string, any> } Spectrum
35
- * @property {Record<string, number[]>} [data]
36
- * @property {number} [firstX] - first X value
37
- * @property {number} [lastX] - last X value
38
- * @property {number} [deltaX] - distance between 2 consecutive x axis values
39
- * @property {number} [yFactor] - y axis scaling factor
40
- * @property {number} [xFactor] - x axis scaling factor
41
- * @property {number} [nbPoints] - Number of points
42
- */
43
- /**
44
- *
45
- * @typedef {object} MinMax
46
- * @property {number[][]} [z]
47
- * @property {number} minX
48
- * @property {number} maxX
49
- * @property {number} minY
50
- * @property {number} maxY
51
- * @property {number} minZ
52
- * @property {number} maxZ
53
- * @property {number} median
54
- */
55
- /**
56
- *
57
- * @typedef {object} Entry
58
- * @property {Spectrum[]} spectra
59
- * @property {Ntuples} ntuples
60
- * @property {object} meta
61
- * @property {object} info
62
- * @property {object} tmp
63
- * @property {string} [title]
64
- * @property {string} [dataType]
65
- * @property {string} [dataClass]
66
- * @property {boolean} [twoD]
67
- * @property {MinMax} [minMax]
68
- */
69
- /**
70
- *
71
- * @typedef { object } ConvertResult
72
- * @property { object[] | boolean } profiling
73
- * @property { string[] } logs
74
- * @property { object[] } entries
75
- * @property { Entry[] } flatten
76
- */
77
- /**
78
- * Parse a jcamp.
79
- * The data can be provide as a string or array buffer. In this later case
80
- * we will convert it first to a string before parsing.
81
- * @param {string|ArrayBuffer|Uint8Array} jcamp
82
- * @param {ConvertOptions} [options]
83
- * @returns {ConvertResult}
84
- */
85
- export function convert(jcamp: string | ArrayBuffer | Uint8Array, options?: ConvertOptions | undefined): ConvertResult;
86
- /**
87
- * Conversion options
88
- */
89
- export type ConvertOptions = {
90
- /**
91
- * - By default we don't keep meta information.
92
- */
93
- keepRecordsRegExp?: RegExp | undefined;
94
- /**
95
- * - Canonize the Labels (uppercase without symbol).
96
- */
97
- canonicDataLabels?: boolean | undefined;
98
- /**
99
- * - Canonize the metadata Labels (uppercase without symbol).
100
- */
101
- canonicMetadataLabels?: boolean | undefined;
102
- /**
103
- * - Convert numbers to Number.
104
- */
105
- dynamicTyping?: boolean | undefined;
106
- /**
107
- * - Remove the XY data.
108
- */
109
- withoutXY?: boolean | undefined;
110
- /**
111
- * - Special post-processing for GC / HPLC / MS.
112
- */
113
- chromatogram?: boolean | undefined;
114
- /**
115
- * - Force to keep the spectra in case of 2D.
116
- */
117
- keepSpectra?: boolean | undefined;
118
- /**
119
- * - Don't calculate countour in case of 2D.
120
- */
121
- noContour?: boolean | undefined;
122
- /**
123
- * - Number of positive / negative contour levels to calculate.
124
- */
125
- nbContourLevels?: number | undefined;
126
- /**
127
- * - Define for 2D the level as 5 times the median as default.
128
- */
129
- noiseMultiplier?: number | undefined;
130
- /**
131
- * - A logger like 'pino'
132
- */
133
- logger?: import("cheminfo-types").Logger | undefined;
134
- /**
135
- * - Add profiling information.
136
- */
137
- profiling?: boolean | undefined;
138
- };
139
- export type Ntuples = {
140
- varname?: string[] | undefined;
141
- symbol?: string[] | undefined;
142
- vartype?: string[] | undefined;
143
- varform?: string[] | undefined;
144
- vardim?: number[] | undefined;
145
- units?: string[] | undefined;
146
- factor?: number[] | undefined;
147
- first?: number[] | undefined;
148
- last?: number[] | undefined;
149
- min?: number[] | undefined;
150
- max?: number[] | undefined;
151
- nucleus?: string[] | undefined;
152
- };
153
- export type Spectrum = Record<string, any>;
154
- export type MinMax = {
155
- z?: number[][] | undefined;
156
- minX: number;
157
- maxX: number;
158
- minY: number;
159
- maxY: number;
160
- minZ: number;
161
- maxZ: number;
162
- median: number;
163
- };
164
- export type Entry = {
165
- spectra: Spectrum[];
166
- ntuples: Ntuples;
167
- meta: object;
168
- info: object;
169
- tmp: object;
170
- title?: string | undefined;
171
- dataType?: string | undefined;
172
- dataClass?: string | undefined;
173
- twoD?: boolean | undefined;
174
- minMax?: MinMax | undefined;
175
- };
176
- export type ConvertResult = {
177
- profiling: object[] | boolean;
178
- logs: string[];
179
- entries: object[];
180
- flatten: Entry[];
181
- };
182
- //# sourceMappingURL=convert.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../src/convert.js"],"names":[],"mappings":"AA8BA;;;;;;;;;;;;;;;GAeG;AAEH;;;;;;;;;;;;;;;GAeG;AAEH;;;;;;;;;GASG;AAEH;;;;;;;;;;;GAWG;AAEH;;;;;;;;;;;;;GAaG;AAEH;;;;;;;GAOG;AAEH;;;;;;;GAOG;AACH,+BAJW,MAAM,GAAC,WAAW,GAAC,UAAU,yCAE3B,aAAa,CAqSzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBA1Va,OAAO,MAAM,EAAE,GAAG,CAAC;;;UAcnB,MAAM;UACN,MAAM;UACN,MAAM;UACN,MAAM;UACN,MAAM;UACN,MAAM;YACN,MAAM;;;aAMN,QAAQ,EAAE;aACV,OAAO;UACP,MAAM;UACN,MAAM;SACN,MAAM;;;;;;;;eAWL,MAAM,EAAE,GAAG,OAAO;UAClB,MAAM,EAAE;aACR,MAAM,EAAE;aACR,KAAK,EAAE"}
@@ -1,405 +0,0 @@
1
- import { parseString } from 'dynamic-typing';
2
- import { ensureString } from 'ensure-string';
3
- import { isMSField, convertMSFieldToLabel } from './complexChromatogram';
4
- import convertToFloatArray from './convertToFloatArray';
5
- import fastParseXYData from './parse/fastParseXYData';
6
- import parsePeakTable from './parse/parsePeakTable';
7
- import parseXYA from './parse/parseXYA';
8
- import postProcessing from './postProcessing';
9
- import prepareNtuplesDatatable from './prepareNtuplesDatatable';
10
- import prepareSpectrum from './prepareSpectrum';
11
- import profiling from './profiling';
12
- // the following RegExp can only be used for XYdata, some peakTables have values with a "E-5" ...
13
- const ntuplesSeparatorRegExp = /[ \t]*,[ \t]*/;
14
- const defaultOptions = {
15
- keepRecordsRegExp: /^$/,
16
- canonicDataLabels: true,
17
- canonicMetadataLabels: false,
18
- dynamicTyping: true,
19
- withoutXY: false,
20
- chromatogram: false,
21
- keepSpectra: false,
22
- noContour: false,
23
- nbContourLevels: 7,
24
- noiseMultiplier: 5,
25
- profiling: false,
26
- };
27
- /**
28
- * Conversion options
29
- * @typedef {object} ConvertOptions
30
- * @property {RegExp} [keepRecordsRegExp=/^$/] - By default we don't keep meta information.
31
- * @property {boolean} [canonicDataLabels=true] - Canonize the Labels (uppercase without symbol).
32
- * @property {boolean} [canonicMetadataLabels=false] - Canonize the metadata Labels (uppercase without symbol).
33
- * @property {boolean} [dynamicTyping=false] - Convert numbers to Number.
34
- * @property {boolean} [withoutXY=false] - Remove the XY data.
35
- * @property {boolean} [chromatogram=false] - Special post-processing for GC / HPLC / MS.
36
- * @property {boolean} [keepSpectra=false] - Force to keep the spectra in case of 2D.
37
- * @property {boolean} [noContour=false] - Don't calculate countour in case of 2D.
38
- * @property {number} [nbContourLevels=7] - Number of positive / negative contour levels to calculate.
39
- * @property {number} [noiseMultiplier=5] - Define for 2D the level as 5 times the median as default.
40
- * @property {import('cheminfo-types').Logger} [logger] - A logger like 'pino'
41
- * @property {boolean} [profiling=false] - Add profiling information.
42
- */
43
- /**
44
- *
45
- * @typedef {object} Ntuples
46
- * @property {string[]} [varname]
47
- * @property {string[]} [symbol]
48
- * @property {string[]} [vartype]
49
- * @property {string[]} [varform]
50
- * @property {number[]} [vardim]
51
- * @property {string[]} [units]
52
- * @property {number[]} [factor]
53
- * @property {number[]} [first]
54
- * @property {number[]} [last]
55
- * @property {number[]} [min]
56
- * @property {number[]} [max]
57
- * @property {string[]} [nucleus]
58
- */
59
- /**
60
- * @typedef { Record<string, any> } Spectrum
61
- * @property {Record<string, number[]>} [data]
62
- * @property {number} [firstX] - first X value
63
- * @property {number} [lastX] - last X value
64
- * @property {number} [deltaX] - distance between 2 consecutive x axis values
65
- * @property {number} [yFactor] - y axis scaling factor
66
- * @property {number} [xFactor] - x axis scaling factor
67
- * @property {number} [nbPoints] - Number of points
68
- */
69
- /**
70
- *
71
- * @typedef {object} MinMax
72
- * @property {number[][]} [z]
73
- * @property {number} minX
74
- * @property {number} maxX
75
- * @property {number} minY
76
- * @property {number} maxY
77
- * @property {number} minZ
78
- * @property {number} maxZ
79
- * @property {number} median
80
- */
81
- /**
82
- *
83
- * @typedef {object} Entry
84
- * @property {Spectrum[]} spectra
85
- * @property {Ntuples} ntuples
86
- * @property {object} meta
87
- * @property {object} info
88
- * @property {object} tmp
89
- * @property {string} [title]
90
- * @property {string} [dataType]
91
- * @property {string} [dataClass]
92
- * @property {boolean} [twoD]
93
- * @property {MinMax} [minMax]
94
- */
95
- /**
96
- *
97
- * @typedef { object } ConvertResult
98
- * @property { object[] | boolean } profiling
99
- * @property { string[] } logs
100
- * @property { object[] } entries
101
- * @property { Entry[] } flatten
102
- */
103
- /**
104
- * Parse a jcamp.
105
- * The data can be provide as a string or array buffer. In this later case
106
- * we will convert it first to a string before parsing.
107
- * @param {string|ArrayBuffer|Uint8Array} jcamp
108
- * @param {ConvertOptions} [options]
109
- * @returns {ConvertResult}
110
- */
111
- export function convert(jcamp, options = {}) {
112
- jcamp = ensureString(jcamp);
113
- options = { ...defaultOptions, ...options };
114
- options.logger?.debug('Starting jcamp conversion');
115
- options.wantXY = !options.withoutXY;
116
- options.start = Date.now();
117
- let entriesFlat = [];
118
- let result = {
119
- profiling: options.profiling ? [] : false,
120
- logs: [],
121
- entries: [],
122
- };
123
- let tmpResult = { children: [] };
124
- let currentEntry = tmpResult;
125
- let parentsStack = [];
126
- let spectrum = {};
127
- if (typeof jcamp !== 'string') {
128
- throw new TypeError('the JCAMP should be a string');
129
- }
130
- profiling(result, 'Before split to LDRS', options);
131
- let ldrs = jcamp.replace(/[\r\n]+##/g, '\n##').split('\n##');
132
- profiling(result, 'Split to LDRS', options);
133
- if (ldrs[0])
134
- ldrs[0] = ldrs[0].replace(/^[\r\n ]*##/, '');
135
- for (let ldr of ldrs) {
136
- // This is a new LDR
137
- let position = ldr.indexOf('=');
138
- let dataLabel = position > 0 ? ldr.substring(0, position) : ldr;
139
- let dataValue = position > 0 ? ldr.substring(position + 1).trim() : '';
140
- let canonicDataLabel = dataLabel.replace(/[_ -]/g, '').toUpperCase();
141
- if (canonicDataLabel === 'DATATABLE') {
142
- let endLine = dataValue.indexOf('\n');
143
- if (endLine === -1)
144
- endLine = dataValue.indexOf('\r');
145
- if (endLine > 0) {
146
- // ##DATA TABLE= (X++(I..I)), XYDATA
147
- // We need to find the variables
148
- let infos = dataValue.substring(0, endLine).split(/[ ,;\t]+/);
149
- prepareNtuplesDatatable(currentEntry, spectrum, infos[0]);
150
- spectrum.datatable = infos[0];
151
- if (infos[1] && infos[1].indexOf('PEAKS') > -1) {
152
- canonicDataLabel = 'PEAKTABLE';
153
- }
154
- else if (infos[1] &&
155
- (infos[1].indexOf('XYDATA') || infos[0].indexOf('++') > 0)) {
156
- canonicDataLabel = 'XYDATA';
157
- if (spectrum.nbPoints) {
158
- spectrum.deltaX =
159
- (spectrum.lastX - spectrum.firstX) / (spectrum.nbPoints - 1);
160
- }
161
- }
162
- }
163
- }
164
- if (canonicDataLabel === 'XYDATA') {
165
- if (options.wantXY) {
166
- prepareSpectrum(spectrum);
167
- // well apparently we should still consider it is a PEAK TABLE if there are no '++' after
168
- if (dataValue.match(/.*\+\+.*/)) {
169
- // ex: (X++(Y..Y))
170
- if (spectrum.nbPoints) {
171
- spectrum.deltaX =
172
- (spectrum.lastX - spectrum.firstX) / (spectrum.nbPoints - 1);
173
- }
174
- fastParseXYData(spectrum, dataValue, result);
175
- }
176
- else {
177
- parsePeakTable(spectrum, dataValue, result);
178
- }
179
- currentEntry.spectra.push(spectrum);
180
- spectrum = {};
181
- }
182
- continue;
183
- }
184
- else if (canonicDataLabel === 'PEAKTABLE') {
185
- if (options.wantXY) {
186
- prepareSpectrum(spectrum);
187
- parsePeakTable(spectrum, dataValue, result);
188
- currentEntry.spectra.push(spectrum);
189
- spectrum = {};
190
- }
191
- continue;
192
- }
193
- if (canonicDataLabel === 'PEAKASSIGNMENTS') {
194
- if (options.wantXY) {
195
- if (dataValue.match(/.*([^A-Z]*).*/)) {
196
- // ex: (XYA)
197
- parseXYA(spectrum, dataValue);
198
- }
199
- currentEntry.spectra.push(spectrum);
200
- spectrum = {};
201
- }
202
- continue;
203
- }
204
- if (canonicDataLabel === 'TITLE') {
205
- let parentEntry = currentEntry;
206
- if (!parentEntry.children) {
207
- parentEntry.children = [];
208
- }
209
- currentEntry = {
210
- spectra: [],
211
- ntuples: {},
212
- info: {},
213
- meta: {},
214
- tmp: {}, // tmp information we need to keep for postprocessing
215
- };
216
- parentEntry.children.push(currentEntry);
217
- parentsStack.push(parentEntry);
218
- entriesFlat.push(currentEntry);
219
- currentEntry.title = dataValue;
220
- }
221
- else if (canonicDataLabel === 'DATATYPE') {
222
- currentEntry.dataType = dataValue;
223
- if (dataValue.match(/(^nd|\snd\s)/i)) {
224
- currentEntry.twoD = true;
225
- }
226
- }
227
- else if (canonicDataLabel === 'NTUPLES') {
228
- if (dataValue.match(/(^nd|\snd\s)/i)) {
229
- currentEntry.twoD = true;
230
- }
231
- }
232
- else if (canonicDataLabel === 'DATACLASS') {
233
- currentEntry.dataClass = dataValue;
234
- }
235
- else if (canonicDataLabel === 'XUNITS') {
236
- spectrum.xUnits = dataValue;
237
- }
238
- else if (canonicDataLabel === 'YUNITS') {
239
- spectrum.yUnits = dataValue;
240
- }
241
- else if (canonicDataLabel === 'FIRSTX') {
242
- spectrum.firstX = Number(dataValue);
243
- }
244
- else if (canonicDataLabel === 'LASTX') {
245
- spectrum.lastX = Number(dataValue);
246
- }
247
- else if (canonicDataLabel === 'FIRSTY') {
248
- spectrum.firstY = Number(dataValue);
249
- }
250
- else if (canonicDataLabel === 'LASTY') {
251
- spectrum.lastY = Number(dataValue);
252
- }
253
- else if (canonicDataLabel === 'NPOINTS') {
254
- spectrum.nbPoints = Number(dataValue);
255
- }
256
- else if (canonicDataLabel === 'XFACTOR') {
257
- spectrum.xFactor = Number(dataValue);
258
- }
259
- else if (canonicDataLabel === 'YFACTOR') {
260
- spectrum.yFactor = Number(dataValue);
261
- }
262
- else if (canonicDataLabel === 'MAXX') {
263
- spectrum.maxX = Number(dataValue);
264
- }
265
- else if (canonicDataLabel === 'MINX') {
266
- spectrum.minX = Number(dataValue);
267
- }
268
- else if (canonicDataLabel === 'MAXY') {
269
- spectrum.maxY = Number(dataValue);
270
- }
271
- else if (canonicDataLabel === 'MINY') {
272
- spectrum.minY = Number(dataValue);
273
- }
274
- else if (canonicDataLabel === 'DELTAX') {
275
- spectrum.deltaX = Number(dataValue);
276
- }
277
- else if (canonicDataLabel === '.OBSERVEFREQUENCY' ||
278
- canonicDataLabel === '$SFO1') {
279
- if (!spectrum.observeFrequency) {
280
- spectrum.observeFrequency = Number(dataValue);
281
- }
282
- }
283
- else if (canonicDataLabel === '.OBSERVENUCLEUS') {
284
- if (!spectrum.xType) {
285
- currentEntry.xType = dataValue.replace(/[^a-zA-Z0-9]/g, '');
286
- }
287
- }
288
- else if (canonicDataLabel === '$OFFSET') {
289
- // OFFSET for Bruker spectra
290
- currentEntry.shiftOffsetNum = 0;
291
- if (!spectrum.shiftOffsetVal) {
292
- spectrum.shiftOffsetVal = Number(dataValue);
293
- }
294
- }
295
- else if (canonicDataLabel === '$REFERENCEPOINT') {
296
- // OFFSET for Varian spectra
297
- // if we activate this part it does not work for ACD specmanager
298
- // } else if (canonicDataLabel=='.SHIFTREFERENCE') { // OFFSET FOR Bruker Spectra
299
- // var parts = dataValue.split(/ *, */);
300
- // currentEntry.shiftOffsetNum = parseInt(parts[2].trim());
301
- // spectrum.shiftOffsetVal = Number(parts[3].trim());
302
- }
303
- else if (canonicDataLabel === 'VARNAME') {
304
- currentEntry.ntuples.varname = dataValue.split(ntuplesSeparatorRegExp);
305
- }
306
- else if (canonicDataLabel === 'SYMBOL') {
307
- currentEntry.ntuples.symbol = dataValue.split(ntuplesSeparatorRegExp);
308
- }
309
- else if (canonicDataLabel === 'VARTYPE') {
310
- currentEntry.ntuples.vartype = dataValue.split(ntuplesSeparatorRegExp);
311
- }
312
- else if (canonicDataLabel === 'VARFORM') {
313
- currentEntry.ntuples.varform = dataValue.split(ntuplesSeparatorRegExp);
314
- }
315
- else if (canonicDataLabel === 'VARDIM') {
316
- currentEntry.ntuples.vardim = convertToFloatArray(dataValue.split(ntuplesSeparatorRegExp));
317
- }
318
- else if (canonicDataLabel === 'UNITS') {
319
- currentEntry.ntuples.units = dataValue.split(ntuplesSeparatorRegExp);
320
- }
321
- else if (canonicDataLabel === 'FACTOR') {
322
- currentEntry.ntuples.factor = convertToFloatArray(dataValue.split(ntuplesSeparatorRegExp));
323
- }
324
- else if (canonicDataLabel === 'FIRST') {
325
- currentEntry.ntuples.first = convertToFloatArray(dataValue.split(ntuplesSeparatorRegExp));
326
- }
327
- else if (canonicDataLabel === 'LAST') {
328
- currentEntry.ntuples.last = convertToFloatArray(dataValue.split(ntuplesSeparatorRegExp));
329
- }
330
- else if (canonicDataLabel === 'MIN') {
331
- currentEntry.ntuples.min = convertToFloatArray(dataValue.split(ntuplesSeparatorRegExp));
332
- }
333
- else if (canonicDataLabel === 'MAX') {
334
- currentEntry.ntuples.max = convertToFloatArray(dataValue.split(ntuplesSeparatorRegExp));
335
- }
336
- else if (canonicDataLabel === '.NUCLEUS') {
337
- if (currentEntry.ntuples) {
338
- currentEntry.ntuples.nucleus = dataValue.split(ntuplesSeparatorRegExp);
339
- }
340
- }
341
- else if (canonicDataLabel === 'PAGE') {
342
- spectrum.page = dataValue.trim();
343
- spectrum.pageValue = Number(dataValue.replace(/^.*=/, ''));
344
- spectrum.pageSymbol = spectrum.page.replace(/[=].*/, '');
345
- }
346
- else if (canonicDataLabel === 'RETENTIONTIME') {
347
- spectrum.pageValue = Number(dataValue);
348
- }
349
- else if (isMSField(canonicDataLabel)) {
350
- spectrum[convertMSFieldToLabel(canonicDataLabel)] = dataValue;
351
- }
352
- else if (canonicDataLabel === 'SAMPLEDESCRIPTION') {
353
- spectrum.sampleDescription = dataValue;
354
- }
355
- else if (canonicDataLabel.startsWith('$NUC')) {
356
- if (!currentEntry.tmp[canonicDataLabel] && !dataValue.includes('off')) {
357
- currentEntry.tmp[canonicDataLabel] = dataValue.replace(/[<>]/g, '');
358
- }
359
- }
360
- else if (canonicDataLabel === 'END') {
361
- currentEntry = parentsStack.pop();
362
- }
363
- if (currentEntry &&
364
- currentEntry.info &&
365
- currentEntry.meta &&
366
- canonicDataLabel.match(options.keepRecordsRegExp)) {
367
- let value = dataValue.trim();
368
- let target, label;
369
- if (dataLabel.startsWith('$')) {
370
- label = options.canonicMetadataLabels
371
- ? canonicDataLabel.substring(1)
372
- : dataLabel.substring(1);
373
- target = currentEntry.meta;
374
- }
375
- else {
376
- label = options.canonicDataLabels ? canonicDataLabel : dataLabel;
377
- target = currentEntry.info;
378
- }
379
- if (options.dynamicTyping) {
380
- value = parseString(value);
381
- }
382
- if (target[label]) {
383
- if (!Array.isArray(target[label])) {
384
- target[label] = [target[label]];
385
- }
386
- target[label].push(value);
387
- }
388
- else {
389
- target[label] = value;
390
- }
391
- }
392
- }
393
- profiling(result, 'Finished parsing', options);
394
- postProcessing(entriesFlat, result, options);
395
- profiling(result, 'Total time', options);
396
- /*
397
- if (result.children && result.children.length>0) {
398
- result = { ...result, ...result.children[0] };
399
- }
400
- */
401
- result.entries = tmpResult.children;
402
- result.flatten = entriesFlat;
403
- return result;
404
- }
405
- //# sourceMappingURL=convert.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"convert.js","sourceRoot":"","sources":["../src/convert.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,eAAe,MAAM,yBAAyB,CAAC;AACtD,OAAO,cAAc,MAAM,wBAAwB,CAAC;AACpD,OAAO,QAAQ,MAAM,kBAAkB,CAAC;AACxC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAChE,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,iGAAiG;AACjG,MAAM,sBAAsB,GAAG,eAAe,CAAC;AAE/C,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SAAS,CAAC;gBACjE,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC;aAC5B;YAED,IAAI,OAAO,CAAC,aAAa,EAAE;gBACzB,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;aAC5B;YACD,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE;gBACjB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE;oBACjC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;iBACjC;gBACD,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aAC3B;iBAAM;gBACL,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;aACvB;SACF;KACF;IAED,SAAS,CAAC,MAAM,EAAE,kBAAkB,EAAE,OAAO,CAAC,CAAC;IAE/C,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAE7C,SAAS,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;IAEzC;;;;MAIE;IACF,MAAM,CAAC,OAAO,GAAG,SAAS,CAAC,QAAQ,CAAC;IACpC,MAAM,CAAC,OAAO,GAAG,WAAW,CAAC;IAE7B,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1,2 +0,0 @@
1
- export default function convertToFloatArray(stringArray: any): number[];
2
- //# sourceMappingURL=convertToFloatArray.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"convertToFloatArray.d.ts","sourceRoot":"","sources":["../src/convertToFloatArray.js"],"names":[],"mappings":"AAAA,wEAMC"}
@@ -1,8 +0,0 @@
1
- export default function convertToFloatArray(stringArray) {
2
- let floatArray = [];
3
- for (let i = 0; i < stringArray.length; i++) {
4
- floatArray.push(Number(stringArray[i]));
5
- }
6
- return floatArray;
7
- }
8
- //# sourceMappingURL=convertToFloatArray.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"convertToFloatArray.js","sourceRoot":"","sources":["../src/convertToFloatArray.js"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,WAAW;IACrD,IAAI,UAAU,GAAG,EAAE,CAAC;IACpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAC3C,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KACzC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC"}
@@ -1,29 +0,0 @@
1
- /**
2
- *
3
- * @typedef {object} CreateTreeOptions
4
- * @property {boolean} [flatten=false]
5
- */
6
- /**
7
- *
8
- * @typedef {object} Tree
9
- * @property {string} title
10
- * @property {string} jcamp
11
- * @property {Tree[]} [children]
12
- */
13
- /**
14
- * Parse the jcamp to extract the structure as a tree.
15
- *
16
- * @param {string|ArrayBuffer|Uint8Array} jcamp
17
- * @param {CreateTreeOptions} [options={}]
18
- * @returns {Tree[]}
19
- */
20
- export function createTree(jcamp: string | ArrayBuffer | Uint8Array, options?: CreateTreeOptions | undefined): Tree[];
21
- export type CreateTreeOptions = {
22
- flatten?: boolean | undefined;
23
- };
24
- export type Tree = {
25
- title: string;
26
- jcamp: string;
27
- children?: Tree[] | undefined;
28
- };
29
- //# sourceMappingURL=createTree.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createTree.d.ts","sourceRoot":"","sources":["../src/createTree.js"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH;;;;;;GAMG;AAEH;;;;;;GAMG;AACH,kCAJW,MAAM,GAAC,WAAW,GAAC,UAAU,4CAE3B,IAAI,EAAE,CA8ElB;;;;;WAxFa,MAAM;WACN,MAAM"}