@jbrowse/plugin-gff3 2.17.0 → 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.
- package/dist/Gff3Adapter/Gff3Adapter.d.ts +4 -3
- package/dist/Gff3Adapter/Gff3Adapter.js +4 -5
- package/dist/Gff3Adapter/configSchema.d.ts +0 -3
- package/dist/Gff3Adapter/configSchema.js +1 -8
- package/dist/Gff3Adapter/index.d.ts +1 -1
- package/dist/Gff3TabixAdapter/Gff3TabixAdapter.d.ts +7 -6
- package/dist/Gff3TabixAdapter/Gff3TabixAdapter.js +6 -11
- package/dist/Gff3TabixAdapter/configSchema.d.ts +0 -16
- package/dist/Gff3TabixAdapter/configSchema.js +2 -22
- package/dist/Gff3TabixAdapter/index.d.ts +1 -1
- package/dist/GuessGff3/index.d.ts +1 -1
- package/dist/featureData.d.ts +1 -1
- package/dist/featureData.js +0 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/esm/Gff3Adapter/Gff3Adapter.d.ts +4 -3
- package/esm/Gff3Adapter/Gff3Adapter.js +5 -6
- package/esm/Gff3Adapter/configSchema.d.ts +0 -3
- package/esm/Gff3Adapter/configSchema.js +1 -8
- package/esm/Gff3Adapter/index.d.ts +1 -1
- package/esm/Gff3TabixAdapter/Gff3TabixAdapter.d.ts +7 -6
- package/esm/Gff3TabixAdapter/Gff3TabixAdapter.js +7 -12
- package/esm/Gff3TabixAdapter/configSchema.d.ts +0 -16
- package/esm/Gff3TabixAdapter/configSchema.js +2 -22
- package/esm/Gff3TabixAdapter/index.d.ts +1 -1
- package/esm/GuessGff3/index.d.ts +1 -1
- package/esm/GuessGff3/index.js +1 -1
- package/esm/featureData.d.ts +1 -1
- package/esm/featureData.js +0 -2
- package/esm/index.d.ts +1 -1
- package/esm/index.js +1 -1
- package/package.json +2 -2
|
@@ -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 {
|
|
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,13 +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
12
|
const gff_nostream_1 = require("gff-nostream");
|
|
12
|
-
const util_1 = require("@jbrowse/core/util");
|
|
13
13
|
const featureData_1 = require("../featureData");
|
|
14
14
|
class Gff3Adapter extends BaseAdapter_1.BaseFeatureDataAdapter {
|
|
15
15
|
constructor() {
|
|
@@ -26,7 +26,6 @@ class Gff3Adapter extends BaseAdapter_1.BaseFeatureDataAdapter {
|
|
|
26
26
|
let i = 0;
|
|
27
27
|
while (blockStart < buffer.length) {
|
|
28
28
|
const n = buffer.indexOf('\n', blockStart);
|
|
29
|
-
// could be a non-newline ended file, so subarray to end of file if n===-1
|
|
30
29
|
const b = n === -1 ? buffer.subarray(blockStart) : buffer.subarray(blockStart, n);
|
|
31
30
|
const line = decoder.decode(b).trim();
|
|
32
31
|
if (line) {
|
|
@@ -104,8 +103,8 @@ class Gff3Adapter extends BaseAdapter_1.BaseFeatureDataAdapter {
|
|
|
104
103
|
catch (e) {
|
|
105
104
|
observer.error(e);
|
|
106
105
|
}
|
|
107
|
-
}, opts.
|
|
106
|
+
}, opts.stopToken);
|
|
108
107
|
}
|
|
109
|
-
freeResources(
|
|
108
|
+
freeResources() { }
|
|
110
109
|
}
|
|
111
110
|
exports.default = Gff3Adapter;
|
|
@@ -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 {
|
|
6
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
7
|
-
import {
|
|
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.
|
|
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;
|
|
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(
|
|
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
|
-
|
|
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;
|
package/dist/featureData.d.ts
CHANGED
package/dist/featureData.js
CHANGED
|
@@ -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 {
|
|
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,10 +1,10 @@
|
|
|
1
|
-
import
|
|
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
7
|
import { parseStringSync } from 'gff-nostream';
|
|
7
|
-
import { fetchAndMaybeUnzip } from '@jbrowse/core/util';
|
|
8
8
|
import { featureData } from '../featureData';
|
|
9
9
|
export default class Gff3Adapter extends BaseFeatureDataAdapter {
|
|
10
10
|
constructor() {
|
|
@@ -21,7 +21,6 @@ export default class Gff3Adapter extends BaseFeatureDataAdapter {
|
|
|
21
21
|
let i = 0;
|
|
22
22
|
while (blockStart < buffer.length) {
|
|
23
23
|
const n = buffer.indexOf('\n', blockStart);
|
|
24
|
-
// could be a non-newline ended file, so subarray to end of file if n===-1
|
|
25
24
|
const b = n === -1 ? buffer.subarray(blockStart) : buffer.subarray(blockStart, n);
|
|
26
25
|
const line = decoder.decode(b).trim();
|
|
27
26
|
if (line) {
|
|
@@ -99,7 +98,7 @@ export default class Gff3Adapter extends BaseFeatureDataAdapter {
|
|
|
99
98
|
catch (e) {
|
|
100
99
|
observer.error(e);
|
|
101
100
|
}
|
|
102
|
-
}, opts.
|
|
101
|
+
}, opts.stopToken);
|
|
103
102
|
}
|
|
104
|
-
freeResources(
|
|
103
|
+
freeResources() { }
|
|
105
104
|
}
|
|
@@ -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 {
|
|
6
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
7
|
-
import {
|
|
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 {
|
|
2
|
-
import {
|
|
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.
|
|
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;
|
|
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(
|
|
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
|
-
|
|
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;
|
package/esm/GuessGff3/index.d.ts
CHANGED
|
@@ -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;
|
package/esm/GuessGff3/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { makeIndex, makeIndexType,
|
|
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) => {
|
package/esm/featureData.d.ts
CHANGED
package/esm/featureData.js
CHANGED
|
@@ -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.
|
|
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": "
|
|
58
|
+
"gitHead": "c344ea60099cb7e460b77f15808946b24a7eee74"
|
|
59
59
|
}
|