@jbrowse/plugin-gtf 5.0.0-beta.1 → 5.0.0-beta.10

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.
@@ -54,6 +54,6 @@ export default class GtfAdapter extends BaseFeatureDataAdapter {
54
54
  catch (e) {
55
55
  observer.error(e);
56
56
  }
57
- }, opts.stopToken);
57
+ }, opts.signal);
58
58
  }
59
59
  }
@@ -18,25 +18,21 @@ export declare function normalizeSnapshot(snap: Record<string, unknown>): Record
18
18
  * ```
19
19
  */
20
20
  declare const GtfAdapter: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
21
- /**
22
- * #slot
23
- */
21
+ type: {
22
+ type: "string";
23
+ } & {
24
+ defaultValue: string;
25
+ };
24
26
  readonly gtfLocation: {
25
- readonly type: "fileLocation";
26
- readonly description: "path to gtf file, also allows for gzipped gtf";
27
- readonly defaultValue: {
28
- readonly uri: "/path/to/my.gtf";
29
- readonly locationType: "UriLocation";
30
- };
27
+ type: "fileLocation";
28
+ } & {
29
+ defaultValue: unknown;
31
30
  };
32
- /**
33
- * #slot
34
- */
35
31
  readonly aggregateField: {
36
- readonly type: "string";
37
- readonly 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";
38
- readonly defaultValue: "gene_name";
32
+ type: "string";
33
+ } & {
34
+ defaultValue: string;
39
35
  };
40
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
36
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, true, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
41
37
  export type GtfAdapterConfig = Instance<typeof GtfAdapter>;
42
38
  export default GtfAdapter;
@@ -1,14 +1,6 @@
1
- import { ConfigurationSchema } from '@jbrowse/core/configuration';
1
+ import { ConfigurationSchema, expandUriShorthand, } from '@jbrowse/core/configuration';
2
2
  export function normalizeSnapshot(snap) {
3
- return snap.uri
4
- ? {
5
- ...snap,
6
- gtfLocation: {
7
- uri: snap.uri,
8
- baseUri: snap.baseUri,
9
- },
10
- }
11
- : snap;
3
+ return expandUriShorthand(snap, 'gtfLocation');
12
4
  }
13
5
  /**
14
6
  * #config GtfAdapter
@@ -1,7 +1,6 @@
1
1
  import { TabixIndexedFile } from '@gmod/tabix';
2
2
  import { BaseFeatureDataAdapter, cachedSetup, } from '@jbrowse/core/data_adapters/BaseAdapter';
3
3
  import { SimpleFeature, downloadStatus } from '@jbrowse/core/util';
4
- import { sharedBgzfWorkerPool } from '@jbrowse/core/util/bgzfWorkerPool';
5
4
  import { decompressedBytesBudget } from '@jbrowse/core/util/cacheBudgets';
6
5
  import { openLocation, openTabixIndexFilehandle } from '@jbrowse/core/util/io';
7
6
  import { ObservableCreate } from '@jbrowse/core/util/rxjs';
@@ -15,7 +14,6 @@ export default class GtfTabixAdapter extends BaseFeatureDataAdapter {
15
14
  filehandle: openLocation(this.getConf('gtfGzLocation'), this.pluginManager),
16
15
  ...openTabixIndexFilehandle(this.getConf(['index', 'location']), this.getConf(['index', 'indexType']), this.pluginManager),
17
16
  chunkCacheBudget: decompressedBytesBudget,
18
- bgzfWorkerPool: sharedBgzfWorkerPool(),
19
17
  });
20
18
  return {
21
19
  gtf,
@@ -45,7 +43,18 @@ export default class GtfTabixAdapter extends BaseFeatureDataAdapter {
45
43
  return ObservableCreate(async (observer) => {
46
44
  try {
47
45
  const { gtf, dontRedispatchSet } = await this.configure(opts);
48
- const lines = await readTabixLinesRedispatched(gtf, query, dontRedispatchSet, opts);
46
+ // The type list alone, and `opts.topLevelOnly` is deliberately not
47
+ // honoured — both for the same reason. A GTF line has no `ID`/`Parent`,
48
+ // so there is no cheap "can this have children"; and a GTF top-level
49
+ // feature is not a line at all, it is synthesized by
50
+ // `aggregateGtfFeatures` from the transcripts in the FETCHED set, whose
51
+ // span it takes from them. So the argument that lets GFF3 skip the
52
+ // flanks — a top-level feature overlapping the query is already in the
53
+ // query's own read — does not transfer, and a narrower bound could draw
54
+ // a gene short rather than merely flat. Nothing is lost by declining:
55
+ // no GTF record shape makes this bound expensive (the fixtures top out
56
+ // at 19 kb, against GFF3's chromosome-long `match`).
57
+ const lines = await readTabixLinesRedispatched(gtf, query, line => !dontRedispatchSet.has(line.type), opts);
49
58
  const feats = parseGtfToFeatures(lines, record => `${this.id}-offset-${record.offset}`);
50
59
  const aggregated = aggregateGtfFeatures({
51
60
  feats,
@@ -63,6 +72,6 @@ export default class GtfTabixAdapter extends BaseFeatureDataAdapter {
63
72
  catch (e) {
64
73
  observer.error(e);
65
74
  }
66
- }, opts.stopToken);
75
+ }, opts.signal);
67
76
  }
68
77
  }
@@ -18,59 +18,43 @@ 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
- /**
22
- * #slot
23
- * location of the bgzip-compressed GTF, sorted by position. Must be bgzip
24
- * rather than plain gzip, which tabix cannot index.
25
- */
21
+ readonly densityAdapter: {
22
+ type: "maybeFrozen";
23
+ };
24
+ type: {
25
+ type: "string";
26
+ } & {
27
+ defaultValue: string;
28
+ };
26
29
  readonly gtfGzLocation: {
27
- readonly type: "fileLocation";
28
- readonly defaultValue: {
29
- readonly uri: "/path/to/my.gtf.gz";
30
- readonly locationType: "UriLocation";
31
- };
30
+ type: "fileLocation";
31
+ } & {
32
+ defaultValue: unknown;
32
33
  };
33
34
  readonly index: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
34
35
  readonly indexType: {
35
- readonly model: import("@jbrowse/mobx-state-tree").ISimpleType<"CSI" | "TBI">;
36
- readonly type: 'stringEnum';
37
- readonly defaultValue: 'TBI';
38
- readonly description: '`TBI` is the usual `tabix` output. `CSI` is required for a reference longer than 512 Mb, which TBI cannot address.';
36
+ type: "stringEnum";
37
+ } & {
38
+ model: import("@jbrowse/mobx-state-tree").ISimpleType<"CSI" | "TBI">;
39
+ } & {
40
+ defaultValue: string;
39
41
  };
40
42
  readonly location: {
41
- readonly type: 'fileLocation';
42
- readonly defaultValue: {
43
- readonly uri: '/path/to/my.gz.tbi';
44
- readonly locationType: 'UriLocation';
45
- };
46
- readonly description: 'location of the tabix index. Only needed when it is not named `<file>.tbi` (or `.csi`), which is what the `uri` shorthand assumes.';
43
+ type: "fileLocation";
44
+ } & {
45
+ defaultValue: unknown;
47
46
  };
48
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
49
- /**
50
- * #slot
51
- * the GtfTabixAdapter has to "redispatch" if it fetches a region and
52
- * features it finds inside that region extend outside the region we
53
- * requested. you can disable this for certain feature types to avoid
54
- * fetching e.g. the entire chromosome
55
- *
56
- * the defaults are the whole-sequence records the common annotation sources
57
- * emit: `region` (NCBI), `supercontig`/`scaffold` (Ensembl, for
58
- * non-chromosomal sequences), plus `chromosome` and `contig`. They span an
59
- * entire reference and have no children, so letting one expand the fetch
60
- * would pull a whole chromosome to gain nothing
61
- */
47
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
62
48
  readonly dontRedispatch: {
63
- readonly type: "stringArray";
64
- readonly defaultValue: readonly ["chromosome", "region", "contig", "supercontig", "scaffold"];
49
+ type: "stringArray";
50
+ } & {
51
+ defaultValue: unknown;
65
52
  };
66
- /**
67
- * #slot
68
- */
69
53
  readonly aggregateField: {
70
- readonly type: "string";
71
- readonly 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";
72
- readonly defaultValue: "gene_name";
54
+ type: "string";
55
+ } & {
56
+ defaultValue: string;
73
57
  };
74
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
58
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, true, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
75
59
  export type GtfTabixAdapterConfig = Instance<typeof GtfTabixAdapter>;
76
60
  export default GtfTabixAdapter;
@@ -1,4 +1,5 @@
1
- import { ConfigurationSchema, expandTabixShorthand, tabixIndexFields, } from '@jbrowse/core/configuration';
1
+ import { ConfigurationSchema, expandTabixShorthand, tabixIndexSchema, } from '@jbrowse/core/configuration';
2
+ import { densityAdapterConfigSchemaFields } from '@jbrowse/core/data_adapters/BaseAdapter';
2
3
  export function normalizeSnapshot(snap) {
3
4
  return expandTabixShorthand(snap, 'gtfGzLocation');
4
5
  }
@@ -32,7 +33,12 @@ const GtfTabixAdapter = ConfigurationSchema('GtfTabixAdapter', {
32
33
  locationType: 'UriLocation',
33
34
  },
34
35
  },
35
- index: ConfigurationSchema('TabixIndex', { ...tabixIndexFields }),
36
+ /**
37
+ * #slot
38
+ * where the tabix index is and which kind it is. The `uri` shorthand derives
39
+ * both, so a config using it states neither.
40
+ */
41
+ index: tabixIndexSchema(),
36
42
  /**
37
43
  * #slot
38
44
  * the GtfTabixAdapter has to "redispatch" if it fetches a region and
@@ -64,6 +70,7 @@ const GtfTabixAdapter = ConfigurationSchema('GtfTabixAdapter', {
64
70
  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',
65
71
  defaultValue: 'gene_name',
66
72
  },
73
+ ...densityAdapterConfigSchemaFields,
67
74
  }, {
68
75
  explicitlyTyped: true,
69
76
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-gtf",
3
- "version": "5.0.0-beta.1",
3
+ "version": "5.0.0-beta.10",
4
4
  "type": "module",
5
5
  "description": "JBrowse 2 gtf feature adapter",
6
6
  "keywords": [
@@ -21,10 +21,10 @@
21
21
  "esm"
22
22
  ],
23
23
  "dependencies": {
24
- "@gmod/tabix": "^3.8.2",
25
- "@jbrowse/mobx-state-tree": "^6.5.1",
24
+ "@gmod/tabix": "^3.8.3",
25
+ "@jbrowse/mobx-state-tree": "^6.6.1",
26
26
  "rxjs": "^7.8.2",
27
- "@jbrowse/core": "^5.0.0-beta.1"
27
+ "@jbrowse/core": "^5.0.0-beta.10"
28
28
  },
29
29
  "peerDependencies": {
30
30
  "react": ">=19.0.0"