@jbrowse/plugin-gff3 2.16.1 → 2.18.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.
@@ -1,7 +1,8 @@
1
- import { BaseFeatureDataAdapter, BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
2
- import { NoAssemblyRegion } from '@jbrowse/core/util/types';
3
1
  import IntervalTree from '@flatten-js/interval-tree';
4
- import { Feature } from '@jbrowse/core/util/simpleFeature';
2
+ import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
3
+ import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
4
+ import type { Feature } from '@jbrowse/core/util/simpleFeature';
5
+ import type { NoAssemblyRegion } from '@jbrowse/core/util/types';
5
6
  type StatusCallback = (arg: string) => void;
6
7
  export default class Gff3Adapter extends BaseFeatureDataAdapter {
7
8
  calculatedIntervalTreeMap: Record<string, IntervalTree>;
@@ -3,14 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ const interval_tree_1 = __importDefault(require("@flatten-js/interval-tree"));
6
7
  const BaseAdapter_1 = require("@jbrowse/core/data_adapters/BaseAdapter");
8
+ const util_1 = require("@jbrowse/core/util");
7
9
  const io_1 = require("@jbrowse/core/util/io");
8
10
  const rxjs_1 = require("@jbrowse/core/util/rxjs");
9
- const interval_tree_1 = __importDefault(require("@flatten-js/interval-tree"));
10
11
  const simpleFeature_1 = __importDefault(require("@jbrowse/core/util/simpleFeature"));
11
- const bgzf_filehandle_1 = require("@gmod/bgzf-filehandle");
12
12
  const gff_nostream_1 = require("gff-nostream");
13
- const util_1 = require("@jbrowse/core/util");
14
13
  const featureData_1 = require("../featureData");
15
14
  class Gff3Adapter extends BaseAdapter_1.BaseFeatureDataAdapter {
16
15
  constructor() {
@@ -19,20 +18,16 @@ class Gff3Adapter extends BaseAdapter_1.BaseFeatureDataAdapter {
19
18
  }
20
19
  async loadDataP(opts) {
21
20
  const { statusCallback = () => { } } = opts || {};
22
- const buf = (await (0, io_1.openLocation)(this.getConf('gffLocation'), this.pluginManager).readFile(opts));
23
- const buffer = (0, util_1.isGzip)(buf)
24
- ? await (0, util_1.updateStatus)('Unzipping', statusCallback, () => (0, bgzf_filehandle_1.unzip)(buf))
25
- : buf;
21
+ const buffer = await (0, util_1.fetchAndMaybeUnzip)((0, io_1.openLocation)(this.getConf('gffLocation'), this.pluginManager));
26
22
  const headerLines = [];
27
23
  const featureMap = {};
24
+ const decoder = new TextDecoder('utf8');
28
25
  let blockStart = 0;
29
- const decoder = typeof TextDecoder !== 'undefined' ? new TextDecoder('utf8') : undefined;
30
26
  let i = 0;
31
27
  while (blockStart < buffer.length) {
32
28
  const n = buffer.indexOf('\n', blockStart);
33
- // could be a non-newline ended file, so subarray to end of file if n===-1
34
29
  const b = n === -1 ? buffer.subarray(blockStart) : buffer.subarray(blockStart, n);
35
- const line = ((decoder === null || decoder === void 0 ? void 0 : decoder.decode(b)) || b.toString()).trim();
30
+ const line = decoder.decode(b).trim();
36
31
  if (line) {
37
32
  if (line.startsWith('#')) {
38
33
  headerLines.push(line);
@@ -108,8 +103,8 @@ class Gff3Adapter extends BaseAdapter_1.BaseFeatureDataAdapter {
108
103
  catch (e) {
109
104
  observer.error(e);
110
105
  }
111
- }, opts.signal);
106
+ }, opts.stopToken);
112
107
  }
113
- freeResources( /* { region } */) { }
108
+ freeResources() { }
114
109
  }
115
110
  exports.default = Gff3Adapter;
@@ -1,7 +1,4 @@
1
1
  declare const Gff3Adapter: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
2
- /**
3
- * #slot
4
- */
5
2
  gffLocation: {
6
3
  type: string;
7
4
  defaultValue: {
@@ -1,15 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const configuration_1 = require("@jbrowse/core/configuration");
4
- /**
5
- * #config Gff3Adapter
6
- * #category adapter
7
- */
8
- function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
4
+ function x() { }
9
5
  const Gff3Adapter = (0, configuration_1.ConfigurationSchema)('Gff3Adapter', {
10
- /**
11
- * #slot
12
- */
13
6
  gffLocation: {
14
7
  type: 'fileLocation',
15
8
  defaultValue: { uri: '/path/to/my.gff', locationType: 'UriLocation' },
@@ -1,2 +1,2 @@
1
- import PluginManager from '@jbrowse/core/PluginManager';
1
+ import type PluginManager from '@jbrowse/core/PluginManager';
2
2
  export default function Gff3AdapterF(pluginManager: PluginManager): void;
@@ -1,10 +1,11 @@
1
- import { BaseFeatureDataAdapter, BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
2
- import { Region } from '@jbrowse/core/util/types';
3
- import { Feature } from '@jbrowse/core/util/simpleFeature';
4
1
  import { TabixIndexedFile } from '@gmod/tabix';
5
- import { AnyConfigurationModel } from '@jbrowse/core/configuration';
6
- import PluginManager from '@jbrowse/core/PluginManager';
7
- import { getSubAdapterType } from '@jbrowse/core/data_adapters/dataAdapterCache';
2
+ import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
3
+ import type PluginManager from '@jbrowse/core/PluginManager';
4
+ import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
5
+ import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
6
+ import type { getSubAdapterType } from '@jbrowse/core/data_adapters/dataAdapterCache';
7
+ import type { Feature } from '@jbrowse/core/util/simpleFeature';
8
+ import type { Region } from '@jbrowse/core/util/types';
8
9
  export default class Gff3TabixAdapter extends BaseFeatureDataAdapter {
9
10
  protected gff: TabixIndexedFile;
10
11
  protected dontRedispatch: string[];
@@ -3,14 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ const tabix_1 = require("@gmod/tabix");
7
+ const configuration_1 = require("@jbrowse/core/configuration");
6
8
  const BaseAdapter_1 = require("@jbrowse/core/data_adapters/BaseAdapter");
7
- const range_1 = require("@jbrowse/core/util/range");
8
9
  const io_1 = require("@jbrowse/core/util/io");
10
+ const range_1 = require("@jbrowse/core/util/range");
9
11
  const rxjs_1 = require("@jbrowse/core/util/rxjs");
10
12
  const simpleFeature_1 = __importDefault(require("@jbrowse/core/util/simpleFeature"));
11
- const tabix_1 = require("@gmod/tabix");
12
13
  const gff_nostream_1 = require("gff-nostream");
13
- const configuration_1 = require("@jbrowse/core/configuration");
14
14
  const featureData_1 = require("../featureData");
15
15
  class Gff3TabixAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
16
16
  constructor(config, getSubAdapter, pluginManager) {
@@ -42,7 +42,7 @@ class Gff3TabixAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
42
42
  return (0, rxjs_1.ObservableCreate)(async (observer) => {
43
43
  const metadata = await this.gff.getMetadata();
44
44
  await this.getFeaturesHelper(query, opts, metadata, observer, true);
45
- }, opts.signal);
45
+ }, opts.stopToken);
46
46
  }
47
47
  async getFeaturesHelper(query, opts, metadata, observer, allowRedispatch, originalQuery = query) {
48
48
  var _a, _b;
@@ -56,10 +56,8 @@ class Gff3TabixAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
56
56
  let maxEnd = Number.NEGATIVE_INFINITY;
57
57
  for (const line of lines) {
58
58
  const featureType = line.fields[2];
59
- // only expand redispatch range if feature is not a "dontRedispatch"
60
- // type skips large regions like chromosome,region
61
59
  if (!this.dontRedispatch.includes(featureType)) {
62
- const start = line.start - 1; // gff is 1-based
60
+ const start = line.start - 1;
63
61
  if (start < minStart) {
64
62
  minStart = start;
65
63
  }
@@ -69,8 +67,6 @@ class Gff3TabixAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
69
67
  }
70
68
  }
71
69
  if (maxEnd > query.end || minStart < query.start) {
72
- // make a new feature callback to only return top-level features
73
- // in the original query range
74
70
  await this.getFeaturesHelper({ ...query, start: minStart, end: maxEnd }, opts, metadata, observer, false, query);
75
71
  return;
76
72
  }
@@ -107,7 +103,6 @@ class Gff3TabixAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
107
103
  }
108
104
  parseLine(columnNumbers, line, fileOffset) {
109
105
  const fields = line.split('\t');
110
- // note: index column numbers are 1-based
111
106
  return {
112
107
  start: +fields[columnNumbers.start - 1],
113
108
  end: +fields[columnNumbers.end - 1],
@@ -115,6 +110,6 @@ class Gff3TabixAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
115
110
  fields,
116
111
  };
117
112
  }
118
- freeResources( /* { region } */) { }
113
+ freeResources() { }
119
114
  }
120
115
  exports.default = Gff3TabixAdapter;
@@ -1,7 +1,4 @@
1
1
  declare const Gff3TabixAdapter: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
2
- /**
3
- * #slot
4
- */
5
2
  gffGzLocation: {
6
3
  type: string;
7
4
  defaultValue: {
@@ -10,17 +7,11 @@ declare const Gff3TabixAdapter: import("@jbrowse/core/configuration/configuratio
10
7
  };
11
8
  };
12
9
  index: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
13
- /**
14
- * #slot index.indexType
15
- */
16
10
  indexType: {
17
11
  model: import("mobx-state-tree").ISimpleType<string>;
18
12
  type: string;
19
13
  defaultValue: string;
20
14
  };
21
- /**
22
- * #slot index.indexType
23
- */
24
15
  location: {
25
16
  type: string;
26
17
  defaultValue: {
@@ -29,13 +20,6 @@ declare const Gff3TabixAdapter: import("@jbrowse/core/configuration/configuratio
29
20
  };
30
21
  };
31
22
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
32
- /**
33
- * #slot
34
- * the Gff3TabixAdapter has to "redispatch" if it fetches a region and
35
- * features it finds inside that region extend outside the region we requested.
36
- * you can disable this for certain feature types to avoid fetching e.g. the
37
- * entire chromosome
38
- */
39
23
  dontRedispatch: {
40
24
  type: string;
41
25
  defaultValue: string[];
@@ -1,32 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const mobx_state_tree_1 = require("mobx-state-tree");
4
3
  const configuration_1 = require("@jbrowse/core/configuration");
5
- /**
6
- * #config Gff3TabixAdapter
7
- * #category adapter
8
- */
9
- function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
4
+ const mobx_state_tree_1 = require("mobx-state-tree");
5
+ function x() { }
10
6
  const Gff3TabixAdapter = (0, configuration_1.ConfigurationSchema)('Gff3TabixAdapter', {
11
- /**
12
- * #slot
13
- */
14
7
  gffGzLocation: {
15
8
  type: 'fileLocation',
16
9
  defaultValue: { uri: '/path/to/my.gff.gz', locationType: 'UriLocation' },
17
10
  },
18
11
  index: (0, configuration_1.ConfigurationSchema)('Gff3TabixIndex', {
19
- /**
20
- * #slot index.indexType
21
- */
22
12
  indexType: {
23
13
  model: mobx_state_tree_1.types.enumeration('IndexType', ['TBI', 'CSI']),
24
14
  type: 'stringEnum',
25
15
  defaultValue: 'TBI',
26
16
  },
27
- /**
28
- * #slot index.indexType
29
- */
30
17
  location: {
31
18
  type: 'fileLocation',
32
19
  defaultValue: {
@@ -35,13 +22,6 @@ const Gff3TabixAdapter = (0, configuration_1.ConfigurationSchema)('Gff3TabixAdap
35
22
  },
36
23
  },
37
24
  }),
38
- /**
39
- * #slot
40
- * the Gff3TabixAdapter has to "redispatch" if it fetches a region and
41
- * features it finds inside that region extend outside the region we requested.
42
- * you can disable this for certain feature types to avoid fetching e.g. the
43
- * entire chromosome
44
- */
45
25
  dontRedispatch: {
46
26
  type: 'stringArray',
47
27
  defaultValue: ['chromosome', 'region', 'contig'],
@@ -1,2 +1,2 @@
1
- import PluginManager from '@jbrowse/core/PluginManager';
1
+ import type PluginManager from '@jbrowse/core/PluginManager';
2
2
  export default function Gff3TabixAdapterF(pluginManager: PluginManager): void;
@@ -1,2 +1,2 @@
1
- import PluginManager from '@jbrowse/core/PluginManager';
1
+ import type PluginManager from '@jbrowse/core/PluginManager';
2
2
  export default function GuessGff3F(pluginManager: PluginManager): void;
@@ -1,4 +1,4 @@
1
- import { GFF3FeatureLineWithRefs } from 'gff-nostream';
1
+ import type { GFF3FeatureLineWithRefs } from 'gff-nostream';
2
2
  interface GFF3Feature {
3
3
  start: number;
4
4
  end: number;
@@ -28,8 +28,6 @@ function featureData(data) {
28
28
  for (const a of Object.keys(dataAttributes)) {
29
29
  let b = a.toLowerCase();
30
30
  if (defaultFields.has(b)) {
31
- // add "suffix" to tag name if it already exists
32
- // reproduces behavior of NCList
33
31
  b += '2';
34
32
  }
35
33
  if (dataAttributes[a] && a !== '_lineHash') {
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import PluginManager from '@jbrowse/core/PluginManager';
2
1
  import Plugin from '@jbrowse/core/Plugin';
2
+ import type PluginManager from '@jbrowse/core/PluginManager';
3
3
  export default class GFF3Plugin extends Plugin {
4
4
  name: string;
5
5
  install(pluginManager: PluginManager): void;
package/dist/index.js CHANGED
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const Plugin_1 = __importDefault(require("@jbrowse/core/Plugin"));
7
- const Gff3TabixAdapter_1 = __importDefault(require("./Gff3TabixAdapter"));
8
7
  const Gff3Adapter_1 = __importDefault(require("./Gff3Adapter"));
8
+ const Gff3TabixAdapter_1 = __importDefault(require("./Gff3TabixAdapter"));
9
9
  const GuessGff3_1 = __importDefault(require("./GuessGff3"));
10
10
  class GFF3Plugin extends Plugin_1.default {
11
11
  constructor() {
@@ -1,7 +1,8 @@
1
- import { BaseFeatureDataAdapter, BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
2
- import { NoAssemblyRegion } from '@jbrowse/core/util/types';
3
1
  import IntervalTree from '@flatten-js/interval-tree';
4
- import { Feature } from '@jbrowse/core/util/simpleFeature';
2
+ import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
3
+ import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
4
+ import type { Feature } from '@jbrowse/core/util/simpleFeature';
5
+ import type { NoAssemblyRegion } from '@jbrowse/core/util/types';
5
6
  type StatusCallback = (arg: string) => void;
6
7
  export default class Gff3Adapter extends BaseFeatureDataAdapter {
7
8
  calculatedIntervalTreeMap: Record<string, IntervalTree>;
@@ -1,11 +1,10 @@
1
- import { BaseFeatureDataAdapter, } from '@jbrowse/core/data_adapters/BaseAdapter';
1
+ import IntervalTree from '@flatten-js/interval-tree';
2
+ import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
3
+ import { fetchAndMaybeUnzip } from '@jbrowse/core/util';
2
4
  import { openLocation } from '@jbrowse/core/util/io';
3
5
  import { ObservableCreate } from '@jbrowse/core/util/rxjs';
4
- import IntervalTree from '@flatten-js/interval-tree';
5
6
  import SimpleFeature from '@jbrowse/core/util/simpleFeature';
6
- import { unzip } from '@gmod/bgzf-filehandle';
7
7
  import { parseStringSync } from 'gff-nostream';
8
- import { isGzip, updateStatus } from '@jbrowse/core/util';
9
8
  import { featureData } from '../featureData';
10
9
  export default class Gff3Adapter extends BaseFeatureDataAdapter {
11
10
  constructor() {
@@ -14,20 +13,16 @@ export default class Gff3Adapter extends BaseFeatureDataAdapter {
14
13
  }
15
14
  async loadDataP(opts) {
16
15
  const { statusCallback = () => { } } = opts || {};
17
- const buf = (await openLocation(this.getConf('gffLocation'), this.pluginManager).readFile(opts));
18
- const buffer = isGzip(buf)
19
- ? await updateStatus('Unzipping', statusCallback, () => unzip(buf))
20
- : buf;
16
+ const buffer = await fetchAndMaybeUnzip(openLocation(this.getConf('gffLocation'), this.pluginManager));
21
17
  const headerLines = [];
22
18
  const featureMap = {};
19
+ const decoder = new TextDecoder('utf8');
23
20
  let blockStart = 0;
24
- const decoder = typeof TextDecoder !== 'undefined' ? new TextDecoder('utf8') : undefined;
25
21
  let i = 0;
26
22
  while (blockStart < buffer.length) {
27
23
  const n = buffer.indexOf('\n', blockStart);
28
- // could be a non-newline ended file, so subarray to end of file if n===-1
29
24
  const b = n === -1 ? buffer.subarray(blockStart) : buffer.subarray(blockStart, n);
30
- const line = ((decoder === null || decoder === void 0 ? void 0 : decoder.decode(b)) || b.toString()).trim();
25
+ const line = decoder.decode(b).trim();
31
26
  if (line) {
32
27
  if (line.startsWith('#')) {
33
28
  headerLines.push(line);
@@ -103,7 +98,7 @@ export default class Gff3Adapter extends BaseFeatureDataAdapter {
103
98
  catch (e) {
104
99
  observer.error(e);
105
100
  }
106
- }, opts.signal);
101
+ }, opts.stopToken);
107
102
  }
108
- freeResources( /* { region } */) { }
103
+ freeResources() { }
109
104
  }
@@ -1,7 +1,4 @@
1
1
  declare const Gff3Adapter: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
2
- /**
3
- * #slot
4
- */
5
2
  gffLocation: {
6
3
  type: string;
7
4
  defaultValue: {
@@ -1,13 +1,6 @@
1
1
  import { ConfigurationSchema } from '@jbrowse/core/configuration';
2
- /**
3
- * #config Gff3Adapter
4
- * #category adapter
5
- */
6
- function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
2
+ function x() { }
7
3
  const Gff3Adapter = ConfigurationSchema('Gff3Adapter', {
8
- /**
9
- * #slot
10
- */
11
4
  gffLocation: {
12
5
  type: 'fileLocation',
13
6
  defaultValue: { uri: '/path/to/my.gff', locationType: 'UriLocation' },
@@ -1,2 +1,2 @@
1
- import PluginManager from '@jbrowse/core/PluginManager';
1
+ import type PluginManager from '@jbrowse/core/PluginManager';
2
2
  export default function Gff3AdapterF(pluginManager: PluginManager): void;
@@ -1,10 +1,11 @@
1
- import { BaseFeatureDataAdapter, BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
2
- import { Region } from '@jbrowse/core/util/types';
3
- import { Feature } from '@jbrowse/core/util/simpleFeature';
4
1
  import { TabixIndexedFile } from '@gmod/tabix';
5
- import { AnyConfigurationModel } from '@jbrowse/core/configuration';
6
- import PluginManager from '@jbrowse/core/PluginManager';
7
- import { getSubAdapterType } from '@jbrowse/core/data_adapters/dataAdapterCache';
2
+ import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
3
+ import type PluginManager from '@jbrowse/core/PluginManager';
4
+ import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
5
+ import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
6
+ import type { getSubAdapterType } from '@jbrowse/core/data_adapters/dataAdapterCache';
7
+ import type { Feature } from '@jbrowse/core/util/simpleFeature';
8
+ import type { Region } from '@jbrowse/core/util/types';
8
9
  export default class Gff3TabixAdapter extends BaseFeatureDataAdapter {
9
10
  protected gff: TabixIndexedFile;
10
11
  protected dontRedispatch: string[];
@@ -1,11 +1,11 @@
1
- import { BaseFeatureDataAdapter, } from '@jbrowse/core/data_adapters/BaseAdapter';
2
- import { doesIntersect2 } from '@jbrowse/core/util/range';
1
+ import { TabixIndexedFile } from '@gmod/tabix';
2
+ import { readConfObject } from '@jbrowse/core/configuration';
3
+ import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
3
4
  import { openLocation } from '@jbrowse/core/util/io';
5
+ import { doesIntersect2 } from '@jbrowse/core/util/range';
4
6
  import { ObservableCreate } from '@jbrowse/core/util/rxjs';
5
7
  import SimpleFeature from '@jbrowse/core/util/simpleFeature';
6
- import { TabixIndexedFile } from '@gmod/tabix';
7
8
  import { parseStringSync } from 'gff-nostream';
8
- import { readConfObject, } from '@jbrowse/core/configuration';
9
9
  import { featureData } from '../featureData';
10
10
  export default class Gff3TabixAdapter extends BaseFeatureDataAdapter {
11
11
  constructor(config, getSubAdapter, pluginManager) {
@@ -37,7 +37,7 @@ export default class Gff3TabixAdapter extends BaseFeatureDataAdapter {
37
37
  return ObservableCreate(async (observer) => {
38
38
  const metadata = await this.gff.getMetadata();
39
39
  await this.getFeaturesHelper(query, opts, metadata, observer, true);
40
- }, opts.signal);
40
+ }, opts.stopToken);
41
41
  }
42
42
  async getFeaturesHelper(query, opts, metadata, observer, allowRedispatch, originalQuery = query) {
43
43
  var _a, _b;
@@ -51,10 +51,8 @@ export default class Gff3TabixAdapter extends BaseFeatureDataAdapter {
51
51
  let maxEnd = Number.NEGATIVE_INFINITY;
52
52
  for (const line of lines) {
53
53
  const featureType = line.fields[2];
54
- // only expand redispatch range if feature is not a "dontRedispatch"
55
- // type skips large regions like chromosome,region
56
54
  if (!this.dontRedispatch.includes(featureType)) {
57
- const start = line.start - 1; // gff is 1-based
55
+ const start = line.start - 1;
58
56
  if (start < minStart) {
59
57
  minStart = start;
60
58
  }
@@ -64,8 +62,6 @@ export default class Gff3TabixAdapter extends BaseFeatureDataAdapter {
64
62
  }
65
63
  }
66
64
  if (maxEnd > query.end || minStart < query.start) {
67
- // make a new feature callback to only return top-level features
68
- // in the original query range
69
65
  await this.getFeaturesHelper({ ...query, start: minStart, end: maxEnd }, opts, metadata, observer, false, query);
70
66
  return;
71
67
  }
@@ -102,7 +98,6 @@ export default class Gff3TabixAdapter extends BaseFeatureDataAdapter {
102
98
  }
103
99
  parseLine(columnNumbers, line, fileOffset) {
104
100
  const fields = line.split('\t');
105
- // note: index column numbers are 1-based
106
101
  return {
107
102
  start: +fields[columnNumbers.start - 1],
108
103
  end: +fields[columnNumbers.end - 1],
@@ -110,5 +105,5 @@ export default class Gff3TabixAdapter extends BaseFeatureDataAdapter {
110
105
  fields,
111
106
  };
112
107
  }
113
- freeResources( /* { region } */) { }
108
+ freeResources() { }
114
109
  }
@@ -1,7 +1,4 @@
1
1
  declare const Gff3TabixAdapter: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
2
- /**
3
- * #slot
4
- */
5
2
  gffGzLocation: {
6
3
  type: string;
7
4
  defaultValue: {
@@ -10,17 +7,11 @@ declare const Gff3TabixAdapter: import("@jbrowse/core/configuration/configuratio
10
7
  };
11
8
  };
12
9
  index: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
13
- /**
14
- * #slot index.indexType
15
- */
16
10
  indexType: {
17
11
  model: import("mobx-state-tree").ISimpleType<string>;
18
12
  type: string;
19
13
  defaultValue: string;
20
14
  };
21
- /**
22
- * #slot index.indexType
23
- */
24
15
  location: {
25
16
  type: string;
26
17
  defaultValue: {
@@ -29,13 +20,6 @@ declare const Gff3TabixAdapter: import("@jbrowse/core/configuration/configuratio
29
20
  };
30
21
  };
31
22
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
32
- /**
33
- * #slot
34
- * the Gff3TabixAdapter has to "redispatch" if it fetches a region and
35
- * features it finds inside that region extend outside the region we requested.
36
- * you can disable this for certain feature types to avoid fetching e.g. the
37
- * entire chromosome
38
- */
39
23
  dontRedispatch: {
40
24
  type: string;
41
25
  defaultValue: string[];
@@ -1,30 +1,17 @@
1
- import { types } from 'mobx-state-tree';
2
1
  import { ConfigurationSchema } from '@jbrowse/core/configuration';
3
- /**
4
- * #config Gff3TabixAdapter
5
- * #category adapter
6
- */
7
- function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
2
+ import { types } from 'mobx-state-tree';
3
+ function x() { }
8
4
  const Gff3TabixAdapter = ConfigurationSchema('Gff3TabixAdapter', {
9
- /**
10
- * #slot
11
- */
12
5
  gffGzLocation: {
13
6
  type: 'fileLocation',
14
7
  defaultValue: { uri: '/path/to/my.gff.gz', locationType: 'UriLocation' },
15
8
  },
16
9
  index: ConfigurationSchema('Gff3TabixIndex', {
17
- /**
18
- * #slot index.indexType
19
- */
20
10
  indexType: {
21
11
  model: types.enumeration('IndexType', ['TBI', 'CSI']),
22
12
  type: 'stringEnum',
23
13
  defaultValue: 'TBI',
24
14
  },
25
- /**
26
- * #slot index.indexType
27
- */
28
15
  location: {
29
16
  type: 'fileLocation',
30
17
  defaultValue: {
@@ -33,13 +20,6 @@ const Gff3TabixAdapter = ConfigurationSchema('Gff3TabixAdapter', {
33
20
  },
34
21
  },
35
22
  }),
36
- /**
37
- * #slot
38
- * the Gff3TabixAdapter has to "redispatch" if it fetches a region and
39
- * features it finds inside that region extend outside the region we requested.
40
- * you can disable this for certain feature types to avoid fetching e.g. the
41
- * entire chromosome
42
- */
43
23
  dontRedispatch: {
44
24
  type: 'stringArray',
45
25
  defaultValue: ['chromosome', 'region', 'contig'],
@@ -1,2 +1,2 @@
1
- import PluginManager from '@jbrowse/core/PluginManager';
1
+ import type PluginManager from '@jbrowse/core/PluginManager';
2
2
  export default function Gff3TabixAdapterF(pluginManager: PluginManager): void;
@@ -1,2 +1,2 @@
1
- import PluginManager from '@jbrowse/core/PluginManager';
1
+ import type PluginManager from '@jbrowse/core/PluginManager';
2
2
  export default function GuessGff3F(pluginManager: PluginManager): void;
@@ -1,4 +1,4 @@
1
- import { makeIndex, makeIndexType, getFileName, } from '@jbrowse/core/util/tracks';
1
+ import { getFileName, makeIndex, makeIndexType, } from '@jbrowse/core/util/tracks';
2
2
  export default function GuessGff3F(pluginManager) {
3
3
  pluginManager.addToExtensionPoint('Core-guessAdapterForLocation', (adapterGuesser) => {
4
4
  return (file, index, adapterHint) => {
@@ -1,4 +1,4 @@
1
- import { GFF3FeatureLineWithRefs } from 'gff-nostream';
1
+ import type { GFF3FeatureLineWithRefs } from 'gff-nostream';
2
2
  interface GFF3Feature {
3
3
  start: number;
4
4
  end: number;
@@ -25,8 +25,6 @@ export function featureData(data) {
25
25
  for (const a of Object.keys(dataAttributes)) {
26
26
  let b = a.toLowerCase();
27
27
  if (defaultFields.has(b)) {
28
- // add "suffix" to tag name if it already exists
29
- // reproduces behavior of NCList
30
28
  b += '2';
31
29
  }
32
30
  if (dataAttributes[a] && a !== '_lineHash') {
package/esm/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import PluginManager from '@jbrowse/core/PluginManager';
2
1
  import Plugin from '@jbrowse/core/Plugin';
2
+ import type PluginManager from '@jbrowse/core/PluginManager';
3
3
  export default class GFF3Plugin extends Plugin {
4
4
  name: string;
5
5
  install(pluginManager: PluginManager): void;
package/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import Plugin from '@jbrowse/core/Plugin';
2
- import Gff3TabixAdapterF from './Gff3TabixAdapter';
3
2
  import Gff3AdapterF from './Gff3Adapter';
3
+ import Gff3TabixAdapterF from './Gff3TabixAdapter';
4
4
  import GuessGff3F from './GuessGff3';
5
5
  export default class GFF3Plugin extends Plugin {
6
6
  constructor() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-gff3",
3
- "version": "2.16.1",
3
+ "version": "2.18.0",
4
4
  "description": "JBrowse 2 gff3.",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -55,5 +55,5 @@
55
55
  "distModule": "esm/index.js",
56
56
  "srcModule": "src/index.ts",
57
57
  "module": "esm/index.js",
58
- "gitHead": "c6a658d2344989895543f0456b1cf7dd3b937769"
58
+ "gitHead": "c344ea60099cb7e460b77f15808946b24a7eee74"
59
59
  }