@jbrowse/plugin-gtf 3.1.0 → 3.2.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.
|
@@ -45,7 +45,7 @@ class GtfAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
if (i++ % 10000 === 0) {
|
|
48
|
-
statusCallback(`Loading ${
|
|
48
|
+
statusCallback(`Loading ${(0, util_1.getProgressDisplayStr)(blockStart, buffer.length)}`);
|
|
49
49
|
}
|
|
50
50
|
blockStart = n + 1;
|
|
51
51
|
}
|
|
@@ -55,10 +55,11 @@ class GtfAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
|
|
|
55
55
|
if (!this.calculatedIntervalTreeMap[refName]) {
|
|
56
56
|
sc === null || sc === void 0 ? void 0 : sc('Parsing GTF data');
|
|
57
57
|
const intervalTree = new interval_tree_1.default();
|
|
58
|
-
(0, gtf_nostream_1.parseStringSync)(lines)
|
|
58
|
+
for (const obj of (0, gtf_nostream_1.parseStringSync)(lines)
|
|
59
59
|
.flat()
|
|
60
|
-
.map((f, i) => (0, util_2.featureData)(f, `${this.id}-${refName}-${i}`))
|
|
61
|
-
|
|
60
|
+
.map((f, i) => (0, util_2.featureData)(f, `${this.id}-${refName}-${i}`))) {
|
|
61
|
+
intervalTree.insert([obj.start, obj.end], obj);
|
|
62
|
+
}
|
|
62
63
|
this.calculatedIntervalTreeMap[refName] = intervalTree;
|
|
63
64
|
}
|
|
64
65
|
return this.calculatedIntervalTreeMap[refName];
|
|
@@ -131,8 +132,8 @@ class GtfAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
|
|
|
131
132
|
await this.getFeaturesHelper({
|
|
132
133
|
query: {
|
|
133
134
|
...query,
|
|
134
|
-
start: minStart,
|
|
135
|
-
end: maxEnd,
|
|
135
|
+
start: minStart - 500000,
|
|
136
|
+
end: maxEnd + 500000,
|
|
136
137
|
},
|
|
137
138
|
opts,
|
|
138
139
|
observer,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import IntervalTree from '@flatten-js/interval-tree';
|
|
2
2
|
import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
3
|
-
import { SimpleFeature, doesIntersect2, fetchAndMaybeUnzip, max, min, } from '@jbrowse/core/util';
|
|
3
|
+
import { SimpleFeature, doesIntersect2, fetchAndMaybeUnzip, getProgressDisplayStr, max, min, } from '@jbrowse/core/util';
|
|
4
4
|
import { openLocation } from '@jbrowse/core/util/io';
|
|
5
5
|
import { ObservableCreate } from '@jbrowse/core/util/rxjs';
|
|
6
6
|
import { parseStringSync } from 'gtf-nostream';
|
|
@@ -40,7 +40,7 @@ export default class GtfAdapter extends BaseFeatureDataAdapter {
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
if (i++ % 10000 === 0) {
|
|
43
|
-
statusCallback(`Loading ${
|
|
43
|
+
statusCallback(`Loading ${getProgressDisplayStr(blockStart, buffer.length)}`);
|
|
44
44
|
}
|
|
45
45
|
blockStart = n + 1;
|
|
46
46
|
}
|
|
@@ -50,10 +50,11 @@ export default class GtfAdapter extends BaseFeatureDataAdapter {
|
|
|
50
50
|
if (!this.calculatedIntervalTreeMap[refName]) {
|
|
51
51
|
sc === null || sc === void 0 ? void 0 : sc('Parsing GTF data');
|
|
52
52
|
const intervalTree = new IntervalTree();
|
|
53
|
-
parseStringSync(lines)
|
|
53
|
+
for (const obj of parseStringSync(lines)
|
|
54
54
|
.flat()
|
|
55
|
-
.map((f, i) => featureData(f, `${this.id}-${refName}-${i}`))
|
|
56
|
-
|
|
55
|
+
.map((f, i) => featureData(f, `${this.id}-${refName}-${i}`))) {
|
|
56
|
+
intervalTree.insert([obj.start, obj.end], obj);
|
|
57
|
+
}
|
|
57
58
|
this.calculatedIntervalTreeMap[refName] = intervalTree;
|
|
58
59
|
}
|
|
59
60
|
return this.calculatedIntervalTreeMap[refName];
|
|
@@ -126,8 +127,8 @@ export default class GtfAdapter extends BaseFeatureDataAdapter {
|
|
|
126
127
|
await this.getFeaturesHelper({
|
|
127
128
|
query: {
|
|
128
129
|
...query,
|
|
129
|
-
start: minStart,
|
|
130
|
-
end: maxEnd,
|
|
130
|
+
start: minStart - 500000,
|
|
131
|
+
end: maxEnd + 500000,
|
|
131
132
|
},
|
|
132
133
|
opts,
|
|
133
134
|
observer,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-gtf",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "JBrowse 2 gtf feature adapter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@flatten-js/interval-tree": "^1.0.15",
|
|
40
40
|
"@gmod/bgzf-filehandle": "^2.0.1",
|
|
41
|
-
"@jbrowse/core": "^3.
|
|
42
|
-
"@jbrowse/plugin-linear-genome-view": "^3.
|
|
41
|
+
"@jbrowse/core": "^3.2.0",
|
|
42
|
+
"@jbrowse/plugin-linear-genome-view": "^3.2.0",
|
|
43
43
|
"@mui/material": "^6.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": "c750e3f56706a490c19ba75abd807fec5e38aebf"
|
|
60
60
|
}
|