@gmod/tabix 3.3.9 → 3.4.0

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/README.md CHANGED
@@ -7,280 +7,125 @@ Read Tabix-indexed files using either .tbi or .csi indexes.
7
7
 
8
8
  ## Install
9
9
 
10
- $ npm install @gmod/tabix
10
+ ```bash
11
+ npm install @gmod/tabix
12
+ ```
11
13
 
12
14
  ## Usage
13
15
 
14
- ### Importing the module
15
-
16
16
  ```typescript
17
17
  import { TabixIndexedFile } from '@gmod/tabix'
18
- ```
19
18
 
20
- ### Single file bundle
19
+ // Local file — TBI index assumed at path + '.tbi'
20
+ const file = new TabixIndexedFile({ path: 'file.vcf.gz' })
21
21
 
22
- You can use tabix-js without NPM also with the tabix-bundle.js. See the example
23
- directory for usage with script tag [example/index.html](example/index.html)
24
-
25
- ```html
26
- <script src="https://unpkg.com/@gmod/tabix/dist/tabix-bundle.js"></script>
27
- ```
22
+ // CSI index
23
+ const file = new TabixIndexedFile({
24
+ path: 'file.vcf.gz',
25
+ csiPath: 'file.vcf.gz.csi',
26
+ })
28
27
 
29
- ### TabixIndexedFile constructor
28
+ // Remote files
29
+ const file = new TabixIndexedFile({
30
+ url: 'https://example.com/file.vcf.gz',
31
+ tbiUrl: 'https://example.com/file.vcf.gz.tbi',
32
+ })
30
33
 
31
- Basic usage of TabixIndexedFile under node.js supplies a path and optionally a
32
- tbiPath to the constructor. If no tbiPath is supplied, it assumes that the
33
- path+'.tbi' is the location of the tbiPath.
34
+ // Or with a filehandle from generic-filehandle2
35
+ import { RemoteFile } from 'generic-filehandle2'
34
36
 
35
- ```typescript
36
- const tbiIndexed = new TabixIndexedFile({
37
- path: 'path/to/my/file.gz',
38
- tbiPath: 'path/to/my/file.gz.tbi',
37
+ const file = new TabixIndexedFile({
38
+ filehandle: new RemoteFile('https://example.com/file.vcf.gz'),
39
+ tbiFilehandle: new RemoteFile('https://example.com/file.vcf.gz.tbi'),
39
40
  })
40
41
  ```
41
42
 
42
- You can also use CSI indexes:
43
+ ### getLines
44
+
45
+ Fetches lines overlapping a region. `start`/`end` are 0-based half-open coordinates (unlike the tabix CLI which uses 1-based closed).
43
46
 
44
47
  ```typescript
45
- const csiIndexed = new TabixIndexedFile({
46
- path: 'path/to/my/file.gz',
47
- csiPath: 'path/to/my/file.gz.csi',
48
- })
48
+ const lines: string[] = []
49
+ await file.getLines('chr1', 200, 300, line => lines.push(line))
49
50
  ```
50
51
 
51
- #### TabixIndexedFile constructor with remote files
52
+ The callback also receives the virtual file offset and parsed coordinates for the line:
52
53
 
53
54
  ```typescript
54
- const remoteTbiIndexed = new TabixIndexedFile({
55
- url: 'http://yourhost/file.vcf.gz',
56
- tbiUrl: 'http://yourhost/file.vcf.gz.tbi', // can also be csiUrl
55
+ await file.getLines('chr1', 200, 300, (line, fileOffset, start, end) => {
56
+ lines.push(line)
57
57
  })
58
58
  ```
59
59
 
