@jbrowse/plugin-bed 4.1.13 → 4.1.14
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/BedAdapter/BedAdapter.js +2 -0
- package/esm/BedAdapter/configSchema.d.ts +5 -0
- package/esm/BedAdapter/configSchema.js +5 -0
- package/esm/BedTabixAdapter/BedTabixAdapter.js +2 -0
- package/esm/BedTabixAdapter/configSchema.d.ts +5 -0
- package/esm/BedTabixAdapter/configSchema.js +5 -0
- package/esm/BigBedAdapter/BigBedAdapter.js +2 -0
- package/esm/BigBedAdapter/configSchema.d.ts +5 -0
- package/esm/BigBedAdapter/configSchema.js +5 -0
- package/esm/util.d.ts +4 -2
- package/esm/util.js +5 -3
- package/package.json +2 -2
|
@@ -85,6 +85,7 @@ export default class BedAdapter extends BaseFeatureDataAdapter {
|
|
|
85
85
|
return undefined;
|
|
86
86
|
}
|
|
87
87
|
const names = await this.getNames();
|
|
88
|
+
const disableGeneHeuristic = this.getConf('disableGeneHeuristic');
|
|
88
89
|
const intervalTree = new IntervalTree();
|
|
89
90
|
for (let i = 0; i < lines.length; i++) {
|
|
90
91
|
const line = lines[i];
|
|
@@ -98,6 +99,7 @@ export default class BedAdapter extends BaseFeatureDataAdapter {
|
|
|
98
99
|
parser,
|
|
99
100
|
uniqueId,
|
|
100
101
|
names,
|
|
102
|
+
disableGeneHeuristic,
|
|
101
103
|
}));
|
|
102
104
|
intervalTree.insert([feat.get('start'), feat.get('end')], feat);
|
|
103
105
|
}
|
|
@@ -37,5 +37,10 @@ declare const BedAdapter: import("@jbrowse/core/configuration/configurationSchem
|
|
|
37
37
|
description: string;
|
|
38
38
|
defaultValue: number;
|
|
39
39
|
};
|
|
40
|
+
disableGeneHeuristic: {
|
|
41
|
+
type: string;
|
|
42
|
+
description: string;
|
|
43
|
+
defaultValue: boolean;
|
|
44
|
+
};
|
|
40
45
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
41
46
|
export default BedAdapter;
|
|
@@ -39,6 +39,11 @@ const BedAdapter = ConfigurationSchema('BedAdapter', {
|
|
|
39
39
|
description: 'The column to use as a "end" attribute',
|
|
40
40
|
defaultValue: 2,
|
|
41
41
|
},
|
|
42
|
+
disableGeneHeuristic: {
|
|
43
|
+
type: 'boolean',
|
|
44
|
+
description: 'Disable the heuristic that auto-detects BED12 features as gene/transcript structures. Useful for files that have BED12-like structure but are not genes (e.g. tandem duplications)',
|
|
45
|
+
defaultValue: false,
|
|
46
|
+
},
|
|
42
47
|
}, {
|
|
43
48
|
explicitlyTyped: true,
|
|
44
49
|
preProcessSnapshot: snap => {
|
|
@@ -76,6 +76,7 @@ export default class BedTabixAdapter extends BaseFeatureDataAdapter {
|
|
|
76
76
|
const colStart = columnNumbers.start - 1;
|
|
77
77
|
const colEnd = columnNumbers.end - 1;
|
|
78
78
|
const names = await this.getNames();
|
|
79
|
+
const disableGeneHeuristic = this.getConf('disableGeneHeuristic');
|
|
79
80
|
let start = performance.now();
|
|
80
81
|
checkStopToken(stopToken);
|
|
81
82
|
await updateStatus('Downloading features', statusCallback, () => this.bed.getLines(query.refName, query.start, query.end, {
|
|
@@ -93,6 +94,7 @@ export default class BedTabixAdapter extends BaseFeatureDataAdapter {
|
|
|
93
94
|
parser: this.parser,
|
|
94
95
|
uniqueId: `${this.id}-${fileOffset}`,
|
|
95
96
|
names,
|
|
97
|
+
disableGeneHeuristic,
|
|
96
98
|
})));
|
|
97
99
|
},
|
|
98
100
|
stopToken,
|
|
@@ -35,5 +35,10 @@ declare const BedTabixAdapter: import("@jbrowse/core/configuration/configuration
|
|
|
35
35
|
description: string;
|
|
36
36
|
defaultValue: string;
|
|
37
37
|
};
|
|
38
|
+
disableGeneHeuristic: {
|
|
39
|
+
type: string;
|
|
40
|
+
description: string;
|
|
41
|
+
defaultValue: boolean;
|
|
42
|
+
};
|
|
38
43
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
39
44
|
export default BedTabixAdapter;
|
|
@@ -38,6 +38,11 @@ const BedTabixAdapter = ConfigurationSchema('BedTabixAdapter', {
|
|
|
38
38
|
description: 'The autoSql definition for the data fields in the file',
|
|
39
39
|
defaultValue: '',
|
|
40
40
|
},
|
|
41
|
+
disableGeneHeuristic: {
|
|
42
|
+
type: 'boolean',
|
|
43
|
+
description: 'Disable the heuristic that auto-detects BED12 features as gene/transcript structures. Useful for files that have BED12-like structure but are not genes (e.g. tandem duplications)',
|
|
44
|
+
defaultValue: false,
|
|
45
|
+
},
|
|
41
46
|
}, {
|
|
42
47
|
explicitlyTyped: true,
|
|
43
48
|
preProcessSnapshot: snap => {
|
|
@@ -86,6 +86,7 @@ export default class BigBedAdapter extends BaseFeatureDataAdapter {
|
|
|
86
86
|
const { statusCallback = () => { } } = opts;
|
|
87
87
|
const scoreColumn = this.getConf('scoreColumn');
|
|
88
88
|
const aggregateField = this.getConf('aggregateField');
|
|
89
|
+
const disableGeneHeuristic = this.getConf('disableGeneHeuristic');
|
|
89
90
|
const { parser, bigbed } = await updateStatus('Downloading header', statusCallback, () => this.configure(opts));
|
|
90
91
|
const feats = await updateStatus('Downloading features', statusCallback, () => bigbed.getFeatures(query.refName, query.start, query.end, {
|
|
91
92
|
basesPerSpan: query.end - query.start,
|
|
@@ -121,6 +122,7 @@ export default class BigBedAdapter extends BaseFeatureDataAdapter {
|
|
|
121
122
|
start: feat.start,
|
|
122
123
|
end: feat.end,
|
|
123
124
|
refName: query.refName,
|
|
125
|
+
disableGeneHeuristic,
|
|
124
126
|
});
|
|
125
127
|
if (aggrIsNotNone) {
|
|
126
128
|
parentAggregation[aggr].push(f);
|
|
@@ -16,5 +16,10 @@ declare const BigBedAdapter: import("@jbrowse/core/configuration/configurationSc
|
|
|
16
16
|
description: string;
|
|
17
17
|
defaultValue: string;
|
|
18
18
|
};
|
|
19
|
+
disableGeneHeuristic: {
|
|
20
|
+
type: string;
|
|
21
|
+
description: string;
|
|
22
|
+
defaultValue: boolean;
|
|
23
|
+
};
|
|
19
24
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
20
25
|
export default BigBedAdapter;
|
|
@@ -18,6 +18,11 @@ const BigBedAdapter = ConfigurationSchema('BigBedAdapter', {
|
|
|
18
18
|
description: 'An attribute to aggregate features with',
|
|
19
19
|
defaultValue: 'geneName2',
|
|
20
20
|
},
|
|
21
|
+
disableGeneHeuristic: {
|
|
22
|
+
type: 'boolean',
|
|
23
|
+
description: 'Disable the heuristic that auto-detects BED12 features as gene/transcript structures. Useful for files that have BED12-like structure but are not genes (e.g. tandem duplications)',
|
|
24
|
+
defaultValue: false,
|
|
25
|
+
},
|
|
21
26
|
}, {
|
|
22
27
|
explicitlyTyped: true,
|
|
23
28
|
preProcessSnapshot: snap => {
|
package/esm/util.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare function makeBlocks({ start, uniqueId, refName, chromStarts, bloc
|
|
|
15
15
|
refName: string;
|
|
16
16
|
type: string;
|
|
17
17
|
}[];
|
|
18
|
-
export declare function featureData({ line, colRef, colStart, colEnd, scoreColumn, parser, uniqueId, names, }: {
|
|
18
|
+
export declare function featureData({ line, colRef, colStart, colEnd, scoreColumn, parser, uniqueId, names, disableGeneHeuristic, }: {
|
|
19
19
|
line: string;
|
|
20
20
|
colRef: number;
|
|
21
21
|
colStart: number;
|
|
@@ -24,6 +24,7 @@ export declare function featureData({ line, colRef, colStart, colEnd, scoreColum
|
|
|
24
24
|
parser: BED;
|
|
25
25
|
uniqueId: string;
|
|
26
26
|
names?: string[];
|
|
27
|
+
disableGeneHeuristic?: boolean;
|
|
27
28
|
}): FeatureData;
|
|
28
29
|
interface FeatureData {
|
|
29
30
|
uniqueId: string;
|
|
@@ -36,7 +37,7 @@ interface FeatureData {
|
|
|
36
37
|
subfeatures?: MinimalFeature[];
|
|
37
38
|
[key: string]: unknown;
|
|
38
39
|
}
|
|
39
|
-
export declare function featureData2({ splitLine, refName, start, end, parser, uniqueId, scoreColumn, names, }: {
|
|
40
|
+
export declare function featureData2({ splitLine, refName, start, end, parser, uniqueId, scoreColumn, names, disableGeneHeuristic, }: {
|
|
40
41
|
splitLine: string[];
|
|
41
42
|
refName: string;
|
|
42
43
|
start: number;
|
|
@@ -45,6 +46,7 @@ export declare function featureData2({ splitLine, refName, start, end, parser, u
|
|
|
45
46
|
uniqueId: string;
|
|
46
47
|
scoreColumn: string;
|
|
47
48
|
names?: string[];
|
|
49
|
+
disableGeneHeuristic?: boolean;
|
|
48
50
|
}): FeatureData;
|
|
49
51
|
export declare function arrayify(f?: string | number[]): number[] | undefined;
|
|
50
52
|
export {};
|
package/esm/util.js
CHANGED
|
@@ -45,7 +45,7 @@ export function makeBlocks({ start, uniqueId, refName, chromStarts, blockCount,
|
|
|
45
45
|
}
|
|
46
46
|
return subfeatures;
|
|
47
47
|
}
|
|
48
|
-
export function featureData({ line, colRef, colStart, colEnd, scoreColumn, parser, uniqueId, names, }) {
|
|
48
|
+
export function featureData({ line, colRef, colStart, colEnd, scoreColumn, parser, uniqueId, names, disableGeneHeuristic, }) {
|
|
49
49
|
const splitLine = line.split('\t');
|
|
50
50
|
const refName = splitLine[colRef];
|
|
51
51
|
const start = Number.parseInt(splitLine[colStart], 10);
|
|
@@ -59,6 +59,7 @@ export function featureData({ line, colRef, colStart, colEnd, scoreColumn, parse
|
|
|
59
59
|
uniqueId,
|
|
60
60
|
scoreColumn,
|
|
61
61
|
names,
|
|
62
|
+
disableGeneHeuristic,
|
|
62
63
|
});
|
|
63
64
|
}
|
|
64
65
|
function parseStrand(strand) {
|
|
@@ -70,7 +71,7 @@ function parseStrand(strand) {
|
|
|
70
71
|
}
|
|
71
72
|
return 0;
|
|
72
73
|
}
|
|
73
|
-
export function featureData2({ splitLine, refName, start, end, parser, uniqueId, scoreColumn, names, }) {
|
|
74
|
+
export function featureData2({ splitLine, refName, start, end, parser, uniqueId, scoreColumn, names, disableGeneHeuristic, }) {
|
|
74
75
|
const data = names
|
|
75
76
|
? defaultParser(names, splitLine)
|
|
76
77
|
: parser.parseLine(splitLine, { uniqueId });
|
|
@@ -111,7 +112,8 @@ export function featureData2({ splitLine, refName, start, end, parser, uniqueId,
|
|
|
111
112
|
subfeatures,
|
|
112
113
|
});
|
|
113
114
|
}
|
|
114
|
-
if (
|
|
115
|
+
if (!disableGeneHeuristic &&
|
|
116
|
+
subfeatures &&
|
|
115
117
|
isUcscTranscript({
|
|
116
118
|
strand,
|
|
117
119
|
blockCount: rest.blockCount,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-bed",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.14",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "JBrowse 2 bed adapters, tracks, etc.",
|
|
6
6
|
"keywords": [
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@jbrowse/mobx-state-tree": "^5.5.0",
|
|
29
29
|
"mobx": "^6.15.0",
|
|
30
30
|
"rxjs": "^7.8.2",
|
|
31
|
-
"@jbrowse/core": "^4.1.
|
|
31
|
+
"@jbrowse/core": "^4.1.14"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|