@jbrowse/plugin-bed 4.2.0 → 4.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/esm/BigBedAdapter/BigBedAdapter.js +5 -4
- package/esm/GuessAdapter/index.js +10 -4
- package/esm/generateRepeatMaskerFeature.d.ts +1 -1
- package/esm/generateRepeatMaskerFeature.js +7 -2
- package/esm/generateUcscTranscript.d.ts +3 -3
- package/esm/generateUcscTranscript.js +3 -1
- package/esm/util.js +14 -12
- package/package.json +5 -5
|
@@ -109,8 +109,9 @@ export default class BigBedAdapter extends BaseFeatureDataAdapter {
|
|
|
109
109
|
});
|
|
110
110
|
const aggr = data[aggregateField];
|
|
111
111
|
const aggrIsNotNone = aggr && aggr !== 'none';
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
const aggrKey = typeof aggr === 'string' ? aggr : `${aggr}`;
|
|
113
|
+
if (aggrIsNotNone && !parentAggregation[aggrKey]) {
|
|
114
|
+
parentAggregation[aggrKey] = [];
|
|
114
115
|
}
|
|
115
116
|
const { uniqueId, type, chrom, chromStart, chromEnd, description, chromStarts: chromStarts2, blockStarts: blockStarts2, blockSizes: blockSizes2, score: score2, blockCount, thickStart, thickEnd, strand, ...rest } = data;
|
|
116
117
|
const f = featureData2({
|
|
@@ -118,14 +119,14 @@ export default class BigBedAdapter extends BaseFeatureDataAdapter {
|
|
|
118
119
|
scoreColumn,
|
|
119
120
|
splitLine,
|
|
120
121
|
parser,
|
|
121
|
-
uniqueId,
|
|
122
|
+
uniqueId: uniqueId,
|
|
122
123
|
start: feat.start,
|
|
123
124
|
end: feat.end,
|
|
124
125
|
refName: query.refName,
|
|
125
126
|
disableGeneHeuristic,
|
|
126
127
|
});
|
|
127
128
|
if (aggrIsNotNone) {
|
|
128
|
-
parentAggregation[
|
|
129
|
+
parentAggregation[aggrKey].push(f);
|
|
129
130
|
parentAggregationFlat.push(f);
|
|
130
131
|
}
|
|
131
132
|
else {
|
|
@@ -12,7 +12,7 @@ export default function GuessAdapterF(pluginManager) {
|
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
else if (testAdapter(fileName, /\.bb$/i, adapterHint, 'BigBedAdapter') ||
|
|
15
|
-
testAdapter(fileName, /\.
|
|
15
|
+
testAdapter(fileName, /\.bigbed$/i, adapterHint, 'BigBedAdapter')) {
|
|
16
16
|
return {
|
|
17
17
|
type: 'BigBedAdapter',
|
|
18
18
|
bigBedLocation: file,
|
|
@@ -40,7 +40,8 @@ export default function GuessAdapterF(pluginManager) {
|
|
|
40
40
|
},
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
|
-
else if (testAdapter(fileName, /\.
|
|
43
|
+
else if (testAdapter(fileName, /\.bedmethyl\.gz$/i, adapterHint, 'BedTabixAdapter') ||
|
|
44
|
+
testAdapter(fileName, /\.bed\.gz$/i, adapterHint, 'BedTabixAdapter')) {
|
|
44
45
|
return {
|
|
45
46
|
type: 'BedTabixAdapter',
|
|
46
47
|
bedGzLocation: file,
|
|
@@ -55,11 +56,16 @@ export default function GuessAdapterF(pluginManager) {
|
|
|
55
56
|
}
|
|
56
57
|
};
|
|
57
58
|
});
|
|
58
|
-
pluginManager.addToExtensionPoint('Core-guessTrackTypeForLocation', (trackTypeGuesser) => (adapterName) => {
|
|
59
|
+
pluginManager.addToExtensionPoint('Core-guessTrackTypeForLocation', (trackTypeGuesser) => (adapterName, file) => {
|
|
60
|
+
if (adapterName === 'BedTabixAdapter' &&
|
|
61
|
+
file &&
|
|
62
|
+
/\.bedmethyl\.gz$/i.test(getFileName(file))) {
|
|
63
|
+
return 'MultiQuantitativeTrack';
|
|
64
|
+
}
|
|
59
65
|
return ({
|
|
60
66
|
BedpeAdapter: 'VariantTrack',
|
|
61
67
|
BedGraphAdapter: 'QuantitativeTrack',
|
|
62
68
|
BedGraphTabixAdapter: 'QuantitativeTrack',
|
|
63
|
-
}[adapterName] || trackTypeGuesser(adapterName));
|
|
69
|
+
}[adapterName] || trackTypeGuesser(adapterName, file));
|
|
64
70
|
});
|
|
65
71
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function isRepeatMaskerDescriptionField(desc?:
|
|
1
|
+
export declare function isRepeatMaskerDescriptionField(desc?: unknown): desc is string;
|
|
2
2
|
export declare function generateRepeatMaskerFeature({ uniqueId, refName, start, end, description, ...rest }: {
|
|
3
3
|
uniqueId: string;
|
|
4
4
|
refName: string;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
export function isRepeatMaskerDescriptionField(desc) {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
if (typeof desc !== 'string') {
|
|
3
|
+
return false;
|
|
4
|
+
}
|
|
5
|
+
else {
|
|
6
|
+
const ret = desc.trim().split(' ');
|
|
7
|
+
return [0, 1, 2, 3, 5, 6].every(s => ret[s] !== undefined ? !Number.isNaN(+ret[s]) : false);
|
|
8
|
+
}
|
|
4
9
|
}
|
|
5
10
|
function makeRepeatTrackDescription(description) {
|
|
6
11
|
if (isRepeatMaskerDescriptionField(description)) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { MinimalFeature } from './types.ts';
|
|
2
2
|
export declare function isUcscTranscript({ thickStart, blockCount, strand, }: {
|
|
3
|
-
thickStart?:
|
|
4
|
-
blockCount?:
|
|
3
|
+
thickStart?: unknown;
|
|
4
|
+
blockCount?: unknown;
|
|
5
5
|
strand?: number;
|
|
6
|
-
}): boolean
|
|
6
|
+
}): boolean;
|
|
7
7
|
interface UcscTranscriptInput {
|
|
8
8
|
uniqueId: string;
|
|
9
9
|
strand?: number;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export function isUcscTranscript({ thickStart, blockCount, strand, }) {
|
|
2
|
-
return thickStart
|
|
2
|
+
return (typeof thickStart === 'number' &&
|
|
3
|
+
typeof blockCount === 'number' &&
|
|
4
|
+
strand !== 0);
|
|
3
5
|
}
|
|
4
6
|
function calculatePhasesFromCds(cdsRegions, strand) {
|
|
5
7
|
const sorted = [...cdsRegions].sort((a, b) => strand > 0 ? a.start - b.start : b.start - a.start);
|
package/esm/util.js
CHANGED
|
@@ -98,7 +98,7 @@ export function featureData2({ splitLine, refName, start, end, parser, uniqueId,
|
|
|
98
98
|
end,
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
|
-
if (isRepeatMaskerDescriptionField(rest.description)) {
|
|
101
|
+
else if (isRepeatMaskerDescriptionField(rest.description)) {
|
|
102
102
|
const { chromStarts: _4, blockSizes: _5, blockStarts: _6, blockCount: _7, thickStart: _8, thickEnd: _9, description, ...rest2 } = rest;
|
|
103
103
|
return generateRepeatMaskerFeature({
|
|
104
104
|
...rest2,
|
|
@@ -112,7 +112,7 @@ export function featureData2({ splitLine, refName, start, end, parser, uniqueId,
|
|
|
112
112
|
subfeatures,
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
|
-
if (!disableGeneHeuristic &&
|
|
115
|
+
else if (!disableGeneHeuristic &&
|
|
116
116
|
subfeatures &&
|
|
117
117
|
isUcscTranscript({
|
|
118
118
|
strand,
|
|
@@ -132,16 +132,18 @@ export function featureData2({ splitLine, refName, start, end, parser, uniqueId,
|
|
|
132
132
|
thickEnd: rest.thickEnd,
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
135
|
+
else {
|
|
136
|
+
return {
|
|
137
|
+
...rest,
|
|
138
|
+
uniqueId,
|
|
139
|
+
score,
|
|
140
|
+
start,
|
|
141
|
+
end,
|
|
142
|
+
strand,
|
|
143
|
+
refName,
|
|
144
|
+
subfeatures,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
145
147
|
}
|
|
146
148
|
export function arrayify(f) {
|
|
147
149
|
if (f === undefined) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-bed",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "JBrowse 2 bed adapters, tracks, etc.",
|
|
6
6
|
"keywords": [
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@flatten-js/interval-tree": "^2.0.3",
|
|
25
25
|
"@gmod/bbi": "^9.0.9",
|
|
26
|
-
"@gmod/bed": "^2.1
|
|
27
|
-
"@gmod/tabix": "^3.3.
|
|
26
|
+
"@gmod/bed": "^2.2.1",
|
|
27
|
+
"@gmod/tabix": "^3.3.3",
|
|
28
28
|
"@jbrowse/mobx-state-tree": "^5.6.0",
|
|
29
|
-
"mobx": "^6.15.
|
|
29
|
+
"mobx": "^6.15.3",
|
|
30
30
|
"rxjs": "^7.8.2",
|
|
31
|
-
"@jbrowse/core": "^4.
|
|
31
|
+
"@jbrowse/core": "^4.3.0"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|