60
- You can also supply a filehandle-like object from
61
- [generic-filehandle2](https://github.com/GMOD/generic-filehandle2):
60
+ Pass an options object to use an `AbortSignal`:
62
61
 
63
62
  ```typescript
64
- import { RemoteFile } from 'generic-filehandle2'
65
-
66
- const remoteTbiIndexed = new TabixIndexedFile({
67
- filehandle: new RemoteFile('http://yourhost/file.vcf.gz'),
68
- tbiFilehandle: new RemoteFile('http://yourhost/file.vcf.gz.tbi'), // can also be csiFilehandle
63
+ const aborter = new AbortController()
64
+ await file.getLines('chr1', 200, 300, {
65
+ lineCallback: (line, fileOffset, start, end) => lines.push(line),
66
+ signal: aborter.signal,
69
67
  })
70
68
  ```
71
69
 
72
- ### getLines
73
-
74
- The basic function this module provides is just called `getLines` and it returns
75
- text contents from the tabix file (it unzips the bgzipped data) and supplies it
76
- to a callback that you provide one line at a time.
70
+ Notes:
71
+ - Meta/comment lines are skipped
72
+ - Line strings have no trailing whitespace
73
+ - Pass `undefined` for `end` to read to the end of the contig
77
74
 
78
- Important: the `start` and `end` values that are supplied to `getLines` are
79
- 0-based half-open coordinates. This is different from the 1-based values that
80
- are supplied to the tabix command line tool
75
+ ### Without NPM (CDN)
81
76
 
82
- ```typescript
83
- const lines = []
84
- await tbiIndexed.getLines(
85
- 'ctgA',
86
- 200,
87
- 300,
88
- function (line, fileOffset, start, end) {
89
- lines.push(line)
90
- },
91
- )
77
+ ```html
78
+ <script src="https://unpkg.com/@gmod/tabix/dist/tabix-bundle.js"></script>
92
79
  ```
93
80
 
94
- After running this, `lines` contains the matching lines from the file. The
95
- callback receives:
81
+ See [example/index.html](example/index.html) for a working demo.
96
82
 
97
- - `line` — the raw line string
98
- - `fileOffset` — virtual file offset, useful as a unique line identifier
99
- - `start` / `end` — the parsed coordinates of that line (0-based half-open)
83
+ ## API
100
84
 
101
- You can also pass an options object instead of a bare callback:
85
+ ### `new TabixIndexedFile(args)`
102
86
 
103
- ```typescript
104
- const lines = []
105
- const aborter = new AbortController()
106
- await tbiIndexed.getLines('ctgA', 200, 300, {
107
- lineCallback: (line, fileOffset, start, end) => lines.push(line),
108
- signal: aborter.signal, // an optional AbortSignal from an AbortController
109
- })
110
- ```
111
-
112
- Notes about the returned values of `getLines`:
87
+ | Arg | Type | Description |
88
+ | --- | --- | --- |
89
+ | `path` | `string?` | Local file path |
90
+ | `url` | `string?` | Remote URL |
91
+ | `filehandle` | `GenericFilehandle?` | Custom filehandle (from [generic-filehandle2](https://github.com/GMOD/generic-filehandle2)) |
92
+ | `tbiPath` | `string?` | TBI index path (defaults to `path + '.tbi'`) |
93
+ | `tbiUrl` | `string?` | TBI index URL |
94
+ | `tbiFilehandle` | `GenericFilehandle?` | TBI index filehandle |
95
+ | `csiPath` | `string?` | CSI index path |
96
+ | `csiUrl` | `string?` | CSI index URL |
97
+ | `csiFilehandle` | `GenericFilehandle?` | CSI index filehandle |
98
+ | `chunkCacheSize` | `number?` | Chunk LRU cache size in bytes (default 5 MiB) |
113
99
 
114
- - commented (meta) lines are skipped.
115
- - line strings do not include any trailing whitespace characters.
116
- - if `getLines` is called with an undefined `end` parameter it gets all lines
117
- from start going to the end of the contig e.g.
100
+ ### `getLines(refName, start, end, opts)`
118
101
 
119
- ```typescript
120
- const lines = []
121
- await tbiIndexed.getLines('ctgA', 0, undefined, line => lines.push(line))
122
- console.log(lines)
123
- ```
102
+ Calls `opts` (or `opts.lineCallback`) for each line overlapping `[start, end)`.
124
103
 
125
- ## API (auto-generated)
126
-
127
- ### TabixIndexedFile
128
-
129
- ##### Table of Contents
130
-
131
- - [constructor](#constructor)
132
- - [Parameters](#parameters)
133
- - [getLines](#getlines)
134
- - [Parameters](#parameters-1)
135
- - [getHeaderBuffer](#getheaderbuffer)
136
- - [Parameters](#parameters-2)
137
- - [getHeader](#getheader)
138
- - [Parameters](#parameters-3)
139
- - [getReferenceSequenceNames](#getreferencesequencenames)
140
- - [Parameters](#parameters-4)
141
- - [checkLine](#checkline)
142
- - [Parameters](#parameters-5)
143
- - [lineCount](#linecount)
144
- - [Parameters](#parameters-6)
145
- - [readChunk](#readchunk)
146
- - [Parameters](#parameters-7)
147
-
148
- #### constructor
149
-
150
- ##### Parameters
151
-
152
- - `args`
153
- **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;
154
- - `args.path`
155
- **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?**&#x20;
156
- - `args.filehandle` **filehandle?**&#x20;
157
- - `args.url`
158
- **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?**&#x20;
159
- - `args.tbiPath`
160
- **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?**&#x20;
161
- - `args.tbiUrl` **tbiUrl?**&#x20;
162
- - `args.tbiFilehandle` **filehandle?**&#x20;
163
- - `args.csiPath`
164
- **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?**&#x20;
165
- - `args.csiUrl` **csiUrl?**&#x20;
166
- - `args.csiFilehandle` **filehandle?**&#x20;
167
- - `args.yieldTime`
168
- **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?**
169
- yield to main thread after N milliseconds if reading features is taking a
170
- long time to avoid hanging main thread (optional, default `500`)
171
- - `args.renameRefSeqs`
172
- **[function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?**
173
- optional function with sig `string => string` to transform reference
174
- sequence names for the purpose of indexing and querying. note that the data
175
- that is returned is not altered, just the names of the reference sequences
176
- that are used for querying. (optional, default `n=>n`)
177
- - `args.chunkCacheSize` (optional, default `5*2**20`)
178
-
179
- #### getLines
180
-
181
- ##### Parameters
182
-
183
- - `refName`
184
- **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
185
- name of the reference sequence
186
- - `start`
187
- **([number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)
188
- |
189
- [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))**
190
- start of the region (0-based half-open)
191
- - `end`
192
- **([number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)
193
- |
194
- [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))**
195
- end of the region (0-based half-open)
196
- - `opts` **(GetLinesOpts | GetLinesCallback)** callback invoked for each line,
197
- or an options object with `lineCallback` and optional `signal`
198
-
199
- Returns **any** promise that is resolved when the whole read is finished,
200
- rejected on error
201
-
202
- #### getHeaderBuffer
203
-
204
- get a buffer containing the "header" region of the file, which are the bytes up
205
- to the first non-meta line
206
-
207
- ##### Parameters
208
-
209
- - `opts` **Options** (optional, default `{}`)
210
-
211
- #### getHeader
212
-
213
- get a string containing the "header" region of the file, is the portion up to
214
- the first non-meta line
215
-
216
- ##### Parameters
217
-
218
- - `opts` **Options** (optional, default `{}`)
219
-
220
- Returns
221
- **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)**
222
- for a string
223
-
224
- #### getReferenceSequenceNames
225
-
226
- get an array of reference sequence names, in the order in which they occur in
227
- the file. reference sequence renaming is not applied to these names.
228
-
229
- ##### Parameters
230
-
231
- - `opts` **Options** (optional, default `{}`)
232
-
233
- #### checkLine
234
-
235
- ##### Parameters
236
-
237
- - `metadata`
238
- **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
239
- metadata object from the parsed index, containing columnNumbers, metaChar, and
240
- format
241
- - `regionRefName`
242
- **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
243
- - `regionStart`
244
- **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
245
- region start coordinate (0-based-half-open)
246
- - `regionEnd`
247
- **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
248
- region end coordinate (0-based-half-open)
249
- - `line`
250
- **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
104
+ Callback signature: `(line: string, fileOffset: number, start: number, end: number) => void`
251
105
 
252
- Returns
253
- **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
254
- like `{startCoordinate, overlaps}`. overlaps is boolean, true if line is a data
255
- line that overlaps the given region
106
+ ### `getHeader(opts?): Promise<string>`
256
107
 
257
- #### lineCount
108
+ Returns all comment/meta lines before the first data line as a string.
258
109
 
259
- return the number of data lines in the given reference sequence
110
+ ### `getHeaderBuffer(opts?): Promise<Uint8Array>`
260
111
 
261
- ##### Parameters
112
+ Returns the header as raw bytes.
262
113
 
263
- - `refName`
264
- **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
265
- reference sequence name
266
- - `opts` **Options** (optional, default `{}`)
114
+ ### `getReferenceSequenceNames(opts?): Promise<string[]>`
267
115
 
268
- Returns **any** number of data lines present on that reference sequence
116
+ Returns reference sequence names in index order. `renameRefSeqs` is not applied to these names.
269
117
 
270
- #### readChunk
118
+ ### `lineCount(refName, opts?): Promise<number>`
271
119
 
272
- read and uncompress the data in a chunk (composed of one or more contiguous
273
- bgzip blocks) of the file
120
+ Returns the number of data lines on the given reference, or `-1` if the reference is not in the index.
274
121
 
275
- ##### Parameters
122
+ ### `bytesForRegions(regions, opts?): Promise<number>`
276
123
 
277
- - `c` **Chunk**&#x20;
278
- - `opts` **Options** (optional, default `{}`)
124
+ Estimates the compressed byte size of index chunks covering the given regions. Useful for deciding whether a request is too large before calling `getLines`.
279
125
 
280
126
  ## Publishing
281
127
 
282
- [Trusted publishing](https://docs.npmjs.com/about-trusted-publishing) via GitHub
283
- Actions.
128
+ [Trusted publishing](https://docs.npmjs.com/about-trusted-publishing) via GitHub Actions.
284
129
 
285
130
  ```bash
286
131
  pnpm version patch # or minor/major
@@ -288,10 +133,7 @@ pnpm version patch # or minor/major
288
133
 
289
134
  ## Academic Use
290
135
 
291
- This package was written with funding from the [NHGRI](http://genome.gov) as
292
- part of the [JBrowse](http://jbrowse.org) project. If you use it in an academic
293
- project that you publish, please cite the most recent JBrowse paper, which will
294
- be linked from [jbrowse.org](http://jbrowse.org).
136
+ This package was written with funding from the [NHGRI](http://genome.gov) as part of the [JBrowse](http://jbrowse.org) project. If you use it in an academic project that you publish, please cite the most recent JBrowse paper, which will be linked from [jbrowse.org](http://jbrowse.org).
295
137
 
296
138
  ## License
297
139
 
package/dist/csi.d.ts CHANGED
@@ -10,7 +10,9 @@ export default class CSI extends IndexFile {
10
10
  constructor(args: {
11
11
  filehandle: GenericFilehandle;
12
12
  });
13
+ /** @internal */
13
14
  indexCov(): void;
15
+ /** @internal */
14
16
  _parse(opts?: Options): Promise<{
15
17
  csi: boolean;
16
18
  refCount: number;
@@ -54,8 +56,6 @@ export default class CSI extends IndexFile {
54
56
  format: string;
55
57
  }>;
56
58
  blocksForRange(refName: string, min: number, max: number, opts?: Options): Promise<Chunk[]>;
57
- /**
58
- * calculate the list of bins that may overlap with region [beg,end) (zero-based half-open)
59
- */
59
+ /** @internal */
60
60
  reg2bins(beg: number, end: number): (readonly [number, number])[];
61
61
  }
package/dist/csi.js CHANGED
@@ -28,9 +28,11 @@ class CSI extends indexFile_ts_1.default {
28
28
  this.depth = 0;
29
29
  this.minShift = 0;
30
30
  }
31
+ /** @internal */
31
32
  indexCov() {
32
33
  throw new Error('CSI indexes do not support indexcov');
33
34
  }
35
+ /** @internal */
34
36
  async _parse(opts = {}) {
35
37
  const buf = await this.filehandle.readFile({ signal: opts.signal });
36
38
  const bytes = (await (0, bgzf_filehandle_1.unzip)(buf));
@@ -159,9 +161,7 @@ class CSI extends indexFile_ts_1.default {
159
161
  }
160
162
  return (0, util_ts_1.optimizeChunks)(chunks);
161
163
  }
162
- /**
163
- * calculate the list of bins that may overlap with region [beg,end) (zero-based half-open)
164
- */
164
+ /** @internal */
165
165
  reg2bins(beg, end) {
166
166
  const maxPos = 2 ** (this.minShift + this.depth * 3);
167
167
  if (end > maxPos) {
package/dist/csi.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"csi.js","sourceRoot":"","sources":["../src/csi.ts"],"names":[],"mappings":";;;;;AAAA,2DAA6C;AAE7C,0DAA8B;AAC9B,kEAAsC;AACtC,uCAMkB;AAClB,yDAA8C;AAM9C,MAAM,UAAU,GAAG,UAAU,CAAA,CAAC,QAAQ;AACtC,MAAM,UAAU,GAAG,UAAU,CAAA,CAAC,QAAQ;AAEtC,gFAAgF;AAChF,wDAAwD;AACxD,SAAS,MAAM,CAAC,GAAW,EAAE,IAAY;IACvC,OAAO,GAAG,GAAG,CAAC,IAAI,IAAI,CAAA;AACxB,CAAC;AACD,SAAS,MAAM,CAAC,GAAW,EAAE,IAAY;IACvC,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,IAAI,IAAI,CAAC,CAAA;AACpC,CAAC;AAED,MAAqB,GAAI,SAAQ,sBAAS;IAChC,YAAY,CAAQ;IACpB,KAAK,CAAQ;IACb,QAAQ,CAAQ;IACxB,YAAY,IAAuC;QACjD,KAAK,CAAC,IAAI,C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/B,MAAM,MAAM,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAA;QACpD,IAAI,GAAG,GAAG,MAAM,EAAE,CAAC;YACjB,GAAG,GAAG,MAAM,CAAA;QACd,CAAC;QACD,GAAG,IAAI,CAAC,CAAA;QACR,IAAI,CAAC,GAAG,CAAC,CAAA;QACT,IAAI,CAAC,GAAG,CAAC,CAAA;QACT,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC,CAAA;QACtC,MAAM,IAAI,GAAG,EAAE,CAAA;QACf,OAAO,CAAC,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;YAC9D,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;YAC5B,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;YAC5B,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;gBAC5C,MAAM,IAAI,KAAK,CACb,SAAS,GAAG,IAAI,GAAG,mDAAmD,IAAI,CAAC,QAAQ,WAAW,IAAI,CAAC,KAAK,0DAA0D,CACnK,CAAA;YACH,CAAC;YACD,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAU,CAAC,CAAA;QAC5B,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AAzLD,sBAyLC"}
@@ -40,7 +40,9 @@ export default abstract class IndexFile {
40
40
  filehandle: GenericFilehandle;
41
41
  });
42
42
  protected abstract _parse(opts: Options): Promise<IndexData>;
43
+ /** @internal */
43
44
  lineCount(refName: string, opts?: Options): Promise<number>;
45
+ /** @internal */
44
46
  getMetadata(opts?: Options): Promise<{
45
47
  refNameToId: Record<string, number>;
46
48
  refIdToName: string[];
@@ -62,7 +64,10 @@ export default abstract class IndexFile {
62
64
  csiVersion?: number;
63
65
  depth?: number;
64
66
  }>;
67
+ /** @internal */
65
68
  abstract blocksForRange(refName: string, start: number, end: number, opts: Options): Promise<Chunk[]>;
69
+ /** @internal */
66
70
  parse(opts?: Options): Promise<IndexData>;
71
+ /** @internal */
67
72
  hasRefSeq(seqId: number, opts?: Options): Promise<boolean>;
68
73
  }
package/dist/indexFile.js CHANGED
@@ -6,6 +6,7 @@ class IndexFile {
6
6
  constructor({ filehandle }) {
7
7
  this.filehandle = filehandle;
8
8
  }
9
+ /** @internal */
9
10
  async lineCount(refName, opts = {}) {
10
11
  const indexData = await this.parse(opts);
11
12
  const refId = indexData.refNameToId[refName];
@@ -14,10 +15,12 @@ class IndexFile {
14
15
  }
15
16
  return indexData.indices(refId)?.stats?.lineCount ?? -1;
16
17
  }
18
+ /** @internal */
17
19
  async getMetadata(opts = {}) {
18
20
  const { indices: _indices, ...rest } = await this.parse(opts);
19
21
  return rest;
20
22
  }
23
+ /** @internal */
21
24
  async parse(opts = {}) {
22
25
  this.parseP ??= this._parse(opts).catch((error) => {
23
26
  this.parseP = undefined;
@@ -25,6 +28,7 @@ class IndexFile {
25
28
  });
26
29
  return this.parseP;
27
30
  }
31
+ /** @internal */
28
32
  async hasRefSeq(seqId, opts = {}) {
29
33
  const idx = await this.parse(opts);
30
34
  return !!idx.indices(seqId)?.binIndex;
@@ -1 +1 @@
1
- {"version":3,"file":"indexFile.js","sourceRoot":"","sources":["../src/indexFile.ts"],"names":[],"mappings":";;AAiCA,MAA8B,SAAS;IAC9B,UAAU,CAAmB;IAC5B,MAAM,CAAqB;IAEnC,YAAY,EAAE,UAAU,EAAqC;QAC3D,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;IAC9B,CAAC;IAIM,KAA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