@jbrowse/plugin-gtf 3.6.4 → 3.7.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,15 +1,16 @@
|
|
|
1
|
-
import IntervalTree from '@flatten-js/interval-tree';
|
|
1
|
+
import { IntervalTree } from '@flatten-js/interval-tree';
|
|
2
2
|
import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
3
3
|
import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
4
|
-
import type { Feature } from '@jbrowse/core/util';
|
|
4
|
+
import type { Feature, SimpleFeatureSerialized } from '@jbrowse/core/util';
|
|
5
5
|
import type { Region } from '@jbrowse/core/util/types';
|
|
6
6
|
import type { Observer } from 'rxjs';
|
|
7
7
|
type StatusCallback = (arg: string) => void;
|
|
8
|
+
type SimpleFeat = SimpleFeatureSerialized;
|
|
8
9
|
export default class GtfAdapter extends BaseFeatureDataAdapter {
|
|
9
|
-
calculatedIntervalTreeMap: Record<string, IntervalTree
|
|
10
|
+
calculatedIntervalTreeMap: Record<string, IntervalTree<SimpleFeat>>;
|
|
10
11
|
gtfFeatures?: Promise<{
|
|
11
12
|
header: string;
|
|
12
|
-
intervalTreeMap: Record<string, (sc?: StatusCallback) => IntervalTree
|
|
13
|
+
intervalTreeMap: Record<string, (sc?: StatusCallback) => IntervalTree<SimpleFeat>>;
|
|
13
14
|
}>;
|
|
14
15
|
private loadDataP;
|
|
15
16
|
private loadData;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const interval_tree_1 =
|
|
3
|
+
const interval_tree_1 = require("@flatten-js/interval-tree");
|
|
7
4
|
const BaseAdapter_1 = require("@jbrowse/core/data_adapters/BaseAdapter");
|
|
8
5
|
const util_1 = require("@jbrowse/core/util");
|
|
9
6
|
const io_1 = require("@jbrowse/core/util/io");
|
|
@@ -43,7 +40,7 @@ class GtfAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
|
|
|
43
40
|
(sc) => {
|
|
44
41
|
if (!this.calculatedIntervalTreeMap[refName]) {
|
|
45
42
|
sc === null || sc === void 0 ? void 0 : sc('Parsing GTF data');
|
|
46
|
-
const intervalTree = new interval_tree_1.
|
|
43
|
+
const intervalTree = new interval_tree_1.IntervalTree();
|
|
47
44
|
for (const obj of (0, gtf_nostream_1.parseStringSync)(lines)
|
|
48
45
|
.flat()
|
|
49
46
|
.map((f, i) => (0, util_2.featureData)(f, `${this.id}-${refName}-${i}`))) {
|
|
@@ -133,9 +130,6 @@ class GtfAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
|
|
|
133
130
|
}
|
|
134
131
|
}
|
|
135
132
|
const parentAggregation = {};
|
|
136
|
-
if (feats.some(f => f.uniqueId === undefined)) {
|
|
137
|
-
throw new Error('found uniqueId undefined');
|
|
138
|
-
}
|
|
139
133
|
for (const feat of feats) {
|
|
140
134
|
const aggr = feat[aggregateField];
|
|
141
135
|
if (!parentAggregation[aggr]) {
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import IntervalTree from '@flatten-js/interval-tree';
|
|
1
|
+
import { IntervalTree } from '@flatten-js/interval-tree';
|
|
2
2
|
import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
3
3
|
import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
4
|
-
import type { Feature } from '@jbrowse/core/util';
|
|
4
|
+
import type { Feature, SimpleFeatureSerialized } from '@jbrowse/core/util';
|
|
5
5
|
import type { Region } from '@jbrowse/core/util/types';
|
|
6
6
|
import type { Observer } from 'rxjs';
|
|
7
7
|
type StatusCallback = (arg: string) => void;
|
|
8
|
+
type SimpleFeat = SimpleFeatureSerialized;
|
|
8
9
|
export default class GtfAdapter extends BaseFeatureDataAdapter {
|
|
9
|
-
calculatedIntervalTreeMap: Record<string, IntervalTree
|
|
10
|
+
calculatedIntervalTreeMap: Record<string, IntervalTree<SimpleFeat>>;
|
|
10
11
|
gtfFeatures?: Promise<{
|
|
11
12
|
header: string;
|
|
12
|
-
intervalTreeMap: Record<string, (sc?: StatusCallback) => IntervalTree
|
|
13
|
+
intervalTreeMap: Record<string, (sc?: StatusCallback) => IntervalTree<SimpleFeat>>;
|
|
13
14
|
}>;
|
|
14
15
|
private loadDataP;
|
|
15
16
|
private loadData;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import IntervalTree from '@flatten-js/interval-tree';
|
|
1
|
+
import { IntervalTree } from '@flatten-js/interval-tree';
|
|
2
2
|
import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
3
3
|
import { SimpleFeature, doesIntersect2, fetchAndMaybeUnzip, max, min, } from '@jbrowse/core/util';
|
|
4
4
|
import { openLocation } from '@jbrowse/core/util/io';
|
|
@@ -128,9 +128,6 @@ export default class GtfAdapter extends BaseFeatureDataAdapter {
|
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
const parentAggregation = {};
|
|
131
|
-
if (feats.some(f => f.uniqueId === undefined)) {
|
|
132
|
-
throw new Error('found uniqueId undefined');
|
|
133
|
-
}
|
|
134
131
|
for (const feat of feats) {
|
|
135
132
|
const aggr = feat[aggregateField];
|
|
136
133
|
if (!parentAggregation[aggr]) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-gtf",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.0",
|
|
4
4
|
"description": "JBrowse 2 gtf feature adapter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"clean": "rimraf dist esm *.tsbuildinfo"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@flatten-js/interval-tree": "^
|
|
39
|
+
"@flatten-js/interval-tree": "^2.0.0",
|
|
40
40
|
"@gmod/bgzf-filehandle": "^4.0.0",
|
|
41
|
-
"@jbrowse/core": "^3.
|
|
42
|
-
"@jbrowse/plugin-linear-genome-view": "^3.
|
|
41
|
+
"@jbrowse/core": "^3.7.0",
|
|
42
|
+
"@jbrowse/plugin-linear-genome-view": "^3.7.0",
|
|
43
43
|
"@mui/material": "^7.0.0",
|
|
44
44
|
"gtf-nostream": "^1.0.0",
|
|
45
45
|
"mobx": "^6.0.0",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"distModule": "esm/index.js",
|
|
57
57
|
"srcModule": "src/index.ts",
|
|
58
58
|
"module": "esm/index.js",
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "85bdd0d58286b7adbfd408146b15847676317635"
|
|
60
60
|
}
|