@jbrowse/plugin-sequence 3.5.0 → 3.6.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/DivSequenceRenderer/components/DivSequenceRendering.d.ts +1 -3
- package/dist/DivSequenceRenderer/components/DivSequenceRendering.js +16 -13
- package/dist/IndexedFastaAdapter/IndexedFastaAdapter.js +8 -1
- package/dist/LinearReferenceSequenceDisplay/model.d.ts +1 -0
- package/esm/DivSequenceRenderer/components/DivSequenceRendering.d.ts +1 -3
- package/esm/DivSequenceRenderer/components/DivSequenceRendering.js +16 -13
- package/esm/IndexedFastaAdapter/IndexedFastaAdapter.js +8 -1
- package/esm/LinearReferenceSequenceDisplay/model.d.ts +1 -0
- package/package.json +5 -5
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
2
2
|
import type { Feature, Region } from '@jbrowse/core/util';
|
|
3
|
-
|
|
4
|
-
declare const DivSequenceRendering: ({ exportSVG, features, regions, colorByCDS, bpPerPx, rowHeight, sequenceHeight, theme, showForward, showReverse, showTranslation, }: {
|
|
3
|
+
declare const DivSequenceRendering: ({ exportSVG, features, regions, colorByCDS, bpPerPx, rowHeight, sequenceHeight, showForward, showReverse, showTranslation, }: {
|
|
5
4
|
exportSVG?: {
|
|
6
5
|
rasterizeLayers: boolean;
|
|
7
6
|
};
|
|
@@ -12,7 +11,6 @@ declare const DivSequenceRendering: ({ exportSVG, features, regions, colorByCDS,
|
|
|
12
11
|
rowHeight: number;
|
|
13
12
|
sequenceHeight: number;
|
|
14
13
|
config: AnyConfigurationModel;
|
|
15
|
-
theme?: Theme;
|
|
16
14
|
showForward?: boolean;
|
|
17
15
|
showReverse?: boolean;
|
|
18
16
|
showTranslation?: boolean;
|
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
-
const ui_1 = require("@jbrowse/core/ui");
|
|
6
5
|
const util_1 = require("@jbrowse/core/util");
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
7
7
|
const mobx_react_1 = require("mobx-react");
|
|
8
|
-
function Translation({ codonTable, seq, frame, width, bpPerPx, colorByCDS, region, seqStart, height, y, reverse = false,
|
|
8
|
+
function Translation({ codonTable, seq, frame, width, bpPerPx, colorByCDS, region, seqStart, height, y, reverse = false, }) {
|
|
9
9
|
var _a, _b;
|
|
10
10
|
const normalizedFrame = Math.abs(frame) - 1;
|
|
11
11
|
const seqFrame = seqStart % 3;
|
|
12
12
|
const frameShift = (normalizedFrame - seqFrame + 3) % 3;
|
|
13
|
+
const theme = (0, material_1.useTheme)();
|
|
13
14
|
const frameShiftAdjustedSeqLength = seq.length - frameShift;
|
|
14
15
|
const multipleOfThreeLength = frameShiftAdjustedSeqLength - (frameShiftAdjustedSeqLength % 3);
|
|
15
16
|
const seqSliced = seq.slice(frameShift, frameShift + multipleOfThreeLength);
|
|
@@ -28,25 +29,26 @@ function Translation({ codonTable, seq, frame, width, bpPerPx, colorByCDS, regio
|
|
|
28
29
|
const frameOffset = frameShift / bpPerPx;
|
|
29
30
|
const startOffset = (region.start - seqStart) / bpPerPx;
|
|
30
31
|
const offset = frameOffset - startOffset;
|
|
32
|
+
const dark = theme.palette.mode === 'dark' ? 'dark' : 'main';
|
|
31
33
|
const defaultFill = colorByCDS
|
|
32
|
-
? (_a = theme
|
|
33
|
-
: (_b = theme
|
|
34
|
+
? (_a = theme.palette.framesCDS.at(frame)) === null || _a === void 0 ? void 0 : _a[dark]
|
|
35
|
+
: (_b = theme.palette.frames.at(frame)) === null || _b === void 0 ? void 0 : _b[dark];
|
|
34
36
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("rect", { x: 0, y: y, width: width, height: height, fill: defaultFill }), translated.map((element, index) => {
|
|
35
37
|
const x = region.reversed
|
|
36
38
|
? width - (index + 1) * codonWidth - offset
|
|
37
39
|
: codonWidth * index + offset;
|
|
38
40
|
const { letter, codon } = element;
|
|
39
41
|
const codonFill = util_1.defaultStarts.includes(codon)
|
|
40
|
-
? theme
|
|
42
|
+
? theme.palette.startCodon
|
|
41
43
|
: util_1.defaultStops.includes(codon)
|
|
42
|
-
? theme
|
|
44
|
+
? theme.palette.stopCodon
|
|
43
45
|
: undefined;
|
|
44
46
|
return !(renderLetter || codonFill) ? null : ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("rect", { x: x, y: y, width: renderLetter
|
|
45
47
|
? codonWidth
|
|
46
48
|
: codonWidth + 0.7, height: height, stroke: renderLetter ? '#555' : 'none', fill: codonFill || 'none' }), renderLetter ? ((0, jsx_runtime_1.jsx)("text", { x: x + codonWidth / 2, fontSize: height - 2, y: y + height / 2, dominantBaseline: "middle", textAnchor: "middle", children: letter })) : null] }, `${index}-${letter}`));
|
|
47
49
|
})] }));
|
|
48
50
|
}
|
|
49
|
-
function Sequence({ bpPerPx, region, feature, sequenceType,
|
|
51
|
+
function Sequence({ bpPerPx, region, feature, sequenceType, height, seq, y, }) {
|
|
50
52
|
const render = 1 / bpPerPx >= 12;
|
|
51
53
|
const s = feature.get('start');
|
|
52
54
|
const e = feature.get('end');
|
|
@@ -54,18 +56,19 @@ function Sequence({ bpPerPx, region, feature, sequenceType, theme, height, seq,
|
|
|
54
56
|
const reverse = region.reversed;
|
|
55
57
|
const len = e - s;
|
|
56
58
|
const w = Math.max((rightPx - leftPx) / len, 0.8);
|
|
59
|
+
const theme = (0, material_1.useTheme)();
|
|
57
60
|
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: seq.split('').map((letter, index) => {
|
|
58
61
|
const color = sequenceType === 'dna'
|
|
59
62
|
?
|
|
60
63
|
theme.palette.bases[letter.toUpperCase()]
|
|
61
64
|
: undefined;
|
|
65
|
+
const dark = theme.palette.mode === 'dark';
|
|
62
66
|
const x = reverse ? rightPx - (index + 1) * w : leftPx + index * w;
|
|
63
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("rect", { x: x, y: y, width: w, height: height, fill: color ? color.main : '#aaa', stroke: render ? '#555' : 'none' }), render ? ((0, jsx_runtime_1.jsx)("text", { x: x + w / 2, y: y + height / 2, dominantBaseline: "middle", textAnchor: "middle", fontSize: height - 2, fill: color ? theme.palette.getContrastText(color.main) : 'black', children: letter })) : null] }, `${letter}-${index}`));
|
|
67
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("rect", { x: x, y: y, width: w, height: height, fill: color ? (dark ? color.dark : color.main) : '#aaa', stroke: render ? '#555' : 'none' }), render ? ((0, jsx_runtime_1.jsx)("text", { x: x + w / 2, y: y + height / 2, dominantBaseline: "middle", textAnchor: "middle", fontSize: height - 2, fill: color ? theme.palette.getContrastText(color.main) : 'black', children: letter })) : null] }, `${letter}-${index}`));
|
|
64
68
|
}) }));
|
|
65
69
|
}
|
|
66
|
-
function SequenceSVG({ regions, width,
|
|
70
|
+
function SequenceSVG({ regions, width, colorByCDS, features = new Map(), showReverse = true, showForward = true, showTranslation = true, sequenceType = 'dna', bpPerPx, rowHeight, }) {
|
|
67
71
|
const region = regions[0];
|
|
68
|
-
const theme = (0, ui_1.createJBrowseTheme)(configTheme);
|
|
69
72
|
const codonTable = (0, util_1.generateCodonTable)(util_1.defaultCodonTable);
|
|
70
73
|
const [feature] = [...features.values()];
|
|
71
74
|
if (!feature) {
|
|
@@ -82,7 +85,7 @@ function SequenceSVG({ regions, width, theme: configTheme, colorByCDS, features
|
|
|
82
85
|
const [topFrames, bottomFrames] = region.reversed
|
|
83
86
|
? [reverseFrames.toReversed(), forwardFrames.toReversed()]
|
|
84
87
|
: [forwardFrames, reverseFrames];
|
|
85
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [topFrames.map(index => ((0, jsx_runtime_1.jsx)(Translation, { width: width, colorByCDS: colorByCDS, seq: seq, y: (currY += rowHeight), codonTable: codonTable, frame: index, bpPerPx: bpPerPx, region: region, seqStart: feature.get('start'),
|
|
88
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [topFrames.map(index => ((0, jsx_runtime_1.jsx)(Translation, { width: width, colorByCDS: colorByCDS, seq: seq, y: (currY += rowHeight), codonTable: codonTable, frame: index, bpPerPx: bpPerPx, region: region, seqStart: feature.get('start'), height: rowHeight, reverse: region.reversed }, `translation-${index}`))), showForward && showSequence ? ((0, jsx_runtime_1.jsx)(Sequence, { height: rowHeight, sequenceType: sequenceType, y: (currY += rowHeight), feature: feature, region: region, seq: region.reversed ? (0, util_1.complement)(seq) : seq, bpPerPx: bpPerPx })) : null, showReverse && showSequence ? ((0, jsx_runtime_1.jsx)(Sequence, { height: rowHeight, sequenceType: sequenceType, y: (currY += rowHeight), feature: feature, region: region, seq: region.reversed ? seq : (0, util_1.complement)(seq), bpPerPx: bpPerPx })) : null, bottomFrames.map(index => ((0, jsx_runtime_1.jsx)(Translation, { width: width, colorByCDS: colorByCDS, seq: seq, y: (currY += rowHeight), codonTable: codonTable, frame: index, bpPerPx: bpPerPx, region: region, seqStart: feature.get('start'), height: rowHeight, reverse: !region.reversed }, `rev-translation-${index}`)))] }));
|
|
86
89
|
}
|
|
87
90
|
function Wrapper({ exportSVG, width, totalHeight, children, }) {
|
|
88
91
|
return exportSVG ? (children) : ((0, jsx_runtime_1.jsx)("svg", { "data-testid": "sequence_track", width: width, height: totalHeight, style: {
|
|
@@ -92,9 +95,9 @@ function Wrapper({ exportSVG, width, totalHeight, children, }) {
|
|
|
92
95
|
userSelect: 'none',
|
|
93
96
|
}, children: children }));
|
|
94
97
|
}
|
|
95
|
-
const DivSequenceRendering = (0, mobx_react_1.observer)(function ({ exportSVG, features, regions, colorByCDS, bpPerPx, rowHeight, sequenceHeight,
|
|
98
|
+
const DivSequenceRendering = (0, mobx_react_1.observer)(function ({ exportSVG, features, regions, colorByCDS, bpPerPx, rowHeight, sequenceHeight, showForward, showReverse, showTranslation, }) {
|
|
96
99
|
const region = regions[0];
|
|
97
100
|
const width = Math.ceil((region.end - region.start) / bpPerPx);
|
|
98
|
-
return ((0, jsx_runtime_1.jsx)(Wrapper, { exportSVG: exportSVG, totalHeight: sequenceHeight, width: width, children: (0, jsx_runtime_1.jsx)(SequenceSVG, { width: width, showReverse: showReverse, showForward: showForward,
|
|
101
|
+
return ((0, jsx_runtime_1.jsx)(Wrapper, { exportSVG: exportSVG, totalHeight: sequenceHeight, width: width, children: (0, jsx_runtime_1.jsx)(SequenceSVG, { width: width, showReverse: showReverse, showForward: showForward, showTranslation: showTranslation, colorByCDS: colorByCDS, bpPerPx: bpPerPx, rowHeight: rowHeight, features: features, regions: regions }) }));
|
|
99
102
|
});
|
|
100
103
|
exports.default = DivSequenceRendering;
|
|
@@ -79,7 +79,14 @@ class IndexedFastaAdapter extends BaseAdapter_1.BaseSequenceAdapter {
|
|
|
79
79
|
end: chunkStart + chunkSize,
|
|
80
80
|
};
|
|
81
81
|
(0, stopToken_1.checkStopToken)(stopToken);
|
|
82
|
-
|
|
82
|
+
const res = await this.seqCache.get(JSON.stringify(r), {
|
|
83
|
+
...r,
|
|
84
|
+
fasta,
|
|
85
|
+
});
|
|
86
|
+
if (!res) {
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
chunks.push(res);
|
|
83
90
|
}
|
|
84
91
|
const seq = chunks
|
|
85
92
|
.filter(f => !!f)
|
|
@@ -184,6 +184,7 @@ export declare function modelFactory(configSchema: AnyConfigurationSchemaType):
|
|
|
184
184
|
readonly renderDelay: number;
|
|
185
185
|
readonly TooltipComponent: import("@jbrowse/core/util").AnyReactComponentType;
|
|
186
186
|
readonly selectedFeatureId: string | undefined;
|
|
187
|
+
copyInfoToClipboard(feature: import("@jbrowse/core/util").Feature): void;
|
|
187
188
|
} & {
|
|
188
189
|
readonly features: import("@jbrowse/core/util/compositeMap").default<string, import("@jbrowse/core/util").Feature>;
|
|
189
190
|
readonly featureUnderMouse: import("@jbrowse/core/util").Feature | undefined;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
2
2
|
import type { Feature, Region } from '@jbrowse/core/util';
|
|
3
|
-
|
|
4
|
-
declare const DivSequenceRendering: ({ exportSVG, features, regions, colorByCDS, bpPerPx, rowHeight, sequenceHeight, theme, showForward, showReverse, showTranslation, }: {
|
|
3
|
+
declare const DivSequenceRendering: ({ exportSVG, features, regions, colorByCDS, bpPerPx, rowHeight, sequenceHeight, showForward, showReverse, showTranslation, }: {
|
|
5
4
|
exportSVG?: {
|
|
6
5
|
rasterizeLayers: boolean;
|
|
7
6
|
};
|
|
@@ -12,7 +11,6 @@ declare const DivSequenceRendering: ({ exportSVG, features, regions, colorByCDS,
|
|
|
12
11
|
rowHeight: number;
|
|
13
12
|
sequenceHeight: number;
|
|
14
13
|
config: AnyConfigurationModel;
|
|
15
|
-
theme?: Theme;
|
|
16
14
|
showForward?: boolean;
|
|
17
15
|
showReverse?: boolean;
|
|
18
16
|
showTranslation?: boolean;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { Fragment } from 'react';
|
|
3
|
-
import { createJBrowseTheme } from '@jbrowse/core/ui';
|
|
4
3
|
import { bpSpanPx, complement, defaultCodonTable, defaultStarts, defaultStops, generateCodonTable, revcom, } from '@jbrowse/core/util';
|
|
4
|
+
import { useTheme } from '@mui/material';
|
|
5
5
|
import { observer } from 'mobx-react';
|
|
6
|
-
function Translation({ codonTable, seq, frame, width, bpPerPx, colorByCDS, region, seqStart, height, y, reverse = false,
|
|
6
|
+
function Translation({ codonTable, seq, frame, width, bpPerPx, colorByCDS, region, seqStart, height, y, reverse = false, }) {
|
|
7
7
|
var _a, _b;
|
|
8
8
|
const normalizedFrame = Math.abs(frame) - 1;
|
|
9
9
|
const seqFrame = seqStart % 3;
|
|
10
10
|
const frameShift = (normalizedFrame - seqFrame + 3) % 3;
|
|
11
|
+
const theme = useTheme();
|
|
11
12
|
const frameShiftAdjustedSeqLength = seq.length - frameShift;
|
|
12
13
|
const multipleOfThreeLength = frameShiftAdjustedSeqLength - (frameShiftAdjustedSeqLength % 3);
|
|
13
14
|
const seqSliced = seq.slice(frameShift, frameShift + multipleOfThreeLength);
|
|
@@ -26,25 +27,26 @@ function Translation({ codonTable, seq, frame, width, bpPerPx, colorByCDS, regio
|
|
|
26
27
|
const frameOffset = frameShift / bpPerPx;
|
|
27
28
|
const startOffset = (region.start - seqStart) / bpPerPx;
|
|
28
29
|
const offset = frameOffset - startOffset;
|
|
30
|
+
const dark = theme.palette.mode === 'dark' ? 'dark' : 'main';
|
|
29
31
|
const defaultFill = colorByCDS
|
|
30
|
-
? (_a = theme
|
|
31
|
-
: (_b = theme
|
|
32
|
+
? (_a = theme.palette.framesCDS.at(frame)) === null || _a === void 0 ? void 0 : _a[dark]
|
|
33
|
+
: (_b = theme.palette.frames.at(frame)) === null || _b === void 0 ? void 0 : _b[dark];
|
|
32
34
|
return (_jsxs(_Fragment, { children: [_jsx("rect", { x: 0, y: y, width: width, height: height, fill: defaultFill }), translated.map((element, index) => {
|
|
33
35
|
const x = region.reversed
|
|
34
36
|
? width - (index + 1) * codonWidth - offset
|
|
35
37
|
: codonWidth * index + offset;
|
|
36
38
|
const { letter, codon } = element;
|
|
37
39
|
const codonFill = defaultStarts.includes(codon)
|
|
38
|
-
? theme
|
|
40
|
+
? theme.palette.startCodon
|
|
39
41
|
: defaultStops.includes(codon)
|
|
40
|
-
? theme
|
|
42
|
+
? theme.palette.stopCodon
|
|
41
43
|
: undefined;
|
|
42
44
|
return !(renderLetter || codonFill) ? null : (_jsxs(Fragment, { children: [_jsx("rect", { x: x, y: y, width: renderLetter
|
|
43
45
|
? codonWidth
|
|
44
46
|
: codonWidth + 0.7, height: height, stroke: renderLetter ? '#555' : 'none', fill: codonFill || 'none' }), renderLetter ? (_jsx("text", { x: x + codonWidth / 2, fontSize: height - 2, y: y + height / 2, dominantBaseline: "middle", textAnchor: "middle", children: letter })) : null] }, `${index}-${letter}`));
|
|
45
47
|
})] }));
|
|
46
48
|
}
|
|
47
|
-
function Sequence({ bpPerPx, region, feature, sequenceType,
|
|
49
|
+
function Sequence({ bpPerPx, region, feature, sequenceType, height, seq, y, }) {
|
|
48
50
|
const render = 1 / bpPerPx >= 12;
|
|
49
51
|
const s = feature.get('start');
|
|
50
52
|
const e = feature.get('end');
|
|
@@ -52,18 +54,19 @@ function Sequence({ bpPerPx, region, feature, sequenceType, theme, height, seq,
|
|
|
52
54
|
const reverse = region.reversed;
|
|
53
55
|
const len = e - s;
|
|
54
56
|
const w = Math.max((rightPx - leftPx) / len, 0.8);
|
|
57
|
+
const theme = useTheme();
|
|
55
58
|
return (_jsx(_Fragment, { children: seq.split('').map((letter, index) => {
|
|
56
59
|
const color = sequenceType === 'dna'
|
|
57
60
|
?
|
|
58
61
|
theme.palette.bases[letter.toUpperCase()]
|
|
59
62
|
: undefined;
|
|
63
|
+
const dark = theme.palette.mode === 'dark';
|
|
60
64
|
const x = reverse ? rightPx - (index + 1) * w : leftPx + index * w;
|
|
61
|
-
return (_jsxs(Fragment, { children: [_jsx("rect", { x: x, y: y, width: w, height: height, fill: color ? color.main : '#aaa', stroke: render ? '#555' : 'none' }), render ? (_jsx("text", { x: x + w / 2, y: y + height / 2, dominantBaseline: "middle", textAnchor: "middle", fontSize: height - 2, fill: color ? theme.palette.getContrastText(color.main) : 'black', children: letter })) : null] }, `${letter}-${index}`));
|
|
65
|
+
return (_jsxs(Fragment, { children: [_jsx("rect", { x: x, y: y, width: w, height: height, fill: color ? (dark ? color.dark : color.main) : '#aaa', stroke: render ? '#555' : 'none' }), render ? (_jsx("text", { x: x + w / 2, y: y + height / 2, dominantBaseline: "middle", textAnchor: "middle", fontSize: height - 2, fill: color ? theme.palette.getContrastText(color.main) : 'black', children: letter })) : null] }, `${letter}-${index}`));
|
|
62
66
|
}) }));
|
|
63
67
|
}
|
|
64
|
-
function SequenceSVG({ regions, width,
|
|
68
|
+
function SequenceSVG({ regions, width, colorByCDS, features = new Map(), showReverse = true, showForward = true, showTranslation = true, sequenceType = 'dna', bpPerPx, rowHeight, }) {
|
|
65
69
|
const region = regions[0];
|
|
66
|
-
const theme = createJBrowseTheme(configTheme);
|
|
67
70
|
const codonTable = generateCodonTable(defaultCodonTable);
|
|
68
71
|
const [feature] = [...features.values()];
|
|
69
72
|
if (!feature) {
|
|
@@ -80,7 +83,7 @@ function SequenceSVG({ regions, width, theme: configTheme, colorByCDS, features
|
|
|
80
83
|
const [topFrames, bottomFrames] = region.reversed
|
|
81
84
|
? [reverseFrames.toReversed(), forwardFrames.toReversed()]
|
|
82
85
|
: [forwardFrames, reverseFrames];
|
|
83
|
-
return (_jsxs(_Fragment, { children: [topFrames.map(index => (_jsx(Translation, { width: width, colorByCDS: colorByCDS, seq: seq, y: (currY += rowHeight), codonTable: codonTable, frame: index, bpPerPx: bpPerPx, region: region, seqStart: feature.get('start'),
|
|
86
|
+
return (_jsxs(_Fragment, { children: [topFrames.map(index => (_jsx(Translation, { width: width, colorByCDS: colorByCDS, seq: seq, y: (currY += rowHeight), codonTable: codonTable, frame: index, bpPerPx: bpPerPx, region: region, seqStart: feature.get('start'), height: rowHeight, reverse: region.reversed }, `translation-${index}`))), showForward && showSequence ? (_jsx(Sequence, { height: rowHeight, sequenceType: sequenceType, y: (currY += rowHeight), feature: feature, region: region, seq: region.reversed ? complement(seq) : seq, bpPerPx: bpPerPx })) : null, showReverse && showSequence ? (_jsx(Sequence, { height: rowHeight, sequenceType: sequenceType, y: (currY += rowHeight), feature: feature, region: region, seq: region.reversed ? seq : complement(seq), bpPerPx: bpPerPx })) : null, bottomFrames.map(index => (_jsx(Translation, { width: width, colorByCDS: colorByCDS, seq: seq, y: (currY += rowHeight), codonTable: codonTable, frame: index, bpPerPx: bpPerPx, region: region, seqStart: feature.get('start'), height: rowHeight, reverse: !region.reversed }, `rev-translation-${index}`)))] }));
|
|
84
87
|
}
|
|
85
88
|
function Wrapper({ exportSVG, width, totalHeight, children, }) {
|
|
86
89
|
return exportSVG ? (children) : (_jsx("svg", { "data-testid": "sequence_track", width: width, height: totalHeight, style: {
|
|
@@ -90,9 +93,9 @@ function Wrapper({ exportSVG, width, totalHeight, children, }) {
|
|
|
90
93
|
userSelect: 'none',
|
|
91
94
|
}, children: children }));
|
|
92
95
|
}
|
|
93
|
-
const DivSequenceRendering = observer(function ({ exportSVG, features, regions, colorByCDS, bpPerPx, rowHeight, sequenceHeight,
|
|
96
|
+
const DivSequenceRendering = observer(function ({ exportSVG, features, regions, colorByCDS, bpPerPx, rowHeight, sequenceHeight, showForward, showReverse, showTranslation, }) {
|
|
94
97
|
const region = regions[0];
|
|
95
98
|
const width = Math.ceil((region.end - region.start) / bpPerPx);
|
|
96
|
-
return (_jsx(Wrapper, { exportSVG: exportSVG, totalHeight: sequenceHeight, width: width, children: _jsx(SequenceSVG, { width: width, showReverse: showReverse, showForward: showForward,
|
|
99
|
+
return (_jsx(Wrapper, { exportSVG: exportSVG, totalHeight: sequenceHeight, width: width, children: _jsx(SequenceSVG, { width: width, showReverse: showReverse, showForward: showForward, showTranslation: showTranslation, colorByCDS: colorByCDS, bpPerPx: bpPerPx, rowHeight: rowHeight, features: features, regions: regions }) }));
|
|
97
100
|
});
|
|
98
101
|
export default DivSequenceRendering;
|
|
@@ -74,7 +74,14 @@ export default class IndexedFastaAdapter extends BaseSequenceAdapter {
|
|
|
74
74
|
end: chunkStart + chunkSize,
|
|
75
75
|
};
|
|
76
76
|
checkStopToken(stopToken);
|
|
77
|
-
|
|
77
|
+
const res = await this.seqCache.get(JSON.stringify(r), {
|
|
78
|
+
...r,
|
|
79
|
+
fasta,
|
|
80
|
+
});
|
|
81
|
+
if (!res) {
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
chunks.push(res);
|
|
78
85
|
}
|
|
79
86
|
const seq = chunks
|
|
80
87
|
.filter(f => !!f)
|
|
@@ -184,6 +184,7 @@ export declare function modelFactory(configSchema: AnyConfigurationSchemaType):
|
|
|
184
184
|
readonly renderDelay: number;
|
|
185
185
|
readonly TooltipComponent: import("@jbrowse/core/util").AnyReactComponentType;
|
|
186
186
|
readonly selectedFeatureId: string | undefined;
|
|
187
|
+
copyInfoToClipboard(feature: import("@jbrowse/core/util").Feature): void;
|
|
187
188
|
} & {
|
|
188
189
|
readonly features: import("@jbrowse/core/util/compositeMap").default<string, import("@jbrowse/core/util").Feature>;
|
|
189
190
|
readonly featureUnderMouse: import("@jbrowse/core/util").Feature | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-sequence",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0",
|
|
4
4
|
"description": "JBrowse 2 sequence adapters, tracks, etc.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"@gmod/abortable-promise-cache": "^3.0.1",
|
|
40
40
|
"@gmod/indexedfasta": "^4.0.0",
|
|
41
41
|
"@gmod/twobit": "^6.0.0",
|
|
42
|
-
"@jbrowse/core": "^3.
|
|
43
|
-
"@jbrowse/plugin-linear-genome-view": "^3.
|
|
44
|
-
"@jbrowse/plugin-wiggle": "^3.
|
|
42
|
+
"@jbrowse/core": "^3.6.0",
|
|
43
|
+
"@jbrowse/plugin-linear-genome-view": "^3.6.0",
|
|
44
|
+
"@jbrowse/plugin-wiggle": "^3.6.0",
|
|
45
45
|
"@mui/material": "^7.0.0",
|
|
46
46
|
"mobx": "^6.0.0",
|
|
47
47
|
"mobx-react": "^9.0.0",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"distModule": "esm/index.js",
|
|
58
58
|
"srcModule": "src/index.ts",
|
|
59
59
|
"module": "esm/index.js",
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "133a68815ab348d156c18d83cffc997356c3cfbb"
|
|
61
61
|
}
|