@jbrowse/plugin-sequence 2.17.0 → 2.18.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/BgzipFastaAdapter/configSchema.d.ts +0 -12
- package/dist/BgzipFastaAdapter/configSchema.js +1 -16
- package/dist/BgzipFastaAdapter/index.d.ts +1 -1
- package/dist/BgzipFastaAdapter/index.js +11 -9
- package/dist/ChromSizesAdapter/ChromSizesAdapter.d.ts +2 -1
- package/dist/ChromSizesAdapter/ChromSizesAdapter.js +1 -1
- package/dist/ChromSizesAdapter/configSchema.d.ts +0 -3
- package/dist/ChromSizesAdapter/configSchema.js +1 -7
- package/dist/ChromSizesAdapter/index.d.ts +1 -1
- package/dist/DivSequenceRenderer/components/DivSequenceRendering.d.ts +3 -3
- package/dist/DivSequenceRenderer/components/DivSequenceRendering.js +4 -10
- package/dist/DivSequenceRenderer/configSchema.d.ts +0 -3
- package/dist/DivSequenceRenderer/configSchema.js +1 -7
- package/dist/DivSequenceRenderer/index.d.ts +1 -1
- package/dist/DivSequenceRenderer/index.js +0 -1
- package/dist/IndexedFastaAdapter/IndexedFastaAdapter.d.ts +6 -10
- package/dist/IndexedFastaAdapter/IndexedFastaAdapter.js +46 -40
- package/dist/IndexedFastaAdapter/configSchema.d.ts +0 -9
- package/dist/IndexedFastaAdapter/configSchema.js +1 -13
- package/dist/IndexedFastaAdapter/index.d.ts +1 -1
- package/dist/IndexedFastaAdapter/index.js +11 -9
- package/dist/LinearReferenceSequenceDisplay/configSchema.d.ts +0 -3
- package/dist/LinearReferenceSequenceDisplay/configSchema.js +1 -7
- package/dist/LinearReferenceSequenceDisplay/index.d.ts +1 -1
- package/dist/LinearReferenceSequenceDisplay/model.d.ts +11 -92
- package/dist/LinearReferenceSequenceDisplay/model.js +4 -65
- package/dist/ReferenceSequenceTrack/configSchema.d.ts +1 -27
- package/dist/ReferenceSequenceTrack/configSchema.js +2 -42
- package/dist/ReferenceSequenceTrack/index.d.ts +1 -1
- package/dist/SequenceSearchAdapter/SequenceSearchAdapter.d.ts +3 -2
- package/dist/SequenceSearchAdapter/SequenceSearchAdapter.js +2 -2
- package/dist/SequenceSearchAdapter/configSchema.d.ts +0 -15
- package/dist/SequenceSearchAdapter/configSchema.js +1 -19
- package/dist/SequenceSearchAdapter/index.d.ts +1 -1
- package/dist/SequenceSearchAdapter/index.js +11 -9
- package/dist/TwoBitAdapter/TwoBitAdapter.d.ts +22 -19
- package/dist/TwoBitAdapter/TwoBitAdapter.js +35 -37
- package/dist/TwoBitAdapter/configSchema.d.ts +0 -6
- package/dist/TwoBitAdapter/configSchema.js +1 -10
- package/dist/TwoBitAdapter/index.d.ts +1 -1
- package/dist/UnindexedFastaAdapter/UnindexedFastaAdapter.d.ts +4 -3
- package/dist/UnindexedFastaAdapter/UnindexedFastaAdapter.js +3 -3
- package/dist/UnindexedFastaAdapter/configSchema.d.ts +0 -6
- package/dist/UnindexedFastaAdapter/configSchema.js +1 -10
- package/dist/UnindexedFastaAdapter/index.d.ts +1 -1
- package/dist/UnindexedFastaAdapter/index.js +11 -9
- package/dist/createExtensionPoints.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -5
- package/esm/BgzipFastaAdapter/configSchema.d.ts +0 -12
- package/esm/BgzipFastaAdapter/configSchema.js +1 -16
- package/esm/BgzipFastaAdapter/index.d.ts +1 -1
- package/esm/BgzipFastaAdapter/index.js +11 -9
- package/esm/ChromSizesAdapter/ChromSizesAdapter.d.ts +2 -1
- package/esm/ChromSizesAdapter/ChromSizesAdapter.js +2 -2
- package/esm/ChromSizesAdapter/configSchema.d.ts +0 -3
- package/esm/ChromSizesAdapter/configSchema.js +1 -7
- package/esm/ChromSizesAdapter/index.d.ts +1 -1
- package/esm/DivSequenceRenderer/components/DivSequenceRendering.d.ts +3 -3
- package/esm/DivSequenceRenderer/components/DivSequenceRendering.js +4 -10
- package/esm/DivSequenceRenderer/configSchema.d.ts +0 -3
- package/esm/DivSequenceRenderer/configSchema.js +1 -7
- package/esm/DivSequenceRenderer/index.d.ts +1 -1
- package/esm/DivSequenceRenderer/index.js +0 -1
- package/esm/IndexedFastaAdapter/IndexedFastaAdapter.d.ts +6 -10
- package/esm/IndexedFastaAdapter/IndexedFastaAdapter.js +47 -41
- package/esm/IndexedFastaAdapter/configSchema.d.ts +0 -9
- package/esm/IndexedFastaAdapter/configSchema.js +1 -13
- package/esm/IndexedFastaAdapter/index.d.ts +1 -1
- package/esm/IndexedFastaAdapter/index.js +11 -9
- package/esm/LinearReferenceSequenceDisplay/configSchema.d.ts +0 -3
- package/esm/LinearReferenceSequenceDisplay/configSchema.js +1 -7
- package/esm/LinearReferenceSequenceDisplay/index.d.ts +1 -1
- package/esm/LinearReferenceSequenceDisplay/model.d.ts +11 -92
- package/esm/LinearReferenceSequenceDisplay/model.js +5 -66
- package/esm/ReferenceSequenceTrack/configSchema.d.ts +1 -27
- package/esm/ReferenceSequenceTrack/configSchema.js +2 -42
- package/esm/ReferenceSequenceTrack/index.d.ts +1 -1
- package/esm/SequenceSearchAdapter/SequenceSearchAdapter.d.ts +3 -2
- package/esm/SequenceSearchAdapter/SequenceSearchAdapter.js +3 -3
- package/esm/SequenceSearchAdapter/configSchema.d.ts +0 -15
- package/esm/SequenceSearchAdapter/configSchema.js +1 -19
- package/esm/SequenceSearchAdapter/index.d.ts +1 -1
- package/esm/SequenceSearchAdapter/index.js +11 -9
- package/esm/TwoBitAdapter/TwoBitAdapter.d.ts +22 -19
- package/esm/TwoBitAdapter/TwoBitAdapter.js +35 -37
- package/esm/TwoBitAdapter/configSchema.d.ts +0 -6
- package/esm/TwoBitAdapter/configSchema.js +1 -10
- package/esm/TwoBitAdapter/index.d.ts +1 -1
- package/esm/UnindexedFastaAdapter/UnindexedFastaAdapter.d.ts +4 -3
- package/esm/UnindexedFastaAdapter/UnindexedFastaAdapter.js +4 -4
- package/esm/UnindexedFastaAdapter/configSchema.d.ts +0 -6
- package/esm/UnindexedFastaAdapter/configSchema.js +1 -10
- package/esm/UnindexedFastaAdapter/index.d.ts +1 -1
- package/esm/UnindexedFastaAdapter/index.js +11 -9
- package/esm/createExtensionPoints.d.ts +1 -1
- package/esm/createExtensionPoints.js +1 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.js +5 -5
- package/package.json +2 -2
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
declare const BgzipFastaAdapter: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
|
-
/**
|
|
3
|
-
* #slot
|
|
4
|
-
*/
|
|
5
2
|
fastaLocation: {
|
|
6
3
|
type: string;
|
|
7
4
|
defaultValue: {
|
|
@@ -9,9 +6,6 @@ declare const BgzipFastaAdapter: import("@jbrowse/core/configuration/configurati
|
|
|
9
6
|
locationType: string;
|
|
10
7
|
};
|
|
11
8
|
};
|
|
12
|
-
/**
|
|
13
|
-
* #slot
|
|
14
|
-
*/
|
|
15
9
|
faiLocation: {
|
|
16
10
|
type: string;
|
|
17
11
|
defaultValue: {
|
|
@@ -19,9 +13,6 @@ declare const BgzipFastaAdapter: import("@jbrowse/core/configuration/configurati
|
|
|
19
13
|
locationType: string;
|
|
20
14
|
};
|
|
21
15
|
};
|
|
22
|
-
/**
|
|
23
|
-
* #slot
|
|
24
|
-
*/
|
|
25
16
|
metadataLocation: {
|
|
26
17
|
description: string;
|
|
27
18
|
type: string;
|
|
@@ -30,9 +21,6 @@ declare const BgzipFastaAdapter: import("@jbrowse/core/configuration/configurati
|
|
|
30
21
|
locationType: string;
|
|
31
22
|
};
|
|
32
23
|
};
|
|
33
|
-
/**
|
|
34
|
-
* #slot
|
|
35
|
-
*/
|
|
36
24
|
gziLocation: {
|
|
37
25
|
type: string;
|
|
38
26
|
defaultValue: {
|
|
@@ -1,21 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const configuration_1 = require("@jbrowse/core/configuration");
|
|
4
|
-
|
|
5
|
-
* #config BgzipFastaAdapter
|
|
6
|
-
*/
|
|
7
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
|
+
function x() { }
|
|
8
5
|
const BgzipFastaAdapter = (0, configuration_1.ConfigurationSchema)('BgzipFastaAdapter', {
|
|
9
|
-
/**
|
|
10
|
-
* #slot
|
|
11
|
-
*/
|
|
12
6
|
fastaLocation: {
|
|
13
7
|
type: 'fileLocation',
|
|
14
8
|
defaultValue: { uri: '/path/to/seq.fa.gz', locationType: 'UriLocation' },
|
|
15
9
|
},
|
|
16
|
-
/**
|
|
17
|
-
* #slot
|
|
18
|
-
*/
|
|
19
10
|
faiLocation: {
|
|
20
11
|
type: 'fileLocation',
|
|
21
12
|
defaultValue: {
|
|
@@ -23,9 +14,6 @@ const BgzipFastaAdapter = (0, configuration_1.ConfigurationSchema)('BgzipFastaAd
|
|
|
23
14
|
locationType: 'UriLocation',
|
|
24
15
|
},
|
|
25
16
|
},
|
|
26
|
-
/**
|
|
27
|
-
* #slot
|
|
28
|
-
*/
|
|
29
17
|
metadataLocation: {
|
|
30
18
|
description: 'Optional metadata file',
|
|
31
19
|
type: 'fileLocation',
|
|
@@ -34,9 +22,6 @@ const BgzipFastaAdapter = (0, configuration_1.ConfigurationSchema)('BgzipFastaAd
|
|
|
34
22
|
locationType: 'UriLocation',
|
|
35
23
|
},
|
|
36
24
|
},
|
|
37
|
-
/**
|
|
38
|
-
* #slot
|
|
39
|
-
*/
|
|
40
25
|
gziLocation: {
|
|
41
26
|
type: 'fileLocation',
|
|
42
27
|
defaultValue: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function BgzipFastaAdapterF(pluginManager: PluginManager): void;
|
|
@@ -30,13 +30,15 @@ exports.default = BgzipFastaAdapterF;
|
|
|
30
30
|
const AdapterType_1 = __importDefault(require("@jbrowse/core/pluggableElementTypes/AdapterType"));
|
|
31
31
|
const configSchema_1 = __importDefault(require("./configSchema"));
|
|
32
32
|
function BgzipFastaAdapterF(pluginManager) {
|
|
33
|
-
pluginManager.addAdapterType(() =>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
pluginManager.addAdapterType(() => {
|
|
34
|
+
return new AdapterType_1.default({
|
|
35
|
+
name: 'BgzipFastaAdapter',
|
|
36
|
+
displayName: 'Bgzip-indexed FASTA adapter',
|
|
37
|
+
configSchema: configSchema_1.default,
|
|
38
|
+
adapterMetadata: {
|
|
39
|
+
hiddenFromGUI: true,
|
|
40
|
+
},
|
|
41
|
+
getAdapterClass: () => Promise.resolve().then(() => __importStar(require('./BgzipFastaAdapter'))).then(r => r.default),
|
|
42
|
+
});
|
|
43
|
+
});
|
|
42
44
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
+
import type { RegionsAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
3
|
export default class ChromSizesAdapter extends BaseAdapter implements RegionsAdapter {
|
|
3
4
|
protected setupP?: Promise<Record<string, number>>;
|
|
4
5
|
setupPre(): Promise<{
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const configuration_1 = require("@jbrowse/core/configuration");
|
|
4
|
-
|
|
5
|
-
* #config ChromSizesAdapter
|
|
6
|
-
*/
|
|
7
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
|
+
function x() { }
|
|
8
5
|
const ChromSizesAdapter = (0, configuration_1.ConfigurationSchema)('ChromSizesAdapter', {
|
|
9
|
-
/**
|
|
10
|
-
* #slot
|
|
11
|
-
*/
|
|
12
6
|
chromSizesLocation: {
|
|
13
7
|
type: 'fileLocation',
|
|
14
8
|
defaultValue: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function ChromSizesAdapterF(pluginManager: PluginManager): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
|
-
import { Feature, Region } from '@jbrowse/core/util';
|
|
4
|
-
import { Theme } from '@mui/material';
|
|
2
|
+
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
|
+
import type { Feature, Region } from '@jbrowse/core/util';
|
|
4
|
+
import type { Theme } from '@mui/material';
|
|
5
5
|
declare const DivSequenceRendering: (props: {
|
|
6
6
|
exportSVG?: {
|
|
7
7
|
rasterizeLayers: boolean;
|
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
7
|
const ui_1 = require("@jbrowse/core/ui");
|
|
8
|
-
const mobx_react_1 = require("mobx-react");
|
|
9
8
|
const util_1 = require("@jbrowse/core/util");
|
|
9
|
+
const mobx_react_1 = require("mobx-react");
|
|
10
10
|
function Translation({ codonTable, seq, frame, bpPerPx, colorByCDS, region, seqStart, height, y, reverse = false, theme, }) {
|
|
11
11
|
var _a, _b;
|
|
12
12
|
const normalizedFrame = Math.abs(frame) - 1;
|
|
@@ -49,7 +49,7 @@ function Translation({ codonTable, seq, frame, bpPerPx, colorByCDS, region, seqS
|
|
|
49
49
|
return !(renderLetter || codonFill) ? null : (react_1.default.createElement(react_1.default.Fragment, { key: `${index}-${letter}` },
|
|
50
50
|
react_1.default.createElement("rect", { x: x, y: y, width: renderLetter
|
|
51
51
|
? codonWidth
|
|
52
|
-
: codonWidth + 0.7
|
|
52
|
+
: codonWidth + 0.7, height: height, stroke: renderLetter ? '#555' : 'none', fill: codonFill || 'none' }),
|
|
53
53
|
renderLetter ? (react_1.default.createElement("text", { x: x + codonWidth / 2, fontSize: height - 2, y: y + height / 2, dominantBaseline: "middle", textAnchor: "middle" }, letter)) : null));
|
|
54
54
|
})));
|
|
55
55
|
}
|
|
@@ -63,13 +63,11 @@ function Sequence({ bpPerPx, region, feature, sequenceType, theme, height, seq,
|
|
|
63
63
|
const w = Math.max((rightPx - leftPx) / len, 0.8);
|
|
64
64
|
return (react_1.default.createElement(react_1.default.Fragment, null, seq.split('').map((letter, index) => {
|
|
65
65
|
const color = sequenceType === 'dna'
|
|
66
|
-
?
|
|
66
|
+
?
|
|
67
67
|
theme.palette.bases[letter.toUpperCase()]
|
|
68
68
|
: undefined;
|
|
69
69
|
const x = reverse ? rightPx - (index + 1) * w : leftPx + index * w;
|
|
70
|
-
return (
|
|
71
|
-
/* biome-ignore lint/suspicious/noArrayIndexKey: */
|
|
72
|
-
react_1.default.createElement(react_1.default.Fragment, { key: `${letter}-${index}` },
|
|
70
|
+
return (react_1.default.createElement(react_1.default.Fragment, { key: `${letter}-${index}` },
|
|
73
71
|
react_1.default.createElement("rect", { x: x, y: y, width: w, height: height, fill: color ? color.main : '#aaa', stroke: render ? '#555' : 'none' }),
|
|
74
72
|
render ? (react_1.default.createElement("text", { x: x + w / 2, y: y + height / 2, dominantBaseline: "middle", textAnchor: "middle", fontSize: height - 2, fill: color ? theme.palette.getContrastText(color.main) : 'black' }, letter)) : null));
|
|
75
73
|
})));
|
|
@@ -86,13 +84,10 @@ function SequenceSVG({ regions, theme: configTheme, colorByCDS, features = new M
|
|
|
86
84
|
if (!seq) {
|
|
87
85
|
return null;
|
|
88
86
|
}
|
|
89
|
-
// incrementer for the y-position of the current sequence being rendered
|
|
90
|
-
// (applies to both translation rows and dna rows)
|
|
91
87
|
let currY = -rowHeight;
|
|
92
88
|
const showSequence = bpPerPx <= 1;
|
|
93
89
|
const forwardFrames = showTranslation && showForward ? [3, 2, 1] : [];
|
|
94
90
|
const reverseFrames = showTranslation && showReverse ? [-1, -2, -3] : [];
|
|
95
|
-
// if region.reversed, the forward translation is on bottom, reverse on top
|
|
96
91
|
const [topFrames, bottomFrames] = region.reversed
|
|
97
92
|
? [reverseFrames.toReversed(), forwardFrames.toReversed()]
|
|
98
93
|
: [forwardFrames, reverseFrames];
|
|
@@ -104,7 +99,6 @@ function SequenceSVG({ regions, theme: configTheme, colorByCDS, features = new M
|
|
|
104
99
|
}
|
|
105
100
|
function Wrapper({ exportSVG, width, totalHeight, children, }) {
|
|
106
101
|
return exportSVG ? (children) : (react_1.default.createElement("svg", { "data-testid": "sequence_track", width: width, height: totalHeight, style: {
|
|
107
|
-
// use block because svg by default is inline, which adds a margin
|
|
108
102
|
display: 'block',
|
|
109
103
|
width,
|
|
110
104
|
height: totalHeight,
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const configuration_1 = require("@jbrowse/core/configuration");
|
|
4
|
-
|
|
5
|
-
* #config DivSequenceRenderer
|
|
6
|
-
*/
|
|
7
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
|
+
function x() { }
|
|
8
5
|
const DivSequenceRenderer = (0, configuration_1.ConfigurationSchema)('DivSequenceRenderer', {
|
|
9
|
-
/**
|
|
10
|
-
* #slot
|
|
11
|
-
*/
|
|
12
6
|
height: {
|
|
13
7
|
type: 'number',
|
|
14
8
|
description: 'height in pixels of each line of sequence',
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function DivSequenceRendererF(pluginManager: PluginManager): void;
|
|
@@ -7,7 +7,6 @@ exports.default = DivSequenceRendererF;
|
|
|
7
7
|
const FeatureRendererType_1 = __importDefault(require("@jbrowse/core/pluggableElementTypes/renderers/FeatureRendererType"));
|
|
8
8
|
const DivSequenceRendering_1 = __importDefault(require("./components/DivSequenceRendering"));
|
|
9
9
|
const configSchema_1 = __importDefault(require("./configSchema"));
|
|
10
|
-
/* adjust in both directions */
|
|
11
10
|
class DivSequenceRenderer extends FeatureRendererType_1.default {
|
|
12
11
|
constructor() {
|
|
13
12
|
super(...arguments);
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { IndexedFasta } from '@gmod/indexedfasta';
|
|
2
|
-
import { BaseSequenceAdapter
|
|
3
|
-
import {
|
|
4
|
-
import { Feature } from '@jbrowse/core/util';
|
|
2
|
+
import { BaseSequenceAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
3
|
+
import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
4
|
+
import type { Feature } from '@jbrowse/core/util';
|
|
5
|
+
import type { NoAssemblyRegion } from '@jbrowse/core/util/types';
|
|
5
6
|
export default class IndexedFastaAdapter extends BaseSequenceAdapter {
|
|
6
7
|
protected setupP?: Promise<{
|
|
7
8
|
fasta: IndexedFasta;
|
|
8
9
|
}>;
|
|
9
10
|
private seqCache;
|
|
10
|
-
getRefNames(
|
|
11
|
-
getRegions(
|
|
11
|
+
getRefNames(_opts?: BaseOptions): Promise<string[]>;
|
|
12
|
+
getRegions(_opts?: BaseOptions): Promise<{
|
|
12
13
|
refName: string;
|
|
13
14
|
start: number;
|
|
14
15
|
end: number;
|
|
@@ -21,10 +22,5 @@ export default class IndexedFastaAdapter extends BaseSequenceAdapter {
|
|
|
21
22
|
fasta: IndexedFasta;
|
|
22
23
|
}>;
|
|
23
24
|
getFeatures(region: NoAssemblyRegion, opts?: BaseOptions): import("rxjs").Observable<Feature>;
|
|
24
|
-
/**
|
|
25
|
-
* called to provide a hint that data tied to a certain region
|
|
26
|
-
* will not be needed for the foreseeable future and can be purged
|
|
27
|
-
* from caches, etc
|
|
28
|
-
*/
|
|
29
25
|
freeResources(): void;
|
|
30
26
|
}
|
|
@@ -3,31 +3,32 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const abortable_promise_cache_1 = __importDefault(require("@gmod/abortable-promise-cache"));
|
|
6
7
|
const indexedfasta_1 = require("@gmod/indexedfasta");
|
|
7
8
|
const BaseAdapter_1 = require("@jbrowse/core/data_adapters/BaseAdapter");
|
|
8
|
-
const io_1 = require("@jbrowse/core/util/io");
|
|
9
|
-
const rxjs_1 = require("@jbrowse/core/util/rxjs");
|
|
10
9
|
const util_1 = require("@jbrowse/core/util");
|
|
11
|
-
const abortable_promise_cache_1 = __importDefault(require("@gmod/abortable-promise-cache"));
|
|
12
10
|
const QuickLRU_1 = __importDefault(require("@jbrowse/core/util/QuickLRU"));
|
|
11
|
+
const io_1 = require("@jbrowse/core/util/io");
|
|
12
|
+
const rxjs_1 = require("@jbrowse/core/util/rxjs");
|
|
13
|
+
const stopToken_1 = require("@jbrowse/core/util/stopToken");
|
|
13
14
|
class IndexedFastaAdapter extends BaseAdapter_1.BaseSequenceAdapter {
|
|
14
15
|
constructor() {
|
|
15
16
|
super(...arguments);
|
|
16
17
|
this.seqCache = new abortable_promise_cache_1.default({
|
|
17
18
|
cache: new QuickLRU_1.default({ maxSize: 200 }),
|
|
18
|
-
fill: async (args
|
|
19
|
+
fill: async (args) => {
|
|
19
20
|
const { refName, start, end, fasta } = args;
|
|
20
|
-
return fasta.getSequence(refName, start, end
|
|
21
|
+
return fasta.getSequence(refName, start, end);
|
|
21
22
|
},
|
|
22
23
|
});
|
|
23
24
|
}
|
|
24
|
-
async getRefNames(
|
|
25
|
+
async getRefNames(_opts) {
|
|
25
26
|
const { fasta } = await this.setup();
|
|
26
|
-
return fasta.getSequenceNames(
|
|
27
|
+
return fasta.getSequenceNames();
|
|
27
28
|
}
|
|
28
|
-
async getRegions(
|
|
29
|
+
async getRegions(_opts) {
|
|
29
30
|
const { fasta } = await this.setup();
|
|
30
|
-
const seqSizes = await fasta.getSequenceSizes(
|
|
31
|
+
const seqSizes = await fasta.getSequenceSizes();
|
|
31
32
|
return Object.keys(seqSizes).map(refName => ({
|
|
32
33
|
refName,
|
|
33
34
|
start: 0,
|
|
@@ -60,41 +61,46 @@ class IndexedFastaAdapter extends BaseAdapter_1.BaseSequenceAdapter {
|
|
|
60
61
|
return this.setupP;
|
|
61
62
|
}
|
|
62
63
|
getFeatures(region, opts) {
|
|
64
|
+
const { statusCallback = () => { }, stopToken } = opts || {};
|
|
63
65
|
const { refName, start, end } = region;
|
|
64
66
|
return (0, rxjs_1.ObservableCreate)(async (observer) => {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
67
|
+
await (0, util_1.updateStatus2)('Downloading sequence', statusCallback, stopToken, async () => {
|
|
68
|
+
const { fasta } = await this.setup();
|
|
69
|
+
const size = await fasta.getSequenceSize(refName);
|
|
70
|
+
const regionEnd = Math.min(size, end);
|
|
71
|
+
const chunks = [];
|
|
72
|
+
const chunkSize = 128000;
|
|
73
|
+
const s = start - (start % chunkSize);
|
|
74
|
+
const e = end + (chunkSize - (end % chunkSize));
|
|
75
|
+
for (let chunkStart = s; chunkStart < e; chunkStart += chunkSize) {
|
|
76
|
+
const r = {
|
|
77
|
+
refName,
|
|
78
|
+
start: chunkStart,
|
|
79
|
+
end: chunkStart + chunkSize,
|
|
80
|
+
};
|
|
81
|
+
(0, stopToken_1.checkStopToken)(stopToken);
|
|
82
|
+
chunks.push(await this.seqCache.get(JSON.stringify(r), { ...r, fasta }));
|
|
83
|
+
}
|
|
84
|
+
const seq = chunks
|
|
85
|
+
.filter(f => !!f)
|
|
86
|
+
.join('')
|
|
87
|
+
.slice(start - s)
|
|
88
|
+
.slice(0, end - start);
|
|
89
|
+
if (seq) {
|
|
90
|
+
observer.next(new util_1.SimpleFeature({
|
|
91
|
+
id: `${refName}-${start}-${regionEnd}`,
|
|
92
|
+
data: {
|
|
93
|
+
refName,
|
|
94
|
+
start,
|
|
95
|
+
end: regionEnd,
|
|
96
|
+
seq,
|
|
97
|
+
},
|
|
98
|
+
}));
|
|
99
|
+
}
|
|
100
|
+
});
|
|
90
101
|
observer.complete();
|
|
91
102
|
});
|
|
92
103
|
}
|
|
93
|
-
|
|
94
|
-
* called to provide a hint that data tied to a certain region
|
|
95
|
-
* will not be needed for the foreseeable future and can be purged
|
|
96
|
-
* from caches, etc
|
|
97
|
-
*/
|
|
98
|
-
freeResources( /* { region } */) { }
|
|
104
|
+
freeResources() { }
|
|
99
105
|
}
|
|
100
106
|
exports.default = IndexedFastaAdapter;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
declare const IndexedFastaAdapter: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
|
-
/**
|
|
3
|
-
* #slot
|
|
4
|
-
*/
|
|
5
2
|
fastaLocation: {
|
|
6
3
|
type: string;
|
|
7
4
|
defaultValue: {
|
|
@@ -9,9 +6,6 @@ declare const IndexedFastaAdapter: import("@jbrowse/core/configuration/configura
|
|
|
9
6
|
locationType: string;
|
|
10
7
|
};
|
|
11
8
|
};
|
|
12
|
-
/**
|
|
13
|
-
* #slot
|
|
14
|
-
*/
|
|
15
9
|
faiLocation: {
|
|
16
10
|
type: string;
|
|
17
11
|
defaultValue: {
|
|
@@ -19,9 +13,6 @@ declare const IndexedFastaAdapter: import("@jbrowse/core/configuration/configura
|
|
|
19
13
|
locationType: string;
|
|
20
14
|
};
|
|
21
15
|
};
|
|
22
|
-
/**
|
|
23
|
-
* #slot
|
|
24
|
-
*/
|
|
25
16
|
metadataLocation: {
|
|
26
17
|
description: string;
|
|
27
18
|
type: string;
|
|
@@ -1,28 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const configuration_1 = require("@jbrowse/core/configuration");
|
|
4
|
-
|
|
5
|
-
* #config IndexedFastaAdapter
|
|
6
|
-
*/
|
|
7
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
|
+
function x() { }
|
|
8
5
|
const IndexedFastaAdapter = (0, configuration_1.ConfigurationSchema)('IndexedFastaAdapter', {
|
|
9
|
-
/**
|
|
10
|
-
* #slot
|
|
11
|
-
*/
|
|
12
6
|
fastaLocation: {
|
|
13
7
|
type: 'fileLocation',
|
|
14
8
|
defaultValue: { uri: '/path/to/seq.fa', locationType: 'UriLocation' },
|
|
15
9
|
},
|
|
16
|
-
/**
|
|
17
|
-
* #slot
|
|
18
|
-
*/
|
|
19
10
|
faiLocation: {
|
|
20
11
|
type: 'fileLocation',
|
|
21
12
|
defaultValue: { uri: '/path/to/seq.fa.fai', locationType: 'UriLocation' },
|
|
22
13
|
},
|
|
23
|
-
/**
|
|
24
|
-
* #slot
|
|
25
|
-
*/
|
|
26
14
|
metadataLocation: {
|
|
27
15
|
description: 'Optional metadata file',
|
|
28
16
|
type: 'fileLocation',
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function IndexedFastaAdapterF(pluginManager: PluginManager): void;
|
|
@@ -30,13 +30,15 @@ exports.default = IndexedFastaAdapterF;
|
|
|
30
30
|
const AdapterType_1 = __importDefault(require("@jbrowse/core/pluggableElementTypes/AdapterType"));
|
|
31
31
|
const configSchema_1 = __importDefault(require("./configSchema"));
|
|
32
32
|
function IndexedFastaAdapterF(pluginManager) {
|
|
33
|
-
pluginManager.addAdapterType(() =>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
pluginManager.addAdapterType(() => {
|
|
34
|
+
return new AdapterType_1.default({
|
|
35
|
+
name: 'IndexedFastaAdapter',
|
|
36
|
+
displayName: 'Indexed FASTA adapter',
|
|
37
|
+
configSchema: configSchema_1.default,
|
|
38
|
+
adapterMetadata: {
|
|
39
|
+
hiddenFromGUI: true,
|
|
40
|
+
},
|
|
41
|
+
getAdapterClass: () => Promise.resolve().then(() => __importStar(require('./IndexedFastaAdapter'))).then(r => r.default),
|
|
42
|
+
});
|
|
43
|
+
});
|
|
42
44
|
}
|
|
@@ -6,13 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.configSchema = void 0;
|
|
7
7
|
const configuration_1 = require("@jbrowse/core/configuration");
|
|
8
8
|
const configSchema_1 = __importDefault(require("../DivSequenceRenderer/configSchema"));
|
|
9
|
-
|
|
10
|
-
* #config LinearReferenceSequenceDisplay
|
|
11
|
-
*/
|
|
12
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
9
|
+
function x() { }
|
|
13
10
|
exports.configSchema = (0, configuration_1.ConfigurationSchema)('LinearReferenceSequenceDisplay', {
|
|
14
|
-
/**
|
|
15
|
-
* #slot
|
|
16
|
-
*/
|
|
17
11
|
renderer: configSchema_1.default,
|
|
18
12
|
}, { explicitIdentifier: 'displayId', explicitlyTyped: true });
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function LinearReferenceSequenceDisplayF(pluginManager: PluginManager): void;
|