@jbrowse/plugin-gtf 5.0.0-beta.13 → 5.0.0-beta.14
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/esm/GtfAdapter/configSchema.d.ts +2 -2
- package/esm/GtfAdapter/configSchema.js +3 -2
- package/esm/GtfTabixAdapter/GtfTabixAdapter.d.ts +2 -0
- package/esm/GtfTabixAdapter/GtfTabixAdapter.js +6 -0
- package/esm/GtfTabixAdapter/configSchema.d.ts +1 -4
- package/esm/GtfTabixAdapter/configSchema.js +3 -4
- package/esm/util.d.ts +1 -1
- package/package.json +4 -4
|
@@ -5,8 +5,8 @@ export declare function normalizeSnapshot(snap: Record<string, unknown>): Record
|
|
|
5
5
|
* #category adapter
|
|
6
6
|
* #trackType FeatureTrack
|
|
7
7
|
* #fileFormat feature | GTF (plain) | Loaded entirely into memory; for small files
|
|
8
|
-
*
|
|
9
|
-
* into memory, so
|
|
8
|
+
* Reads plain-text GTF files, optionally gzipped. The adapter loads the whole
|
|
9
|
+
* file into memory, so use `GtfTabixAdapter` for large files.
|
|
10
10
|
*
|
|
11
11
|
* #example
|
|
12
12
|
* The `uri` shorthand works for plain or gzipped GTF:
|
|
@@ -7,8 +7,8 @@ export function normalizeSnapshot(snap) {
|
|
|
7
7
|
* #category adapter
|
|
8
8
|
* #trackType FeatureTrack
|
|
9
9
|
* #fileFormat feature | GTF (plain) | Loaded entirely into memory; for small files
|
|
10
|
-
*
|
|
11
|
-
* into memory, so
|
|
10
|
+
* Reads plain-text GTF files, optionally gzipped. The adapter loads the whole
|
|
11
|
+
* file into memory, so use `GtfTabixAdapter` for large files.
|
|
12
12
|
*
|
|
13
13
|
* #example
|
|
14
14
|
* The `uri` shorthand works for plain or gzipped GTF:
|
|
@@ -41,6 +41,7 @@ const GtfAdapter = ConfigurationSchema('GtfAdapter', {
|
|
|
41
41
|
},
|
|
42
42
|
}, {
|
|
43
43
|
explicitlyTyped: true,
|
|
44
|
+
closed: true,
|
|
44
45
|
/**
|
|
45
46
|
* #preProcessSnapshot
|
|
46
47
|
*
|
|
@@ -4,6 +4,8 @@ import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
|
4
4
|
import type { Feature } from '@jbrowse/core/util';
|
|
5
5
|
import type { Region } from '@jbrowse/core/util/types';
|
|
6
6
|
export default class GtfTabixAdapter extends BaseFeatureDataAdapter<GtfTabixAdapterConfig> {
|
|
7
|
+
private file?;
|
|
8
|
+
freeResources(): void;
|
|
7
9
|
private configure;
|
|
8
10
|
getRefNames(opts?: BaseOptions): Promise<string[]>;
|
|
9
11
|
getHeader(opts?: BaseOptions): Promise<string>;
|
|
@@ -7,6 +7,11 @@ import { ObservableCreate } from '@jbrowse/core/util/rxjs';
|
|
|
7
7
|
import { readTabixLinesRedispatched } from '@jbrowse/core/util/tabix';
|
|
8
8
|
import { aggregateGtfFeatures, parseGtfToFeatures } from '../util.js';
|
|
9
9
|
export default class GtfTabixAdapter extends BaseFeatureDataAdapter {
|
|
10
|
+
// set once the file is open, for dataAdapterCache's eviction to clear
|
|
11
|
+
file;
|
|
12
|
+
freeResources() {
|
|
13
|
+
this.file?.clearChunkCache();
|
|
14
|
+
}
|
|
10
15
|
configure = cachedSetup({
|
|
11
16
|
label: 'Downloading index',
|
|
12
17
|
setup: async (opts, onProgress) => {
|
|
@@ -15,6 +20,7 @@ export default class GtfTabixAdapter extends BaseFeatureDataAdapter {
|
|
|
15
20
|
...openTabixIndexFilehandle(this.getConf(['index', 'location']), this.getConf(['index', 'indexType']), this.pluginManager),
|
|
16
21
|
chunkCacheBudget: decompressedBytesBudget,
|
|
17
22
|
});
|
|
23
|
+
this.file = gtf;
|
|
18
24
|
return {
|
|
19
25
|
gtf,
|
|
20
26
|
dontRedispatchSet: new Set(this.getConf('dontRedispatch')),
|
|
@@ -5,7 +5,7 @@ export declare function normalizeSnapshot(snap: Record<string, unknown>): Record
|
|
|
5
5
|
* #category adapter
|
|
6
6
|
* #trackType FeatureTrack
|
|
7
7
|
* #fileFormat feature | GTF (tabix)
|
|
8
|
-
*
|
|
8
|
+
* Reads bgzip-compressed, tabix-indexed GTF files.
|
|
9
9
|
*
|
|
10
10
|
* #example
|
|
11
11
|
* The `uri` shorthand auto-resolves the `.tbi` index; add `csi: true` for a
|
|
@@ -18,9 +18,6 @@ export declare function normalizeSnapshot(snap: Record<string, unknown>): Record
|
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
20
|
declare const GtfTabixAdapter: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
21
|
-
readonly densityAdapter: {
|
|
22
|
-
type: "maybeFrozen";
|
|
23
|
-
};
|
|
24
21
|
type: {
|
|
25
22
|
type: "string";
|
|
26
23
|
} & {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ConfigurationSchema, expandTabixShorthand, tabixIndexSchema, } from '@jbrowse/core/configuration';
|
|
2
|
-
import { densityAdapterConfigSchemaFields } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
3
2
|
export function normalizeSnapshot(snap) {
|
|
4
3
|
return expandTabixShorthand(snap, 'gtfGzLocation');
|
|
5
4
|
}
|
|
@@ -8,7 +7,7 @@ export function normalizeSnapshot(snap) {
|
|
|
8
7
|
* #category adapter
|
|
9
8
|
* #trackType FeatureTrack
|
|
10
9
|
* #fileFormat feature | GTF (tabix)
|
|
11
|
-
*
|
|
10
|
+
* Reads bgzip-compressed, tabix-indexed GTF files.
|
|
12
11
|
*
|
|
13
12
|
* #example
|
|
14
13
|
* The `uri` shorthand auto-resolves the `.tbi` index; add `csi: true` for a
|
|
@@ -35,7 +34,7 @@ const GtfTabixAdapter = ConfigurationSchema('GtfTabixAdapter', {
|
|
|
35
34
|
},
|
|
36
35
|
/**
|
|
37
36
|
* #slot
|
|
38
|
-
*
|
|
37
|
+
* The tabix index location and its kind. The `uri` shorthand derives
|
|
39
38
|
* both, so a config using it states neither.
|
|
40
39
|
*/
|
|
41
40
|
index: tabixIndexSchema(),
|
|
@@ -70,9 +69,9 @@ const GtfTabixAdapter = ConfigurationSchema('GtfTabixAdapter', {
|
|
|
70
69
|
description: 'attribute naming the parent gene that transcripts are aggregated into. transcripts are grouped by gene_id where the file has one (gene names are not unique within a reference), so this is the gene label, and the grouping key only for files with no gene_id',
|
|
71
70
|
defaultValue: 'gene_name',
|
|
72
71
|
},
|
|
73
|
-
...densityAdapterConfigSchemaFields,
|
|
74
72
|
}, {
|
|
75
73
|
explicitlyTyped: true,
|
|
74
|
+
closed: true,
|
|
76
75
|
/**
|
|
77
76
|
* #preProcessSnapshot
|
|
78
77
|
*
|
package/esm/util.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export interface GtfLineRecord {
|
|
|
21
21
|
* A top-level parsed feature paired with the record it came from. The parser
|
|
22
22
|
* stamps no identity onto the feature; callers that need a stable per-feature
|
|
23
23
|
* id (e.g. a tabix byte offset) read it off their own `record`. Mirrors
|
|
24
|
-
* gff-nostream's `ParsedRecord`.
|
|
24
|
+
* @gmod/gff-nostream's `ParsedRecord`.
|
|
25
25
|
*/
|
|
26
26
|
export interface ParsedGtfRecord<R extends GtfLineRecord = GtfLineRecord> {
|
|
27
27
|
feature: FeatureLoc;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-gtf",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.14",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "JBrowse 2 gtf feature adapter",
|
|
6
6
|
"keywords": [
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
"esm"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@gmod/tabix": "^3.
|
|
25
|
-
"@jbrowse/mobx-state-tree": "^6.
|
|
24
|
+
"@gmod/tabix": "^3.11.0",
|
|
25
|
+
"@jbrowse/mobx-state-tree": "^6.9.0",
|
|
26
26
|
"mobx": "^7.0.6",
|
|
27
27
|
"rxjs": "^7.8.2",
|
|
28
|
-
"@jbrowse/core": "^5.0.0-beta.
|
|
28
|
+
"@jbrowse/core": "^5.0.0-beta.14"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"react": ">=19.0.0",
|