@jbrowse/plugin-bed 3.2.0 → 3.3.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/BedAdapter/configSchema.d.ts +1 -0
- package/dist/BedAdapter/configSchema.js +1 -0
- package/dist/BedTabixAdapter/BedTabixAdapter.d.ts +0 -1
- package/dist/BedTabixAdapter/BedTabixAdapter.js +0 -1
- package/dist/BedpeAdapter/configSchema.d.ts +1 -0
- package/dist/BedpeAdapter/configSchema.js +1 -0
- package/dist/BigBedAdapter/BigBedAdapter.js +28 -31
- package/esm/BedAdapter/configSchema.d.ts +1 -0
- package/esm/BedAdapter/configSchema.js +1 -0
- package/esm/BedTabixAdapter/BedTabixAdapter.d.ts +0 -1
- package/esm/BedTabixAdapter/BedTabixAdapter.js +0 -1
- package/esm/BedpeAdapter/configSchema.d.ts +1 -0
- package/esm/BedpeAdapter/configSchema.js +1 -0
- package/esm/BigBedAdapter/BigBedAdapter.js +28 -31
- package/package.json +3 -3
|
@@ -5,6 +5,7 @@ function x() { }
|
|
|
5
5
|
const BedAdapter = (0, configuration_1.ConfigurationSchema)('BedAdapter', {
|
|
6
6
|
bedLocation: {
|
|
7
7
|
type: 'fileLocation',
|
|
8
|
+
description: 'path to bed file, also allows gzipped bed',
|
|
8
9
|
defaultValue: {
|
|
9
10
|
uri: '/path/to/my.bed.gz',
|
|
10
11
|
locationType: 'UriLocation',
|
|
@@ -5,6 +5,7 @@ function x() { }
|
|
|
5
5
|
const BedpeAdapter = (0, configuration_1.ConfigurationSchema)('BedpeAdapter', {
|
|
6
6
|
bedpeLocation: {
|
|
7
7
|
type: 'fileLocation',
|
|
8
|
+
description: 'can be plaintext or gzipped, not indexed so loaded into memory on startup',
|
|
8
9
|
defaultValue: {
|
|
9
10
|
uri: '/path/to/my.bedpe.gz',
|
|
10
11
|
locationType: 'UriLocation',
|
|
@@ -90,38 +90,8 @@ class BigBedAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
|
|
|
90
90
|
const feats = await (0, util_1.updateStatus)('Downloading features', statusCallback, () => bigbed.getFeatures(query.refName, query.start, query.end, {
|
|
91
91
|
basesPerSpan: query.end - query.start,
|
|
92
92
|
}));
|
|
93
|
-
if (allowRedispatch && feats.length) {
|
|
94
|
-
let minStart = Number.POSITIVE_INFINITY;
|
|
95
|
-
let maxEnd = Number.NEGATIVE_INFINITY;
|
|
96
|
-
let hasAnyAggregationField = false;
|
|
97
|
-
for (const feat of feats) {
|
|
98
|
-
if (feat.start < minStart) {
|
|
99
|
-
minStart = feat.start;
|
|
100
|
-
}
|
|
101
|
-
if (feat.end > maxEnd) {
|
|
102
|
-
maxEnd = feat.end;
|
|
103
|
-
}
|
|
104
|
-
if (feat[aggregateField]) {
|
|
105
|
-
hasAnyAggregationField = true;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
if (hasAnyAggregationField &&
|
|
109
|
-
(maxEnd > query.end || minStart < query.start)) {
|
|
110
|
-
await this.getFeaturesHelper({
|
|
111
|
-
query: {
|
|
112
|
-
...query,
|
|
113
|
-
start: minStart - 500000,
|
|
114
|
-
end: maxEnd + 500000,
|
|
115
|
-
},
|
|
116
|
-
opts,
|
|
117
|
-
observer,
|
|
118
|
-
allowRedispatch: false,
|
|
119
|
-
originalQuery: query,
|
|
120
|
-
});
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
93
|
const parentAggregation = {};
|
|
94
|
+
const parentAggregationFlat = [];
|
|
125
95
|
if (feats.some(f => f.uniqueId === undefined)) {
|
|
126
96
|
throw new Error('found uniqueId undefined');
|
|
127
97
|
}
|
|
@@ -152,6 +122,7 @@ class BigBedAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
|
|
|
152
122
|
});
|
|
153
123
|
if (aggr) {
|
|
154
124
|
parentAggregation[aggr].push(f);
|
|
125
|
+
parentAggregationFlat.push(f);
|
|
155
126
|
}
|
|
156
127
|
else {
|
|
157
128
|
if ((0, util_1.doesIntersect2)(f.start, f.end, originalQuery.start, originalQuery.end)) {
|
|
@@ -162,6 +133,32 @@ class BigBedAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
|
|
|
162
133
|
}
|
|
163
134
|
}
|
|
164
135
|
}
|
|
136
|
+
if (allowRedispatch && parentAggregationFlat.length) {
|
|
137
|
+
let minStart = Number.POSITIVE_INFINITY;
|
|
138
|
+
let maxEnd = Number.NEGATIVE_INFINITY;
|
|
139
|
+
for (const feat of parentAggregationFlat) {
|
|
140
|
+
if (feat.start < minStart) {
|
|
141
|
+
minStart = feat.start;
|
|
142
|
+
}
|
|
143
|
+
if (feat.end > maxEnd) {
|
|
144
|
+
maxEnd = feat.end;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
if (maxEnd > query.end || minStart < query.start) {
|
|
148
|
+
await this.getFeaturesHelper({
|
|
149
|
+
query: {
|
|
150
|
+
...query,
|
|
151
|
+
start: minStart - 500000,
|
|
152
|
+
end: maxEnd + 500000,
|
|
153
|
+
},
|
|
154
|
+
opts,
|
|
155
|
+
observer,
|
|
156
|
+
allowRedispatch: false,
|
|
157
|
+
originalQuery: query,
|
|
158
|
+
});
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
165
162
|
Object.entries(parentAggregation).map(([name, subfeatures]) => {
|
|
166
163
|
var _a, _b;
|
|
167
164
|
const s = (0, util_1.min)(subfeatures.map(f => f.start));
|
|
@@ -3,6 +3,7 @@ function x() { }
|
|
|
3
3
|
const BedpeAdapter = ConfigurationSchema('BedpeAdapter', {
|
|
4
4
|
bedpeLocation: {
|
|
5
5
|
type: 'fileLocation',
|
|
6
|
+
description: 'can be plaintext or gzipped, not indexed so loaded into memory on startup',
|
|
6
7
|
defaultValue: {
|
|
7
8
|
uri: '/path/to/my.bedpe.gz',
|
|
8
9
|
locationType: 'UriLocation',
|
|
@@ -85,38 +85,8 @@ export default class BigBedAdapter extends BaseFeatureDataAdapter {
|
|
|
85
85
|
const feats = await updateStatus('Downloading features', statusCallback, () => bigbed.getFeatures(query.refName, query.start, query.end, {
|
|
86
86
|
basesPerSpan: query.end - query.start,
|
|
87
87
|
}));
|
|
88
|
-
if (allowRedispatch && feats.length) {
|
|
89
|
-
let minStart = Number.POSITIVE_INFINITY;
|
|
90
|
-
let maxEnd = Number.NEGATIVE_INFINITY;
|
|
91
|
-
let hasAnyAggregationField = false;
|
|
92
|
-
for (const feat of feats) {
|
|
93
|
-
if (feat.start < minStart) {
|
|
94
|
-
minStart = feat.start;
|
|
95
|
-
}
|
|
96
|
-
if (feat.end > maxEnd) {
|
|
97
|
-
maxEnd = feat.end;
|
|
98
|
-
}
|
|
99
|
-
if (feat[aggregateField]) {
|
|
100
|
-
hasAnyAggregationField = true;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
if (hasAnyAggregationField &&
|
|
104
|
-
(maxEnd > query.end || minStart < query.start)) {
|
|
105
|
-
await this.getFeaturesHelper({
|
|
106
|
-
query: {
|
|
107
|
-
...query,
|
|
108
|
-
start: minStart - 500000,
|
|
109
|
-
end: maxEnd + 500000,
|
|
110
|
-
},
|
|
111
|
-
opts,
|
|
112
|
-
observer,
|
|
113
|
-
allowRedispatch: false,
|
|
114
|
-
originalQuery: query,
|
|
115
|
-
});
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
88
|
const parentAggregation = {};
|
|
89
|
+
const parentAggregationFlat = [];
|
|
120
90
|
if (feats.some(f => f.uniqueId === undefined)) {
|
|
121
91
|
throw new Error('found uniqueId undefined');
|
|
122
92
|
}
|
|
@@ -147,6 +117,7 @@ export default class BigBedAdapter extends BaseFeatureDataAdapter {
|
|
|
147
117
|
});
|
|
148
118
|
if (aggr) {
|
|
149
119
|
parentAggregation[aggr].push(f);
|
|
120
|
+
parentAggregationFlat.push(f);
|
|
150
121
|
}
|
|
151
122
|
else {
|
|
152
123
|
if (doesIntersect2(f.start, f.end, originalQuery.start, originalQuery.end)) {
|
|
@@ -157,6 +128,32 @@ export default class BigBedAdapter extends BaseFeatureDataAdapter {
|
|
|
157
128
|
}
|
|
158
129
|
}
|
|
159
130
|
}
|
|
131
|
+
if (allowRedispatch && parentAggregationFlat.length) {
|
|
132
|
+
let minStart = Number.POSITIVE_INFINITY;
|
|
133
|
+
let maxEnd = Number.NEGATIVE_INFINITY;
|
|
134
|
+
for (const feat of parentAggregationFlat) {
|
|
135
|
+
if (feat.start < minStart) {
|
|
136
|
+
minStart = feat.start;
|
|
137
|
+
}
|
|
138
|
+
if (feat.end > maxEnd) {
|
|
139
|
+
maxEnd = feat.end;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
if (maxEnd > query.end || minStart < query.start) {
|
|
143
|
+
await this.getFeaturesHelper({
|
|
144
|
+
query: {
|
|
145
|
+
...query,
|
|
146
|
+
start: minStart - 500000,
|
|
147
|
+
end: maxEnd + 500000,
|
|
148
|
+
},
|
|
149
|
+
opts,
|
|
150
|
+
observer,
|
|
151
|
+
allowRedispatch: false,
|
|
152
|
+
originalQuery: query,
|
|
153
|
+
});
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
160
157
|
Object.entries(parentAggregation).map(([name, subfeatures]) => {
|
|
161
158
|
var _a, _b;
|
|
162
159
|
const s = min(subfeatures.map(f => f.start));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-bed",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "JBrowse 2 bed adapters, tracks, etc.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@gmod/bed": "^2.1.2",
|
|
42
42
|
"@gmod/bgzf-filehandle": "^2.0.1",
|
|
43
43
|
"@gmod/tabix": "^2.0.0",
|
|
44
|
-
"@jbrowse/core": "^3.
|
|
44
|
+
"@jbrowse/core": "^3.3.0",
|
|
45
45
|
"mobx": "^6.0.0",
|
|
46
46
|
"mobx-react": "^9.0.0",
|
|
47
47
|
"mobx-state-tree": "^5.0.0",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"distModule": "esm/index.js",
|
|
54
54
|
"srcModule": "src/index.ts",
|
|
55
55
|
"module": "esm/index.js",
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "0bb64d8cc7ecdd167515308b31eec3d9acbc59e4"
|
|
57
57
|
}
|