@jbrowse/plugin-arc 2.7.1 → 2.8.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/LinearPairedArcDisplay/afterAttach.d.ts +2 -0
- package/dist/LinearPairedArcDisplay/afterAttach.js +11 -0
- package/dist/LinearPairedArcDisplay/components/Arcs.d.ts +7 -0
- package/dist/LinearPairedArcDisplay/components/Arcs.js +138 -0
- package/dist/LinearPairedArcDisplay/components/BaseDisplayComponent.d.ts +7 -0
- package/dist/LinearPairedArcDisplay/components/BaseDisplayComponent.js +40 -0
- package/dist/LinearPairedArcDisplay/components/ReactComponent.d.ts +7 -0
- package/dist/LinearPairedArcDisplay/components/ReactComponent.js +14 -0
- package/dist/LinearPairedArcDisplay/configSchema.d.ts +36 -0
- package/dist/LinearPairedArcDisplay/configSchema.js +28 -0
- package/dist/LinearPairedArcDisplay/fetchChains.d.ts +27 -0
- package/dist/LinearPairedArcDisplay/fetchChains.js +22 -0
- package/dist/LinearPairedArcDisplay/index.d.ts +2 -0
- package/dist/LinearPairedArcDisplay/index.js +44 -0
- package/dist/LinearPairedArcDisplay/model.d.ts +161 -0
- package/dist/LinearPairedArcDisplay/model.js +129 -0
- package/dist/LinearPairedArcDisplay/renderSvg.d.ts +5 -0
- package/dist/LinearPairedArcDisplay/renderSvg.js +23 -0
- package/dist/LinearPairedArcDisplay/util.d.ts +27 -0
- package/dist/LinearPairedArcDisplay/util.js +131 -0
- package/dist/index.js +23 -2
- package/esm/LinearPairedArcDisplay/afterAttach.d.ts +2 -0
- package/esm/LinearPairedArcDisplay/afterAttach.js +7 -0
- package/esm/LinearPairedArcDisplay/components/Arcs.d.ts +7 -0
- package/esm/LinearPairedArcDisplay/components/Arcs.js +113 -0
- package/esm/LinearPairedArcDisplay/components/BaseDisplayComponent.d.ts +7 -0
- package/esm/LinearPairedArcDisplay/components/BaseDisplayComponent.js +35 -0
- package/esm/LinearPairedArcDisplay/components/ReactComponent.d.ts +7 -0
- package/esm/LinearPairedArcDisplay/components/ReactComponent.js +9 -0
- package/esm/LinearPairedArcDisplay/configSchema.d.ts +36 -0
- package/esm/LinearPairedArcDisplay/configSchema.js +24 -0
- package/esm/LinearPairedArcDisplay/fetchChains.d.ts +27 -0
- package/esm/LinearPairedArcDisplay/fetchChains.js +18 -0
- package/esm/LinearPairedArcDisplay/index.d.ts +2 -0
- package/esm/LinearPairedArcDisplay/index.js +18 -0
- package/esm/LinearPairedArcDisplay/model.d.ts +161 -0
- package/esm/LinearPairedArcDisplay/model.js +102 -0
- package/esm/LinearPairedArcDisplay/renderSvg.d.ts +5 -0
- package/esm/LinearPairedArcDisplay/renderSvg.js +16 -0
- package/esm/LinearPairedArcDisplay/util.d.ts +27 -0
- package/esm/LinearPairedArcDisplay/util.js +121 -0
- package/esm/index.js +23 -2
- package/package.json +2 -2
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.doAfterAttach = void 0;
|
|
4
|
+
const util_1 = require("./util");
|
|
5
|
+
const fetchChains_1 = require("./fetchChains");
|
|
6
|
+
function doAfterAttach(self) {
|
|
7
|
+
(0, util_1.createAutorun)(self, async () => {
|
|
8
|
+
await (0, fetchChains_1.fetchChains)(self);
|
|
9
|
+
}, { delay: 1000 });
|
|
10
|
+
}
|
|
11
|
+
exports.doAfterAttach = doAfterAttach;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const react_1 = __importStar(require("react"));
|
|
27
|
+
const mobx_react_1 = require("mobx-react");
|
|
28
|
+
const util_1 = require("@jbrowse/core/util");
|
|
29
|
+
const configuration_1 = require("@jbrowse/core/configuration");
|
|
30
|
+
const vcf_1 = require("@gmod/vcf");
|
|
31
|
+
const react_svg_tooltip_1 = require("react-svg-tooltip");
|
|
32
|
+
function f(feature, alt) {
|
|
33
|
+
var _a, _b, _c, _d, _e;
|
|
34
|
+
const bnd = alt ? (0, vcf_1.parseBreakend)(alt) : undefined;
|
|
35
|
+
let start = feature.get('start');
|
|
36
|
+
let end = feature.get('end');
|
|
37
|
+
const strand = feature.get('strand');
|
|
38
|
+
const mate = feature.get('mate');
|
|
39
|
+
const refName = feature.get('refName');
|
|
40
|
+
let mateRefName;
|
|
41
|
+
let mateEnd = 0;
|
|
42
|
+
let mateStart = 0;
|
|
43
|
+
// one sided bracket used, because there could be <INS:ME> and we just check
|
|
44
|
+
// startswith below
|
|
45
|
+
const symbolicAlleles = ['<TRA', '<DEL', '<INV', '<INS', '<DUP', '<CNV'];
|
|
46
|
+
if (symbolicAlleles.some(a => alt === null || alt === void 0 ? void 0 : alt.startsWith(a))) {
|
|
47
|
+
// END is defined to be a single value, not an array. CHR2 not defined in
|
|
48
|
+
// VCF spec, but should be similar
|
|
49
|
+
const e = ((_b = (_a = feature.get('INFO')) === null || _a === void 0 ? void 0 : _a.END) === null || _b === void 0 ? void 0 : _b[0]) || feature.get('end');
|
|
50
|
+
mateEnd = e;
|
|
51
|
+
mateStart = e - 1;
|
|
52
|
+
mateRefName = (_e = (_d = (_c = feature.get('INFO')) === null || _c === void 0 ? void 0 : _c.CHR2) === null || _d === void 0 ? void 0 : _d[0]) !== null && _e !== void 0 ? _e : refName;
|
|
53
|
+
// re-adjust the arc to be from start to end of feature by re-assigning end
|
|
54
|
+
// to the 'mate'
|
|
55
|
+
start = feature.get('start');
|
|
56
|
+
end = feature.get('start') + 1;
|
|
57
|
+
}
|
|
58
|
+
else if (bnd === null || bnd === void 0 ? void 0 : bnd.MatePosition) {
|
|
59
|
+
const matePosition = bnd.MatePosition.split(':');
|
|
60
|
+
mateEnd = +matePosition[1];
|
|
61
|
+
mateStart = +matePosition[1] - 1;
|
|
62
|
+
mateRefName = matePosition[0];
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
k1: { refName, start, end, strand },
|
|
66
|
+
k2: mate !== null && mate !== void 0 ? mate : { refName: mateRefName, end: mateEnd, start: mateStart },
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function makeSummary(feature, alt) {
|
|
70
|
+
var _a;
|
|
71
|
+
const { k1, k2 } = f(feature, alt);
|
|
72
|
+
return [
|
|
73
|
+
feature.get('name'),
|
|
74
|
+
feature.get('id'),
|
|
75
|
+
(0, util_1.assembleLocString)(k1),
|
|
76
|
+
(0, util_1.assembleLocString)(k2),
|
|
77
|
+
(_a = feature.get('INFO')) === null || _a === void 0 ? void 0 : _a.SVTYPE,
|
|
78
|
+
alt,
|
|
79
|
+
]
|
|
80
|
+
.filter(f => !!f)
|
|
81
|
+
.join(' - ');
|
|
82
|
+
}
|
|
83
|
+
// conditionally rendered tooltip only on mouseover, speeds up
|
|
84
|
+
const SvgTooltip = react_1.default.forwardRef(function SvgTooltip2({ feature, alt }, ref) {
|
|
85
|
+
const caption = makeSummary(feature, alt);
|
|
86
|
+
const tooltipWidth = 20 + (0, util_1.measureText)(caption);
|
|
87
|
+
return ref !== null ? (
|
|
88
|
+
// @ts-expect-error
|
|
89
|
+
react_1.default.createElement(react_svg_tooltip_1.Tooltip, { triggerRef: ref },
|
|
90
|
+
react_1.default.createElement("rect", { x: 12, y: 0, width: tooltipWidth, height: 20, rx: 5, ry: 5, fill: "black", fillOpacity: "50%" }),
|
|
91
|
+
react_1.default.createElement("text", { x: 22, y: 14, fontSize: 10, fill: "white", textLength: tooltipWidth - 20 }, caption))) : null;
|
|
92
|
+
});
|
|
93
|
+
const Arc = (0, mobx_react_1.observer)(function ({ model, feature, alt, assembly, view, }) {
|
|
94
|
+
var _a, _b;
|
|
95
|
+
const [mouseOvered, setMouseOvered] = (0, react_1.useState)(false);
|
|
96
|
+
const { height } = model;
|
|
97
|
+
const { k1, k2 } = f(feature, alt);
|
|
98
|
+
const ref = (0, react_1.useRef)(null);
|
|
99
|
+
const c = (0, configuration_1.getConf)(model, 'color', { feature, alt });
|
|
100
|
+
const ra1 = assembly.getCanonicalRefName(k1.refName) || k1.refName;
|
|
101
|
+
const ra2 = assembly.getCanonicalRefName(k2.refName) || k2.refName;
|
|
102
|
+
const p1 = k1.start;
|
|
103
|
+
const p2 = k2.start;
|
|
104
|
+
const r1 = (_a = view.bpToPx({ refName: ra1, coord: p1 })) === null || _a === void 0 ? void 0 : _a.offsetPx;
|
|
105
|
+
const r2 = (_b = view.bpToPx({ refName: ra2, coord: p2 })) === null || _b === void 0 ? void 0 : _b.offsetPx;
|
|
106
|
+
if (r1 !== undefined && r2 !== undefined) {
|
|
107
|
+
const radius = (r2 - r1) / 2;
|
|
108
|
+
const absrad = Math.abs(radius);
|
|
109
|
+
const destY = Math.min(height, absrad);
|
|
110
|
+
const p1 = r1 - view.offsetPx;
|
|
111
|
+
const p2 = r2 - view.offsetPx;
|
|
112
|
+
const left = p1;
|
|
113
|
+
const right = p2;
|
|
114
|
+
return absrad > 1 ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
115
|
+
react_1.default.createElement("path", { d: `M ${left} 0 C ${left} ${destY}, ${right} ${destY}, ${right} 0`, ref: ref, stroke: mouseOvered ? 'black' : c, strokeWidth: 3, onMouseOut: () => setMouseOvered(false), onMouseOver: () => setMouseOvered(true), onClick: () => model.selectFeature(feature), fill: "none", pointerEvents: "stroke" }),
|
|
116
|
+
mouseOvered ? (react_1.default.createElement(SvgTooltip, { feature: feature, alt: alt, ref: ref })) : null)) : null;
|
|
117
|
+
}
|
|
118
|
+
return null;
|
|
119
|
+
});
|
|
120
|
+
const Wrapper = (0, mobx_react_1.observer)(function ({ model, exportSVG, children, }) {
|
|
121
|
+
const { height } = model;
|
|
122
|
+
const view = (0, util_1.getContainingView)(model);
|
|
123
|
+
const width = Math.round(view.dynamicBlocks.totalWidthPx);
|
|
124
|
+
return exportSVG ? (react_1.default.createElement(react_1.default.Fragment, null, children)) : (react_1.default.createElement("svg", { width: width, height: height }, children));
|
|
125
|
+
});
|
|
126
|
+
const Arcs = (0, mobx_react_1.observer)(function ({ model, exportSVG, }) {
|
|
127
|
+
const view = (0, util_1.getContainingView)(model);
|
|
128
|
+
const session = (0, util_1.getSession)(model);
|
|
129
|
+
const { assemblyManager } = session;
|
|
130
|
+
const { features } = model;
|
|
131
|
+
const assembly = assemblyManager.get(view.assemblyNames[0]);
|
|
132
|
+
return assembly ? (react_1.default.createElement(Wrapper, { model: model, exportSVG: exportSVG }, features === null || features === void 0 ? void 0 : features.map(f => {
|
|
133
|
+
var _a;
|
|
134
|
+
const alts = f.get('ALT');
|
|
135
|
+
return ((_a = alts === null || alts === void 0 ? void 0 : alts.map(a => (react_1.default.createElement(Arc, { key: f.id() + '-' + a, session: session, feature: f, alt: a, view: view, model: model, assembly: assembly })))) !== null && _a !== void 0 ? _a : (react_1.default.createElement(Arc, { key: f.id(), session: session, feature: f, view: view, model: model, assembly: assembly })));
|
|
136
|
+
}))) : null;
|
|
137
|
+
});
|
|
138
|
+
exports.default = Arcs;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LinearArcDisplayModel } from '../model';
|
|
3
|
+
declare const BaseDisplayComponent: ({ model, children, }: {
|
|
4
|
+
model: LinearArcDisplayModel;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
}) => React.JSX.Element | null;
|
|
7
|
+
export default BaseDisplayComponent;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const ui_1 = require("@jbrowse/core/ui");
|
|
8
|
+
const plugin_linear_genome_view_1 = require("@jbrowse/plugin-linear-genome-view");
|
|
9
|
+
const mui_1 = require("tss-react/mui");
|
|
10
|
+
const mobx_react_1 = require("mobx-react");
|
|
11
|
+
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
12
|
+
loading: {
|
|
13
|
+
backgroundColor: theme.palette.background.default,
|
|
14
|
+
backgroundImage: `repeating-linear-gradient(45deg, transparent, transparent 5px, ${theme.palette.action.disabledBackground} 5px, ${theme.palette.action.disabledBackground} 10px)`,
|
|
15
|
+
position: 'absolute',
|
|
16
|
+
bottom: 0,
|
|
17
|
+
height: 50,
|
|
18
|
+
width: 300,
|
|
19
|
+
right: 0,
|
|
20
|
+
pointerEvents: 'none',
|
|
21
|
+
textAlign: 'center',
|
|
22
|
+
},
|
|
23
|
+
}));
|
|
24
|
+
const BaseDisplayComponent = (0, mobx_react_1.observer)(function ({ model, children, }) {
|
|
25
|
+
const { error, regionTooLarge } = model;
|
|
26
|
+
return error ? (react_1.default.createElement(plugin_linear_genome_view_1.BlockMsg, { message: `${error}`, severity: "error", buttonText: "Reload", action: model.reload })) : regionTooLarge ? (model.regionCannotBeRendered()) : (react_1.default.createElement(DataDisplay, { model: model }, children));
|
|
27
|
+
});
|
|
28
|
+
const DataDisplay = (0, mobx_react_1.observer)(function ({ model, children, }) {
|
|
29
|
+
const { loading } = model;
|
|
30
|
+
return (react_1.default.createElement("div", null,
|
|
31
|
+
children,
|
|
32
|
+
loading ? react_1.default.createElement(LoadingBar, { model: model }) : null));
|
|
33
|
+
});
|
|
34
|
+
const LoadingBar = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
35
|
+
const { classes } = useStyles();
|
|
36
|
+
const { message } = model;
|
|
37
|
+
return (react_1.default.createElement("div", { className: classes.loading },
|
|
38
|
+
react_1.default.createElement(ui_1.LoadingEllipses, { message: message })));
|
|
39
|
+
});
|
|
40
|
+
exports.default = BaseDisplayComponent;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LinearArcDisplayModel } from '../model';
|
|
3
|
+
declare const LinearArcReactComponent: ({ model, exportSVG, }: {
|
|
4
|
+
model: LinearArcDisplayModel;
|
|
5
|
+
exportSVG?: boolean | undefined;
|
|
6
|
+
}) => React.JSX.Element;
|
|
7
|
+
export default LinearArcReactComponent;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const mobx_react_1 = require("mobx-react");
|
|
8
|
+
const BaseDisplayComponent_1 = __importDefault(require("./BaseDisplayComponent"));
|
|
9
|
+
const Arcs_1 = __importDefault(require("./Arcs"));
|
|
10
|
+
const LinearArcReactComponent = (0, mobx_react_1.observer)(function ({ model, exportSVG, }) {
|
|
11
|
+
return (react_1.default.createElement(BaseDisplayComponent_1.default, { model: model },
|
|
12
|
+
react_1.default.createElement(Arcs_1.default, { model: model, exportSVG: exportSVG })));
|
|
13
|
+
});
|
|
14
|
+
exports.default = LinearArcReactComponent;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #config LinearPairedArcDisplay
|
|
3
|
+
*/
|
|
4
|
+
export declare function configSchemaFactory(): import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
5
|
+
/**
|
|
6
|
+
* #slot
|
|
7
|
+
*/
|
|
8
|
+
color: {
|
|
9
|
+
type: string;
|
|
10
|
+
description: string;
|
|
11
|
+
defaultValue: string;
|
|
12
|
+
contextVariable: string[];
|
|
13
|
+
};
|
|
14
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
15
|
+
maxFeatureScreenDensity: {
|
|
16
|
+
type: string;
|
|
17
|
+
description: string;
|
|
18
|
+
defaultValue: number;
|
|
19
|
+
};
|
|
20
|
+
fetchSizeLimit: {
|
|
21
|
+
type: string;
|
|
22
|
+
defaultValue: number;
|
|
23
|
+
description: string;
|
|
24
|
+
};
|
|
25
|
+
height: {
|
|
26
|
+
type: string;
|
|
27
|
+
defaultValue: number;
|
|
28
|
+
description: string;
|
|
29
|
+
};
|
|
30
|
+
mouseover: {
|
|
31
|
+
type: string;
|
|
32
|
+
description: string;
|
|
33
|
+
defaultValue: string;
|
|
34
|
+
contextVariable: string[];
|
|
35
|
+
};
|
|
36
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>, undefined>>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.configSchemaFactory = void 0;
|
|
4
|
+
const configuration_1 = require("@jbrowse/core/configuration");
|
|
5
|
+
const plugin_linear_genome_view_1 = require("@jbrowse/plugin-linear-genome-view");
|
|
6
|
+
/**
|
|
7
|
+
* #config LinearPairedArcDisplay
|
|
8
|
+
*/
|
|
9
|
+
function configSchemaFactory() {
|
|
10
|
+
return (0, configuration_1.ConfigurationSchema)('LinearPairedArcDisplay', {
|
|
11
|
+
/**
|
|
12
|
+
* #slot
|
|
13
|
+
*/
|
|
14
|
+
color: {
|
|
15
|
+
type: 'color',
|
|
16
|
+
description: 'the color of the arcs',
|
|
17
|
+
defaultValue: 'jexl:defaultPairedArcColor(feature,alt)',
|
|
18
|
+
contextVariable: ['feature', 'alt'],
|
|
19
|
+
},
|
|
20
|
+
}, {
|
|
21
|
+
/**
|
|
22
|
+
* #baseConfiguration
|
|
23
|
+
*/
|
|
24
|
+
baseConfiguration: plugin_linear_genome_view_1.baseLinearDisplayConfigSchema,
|
|
25
|
+
explicitlyTyped: true,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
exports.configSchemaFactory = configSchemaFactory;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { LinearArcDisplayModel } from './model';
|
|
2
|
+
export interface ReducedFeature {
|
|
3
|
+
name: string;
|
|
4
|
+
strand: number;
|
|
5
|
+
refName: string;
|
|
6
|
+
start: number;
|
|
7
|
+
end: number;
|
|
8
|
+
id: string;
|
|
9
|
+
flags: number;
|
|
10
|
+
tlen: number;
|
|
11
|
+
pair_orientation: string;
|
|
12
|
+
next_ref?: string;
|
|
13
|
+
next_pos?: number;
|
|
14
|
+
clipPos: number;
|
|
15
|
+
SA?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface ChainStats {
|
|
18
|
+
max: number;
|
|
19
|
+
min: number;
|
|
20
|
+
upper: number;
|
|
21
|
+
lower: number;
|
|
22
|
+
}
|
|
23
|
+
export interface ChainData {
|
|
24
|
+
chains: ReducedFeature[][];
|
|
25
|
+
stats?: ChainStats;
|
|
26
|
+
}
|
|
27
|
+
export declare function fetchChains(self: LinearArcDisplayModel): Promise<void>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchChains = void 0;
|
|
4
|
+
const util_1 = require("@jbrowse/core/util");
|
|
5
|
+
async function fetchChains(self) {
|
|
6
|
+
// @ts-expect-error
|
|
7
|
+
const { rpcSessionId: sessionId } = (0, util_1.getContainingTrack)(self);
|
|
8
|
+
const { rpcManager } = (0, util_1.getSession)(self);
|
|
9
|
+
const view = (0, util_1.getContainingView)(self);
|
|
10
|
+
if (!view.initialized || self.error || self.regionTooLarge) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
self.setLoading(true);
|
|
14
|
+
const ret = (await rpcManager.call(sessionId, 'CoreGetFeatures', {
|
|
15
|
+
sessionId,
|
|
16
|
+
regions: view.staticBlocks.contentBlocks,
|
|
17
|
+
adapterConfig: self.adapterConfig,
|
|
18
|
+
}));
|
|
19
|
+
self.setFeatures(ret);
|
|
20
|
+
self.setLoading(false);
|
|
21
|
+
}
|
|
22
|
+
exports.fetchChains = fetchChains;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const pluggableElementTypes_1 = require("@jbrowse/core/pluggableElementTypes");
|
|
27
|
+
const configSchema_1 = require("./configSchema");
|
|
28
|
+
const model_1 = require("./model");
|
|
29
|
+
const react_1 = require("react");
|
|
30
|
+
function LinearPairedArcDisplayF(pluginManager) {
|
|
31
|
+
pluginManager.addDisplayType(() => {
|
|
32
|
+
const configSchema = (0, configSchema_1.configSchemaFactory)();
|
|
33
|
+
return new pluggableElementTypes_1.DisplayType({
|
|
34
|
+
name: 'LinearPairedArcDisplay',
|
|
35
|
+
displayName: 'Arc display',
|
|
36
|
+
configSchema,
|
|
37
|
+
stateModel: (0, model_1.stateModelFactory)(configSchema),
|
|
38
|
+
trackType: 'VariantTrack',
|
|
39
|
+
viewType: 'LinearGenomeView',
|
|
40
|
+
ReactComponent: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/ReactComponent')))),
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
exports.default = LinearPairedArcDisplayF;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AnyConfigurationSchemaType } from '@jbrowse/core/configuration';
|
|
3
|
+
import { Instance } from 'mobx-state-tree';
|
|
4
|
+
import { Feature } from '@jbrowse/core/util';
|
|
5
|
+
/**
|
|
6
|
+
* #stateModel LinearPairedArcDisplay
|
|
7
|
+
* extends BaseDisplay, TrackHeightMixin, FeatureDensityMixin
|
|
8
|
+
*/
|
|
9
|
+
export declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): import("mobx-state-tree").IModelType<{
|
|
10
|
+
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
11
|
+
type: import("mobx-state-tree").ISimpleType<string>;
|
|
12
|
+
rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
13
|
+
} & {
|
|
14
|
+
heightPreConfig: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
15
|
+
} & {
|
|
16
|
+
userBpPerPxLimit: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
17
|
+
userByteSizeLimit: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
18
|
+
} & {
|
|
19
|
+
/**
|
|
20
|
+
* #property
|
|
21
|
+
*/
|
|
22
|
+
type: import("mobx-state-tree").ISimpleType<"LinearPairedArcDisplay">;
|
|
23
|
+
/**
|
|
24
|
+
* #property
|
|
25
|
+
*/
|
|
26
|
+
configuration: AnyConfigurationSchemaType;
|
|
27
|
+
/**
|
|
28
|
+
* #property
|
|
29
|
+
*/
|
|
30
|
+
displayMode: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
31
|
+
}, {
|
|
32
|
+
rendererTypeName: string;
|
|
33
|
+
error: unknown;
|
|
34
|
+
message: string | undefined;
|
|
35
|
+
} & {
|
|
36
|
+
readonly RenderingComponent: React.FC<{
|
|
37
|
+
model: {
|
|
38
|
+
id: string;
|
|
39
|
+
type: string;
|
|
40
|
+
rpcDriverName: string | undefined;
|
|
41
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
42
|
+
rendererTypeName: string;
|
|
43
|
+
error: unknown;
|
|
44
|
+
message: string | undefined;
|
|
45
|
+
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
46
|
+
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
47
|
+
type: import("mobx-state-tree").ISimpleType<string>;
|
|
48
|
+
rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
49
|
+
}, {
|
|
50
|
+
rendererTypeName: string;
|
|
51
|
+
error: unknown;
|
|
52
|
+
message: string | undefined;
|
|
53
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
54
|
+
onHorizontalScroll?: Function | undefined;
|
|
55
|
+
blockState?: Record<string, any> | undefined;
|
|
56
|
+
}>;
|
|
57
|
+
readonly DisplayBlurb: React.FC<{
|
|
58
|
+
model: {
|
|
59
|
+
id: string;
|
|
60
|
+
type: string;
|
|
61
|
+
rpcDriverName: string | undefined;
|
|
62
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
63
|
+
rendererTypeName: string;
|
|
64
|
+
error: unknown;
|
|
65
|
+
message: string | undefined;
|
|
66
|
+
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
67
|
+
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
68
|
+
type: import("mobx-state-tree").ISimpleType<string>;
|
|
69
|
+
rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
70
|
+
}, {
|
|
71
|
+
rendererTypeName: string;
|
|
72
|
+
error: unknown;
|
|
73
|
+
message: string | undefined;
|
|
74
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
75
|
+
}> | null;
|
|
76
|
+
readonly adapterConfig: any;
|
|
77
|
+
readonly parentTrack: any;
|
|
78
|
+
renderProps(): any;
|
|
79
|
+
readonly rendererType: import("@jbrowse/core/pluggableElementTypes").RendererType;
|
|
80
|
+
readonly DisplayMessageComponent: React.FC<any> | undefined;
|
|
81
|
+
trackMenuItems(): import("@jbrowse/core/ui").MenuItem[];
|
|
82
|
+
readonly viewMenuActions: import("@jbrowse/core/ui").MenuItem[];
|
|
83
|
+
regionCannotBeRendered(): null;
|
|
84
|
+
} & {
|
|
85
|
+
setMessage(arg?: string | undefined): void;
|
|
86
|
+
setError(error?: unknown): void;
|
|
87
|
+
setRpcDriverName(rpcDriverName: string): void;
|
|
88
|
+
reload(): void;
|
|
89
|
+
} & {
|
|
90
|
+
scrollTop: number;
|
|
91
|
+
} & {
|
|
92
|
+
readonly height: number;
|
|
93
|
+
} & {
|
|
94
|
+
setScrollTop(scrollTop: number): void;
|
|
95
|
+
setHeight(displayHeight: number): number; /**
|
|
96
|
+
* #property
|
|
97
|
+
*/
|
|
98
|
+
resizeHeight(distance: number): number;
|
|
99
|
+
} & {
|
|
100
|
+
featureDensityStatsP: Promise<import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats> | undefined;
|
|
101
|
+
featureDensityStats: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined;
|
|
102
|
+
currStatsBpPerPx: number;
|
|
103
|
+
} & {
|
|
104
|
+
readonly currentBytesRequested: number;
|
|
105
|
+
readonly currentFeatureScreenDensity: number;
|
|
106
|
+
readonly maxFeatureScreenDensity: any;
|
|
107
|
+
readonly featureDensityStatsReady: boolean;
|
|
108
|
+
readonly maxAllowableBytes: number;
|
|
109
|
+
} & {
|
|
110
|
+
afterAttach(): void;
|
|
111
|
+
} & {
|
|
112
|
+
setCurrStatsBpPerPx(n: number): void;
|
|
113
|
+
setFeatureDensityStatsLimit(stats?: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined): void;
|
|
114
|
+
getFeatureDensityStats(): Promise<import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats>;
|
|
115
|
+
setFeatureDensityStatsP(arg: any): void;
|
|
116
|
+
setFeatureDensityStats(featureDensityStats?: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined): void;
|
|
117
|
+
clearFeatureDensityStats(): void;
|
|
118
|
+
} & {
|
|
119
|
+
readonly regionTooLarge: boolean;
|
|
120
|
+
readonly regionTooLargeReason: string;
|
|
121
|
+
} & {
|
|
122
|
+
regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features";
|
|
123
|
+
regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): React.JSX.Element | null;
|
|
124
|
+
} & {
|
|
125
|
+
lastDrawnOffsetPx: number;
|
|
126
|
+
features: Feature[] | undefined;
|
|
127
|
+
loading: boolean;
|
|
128
|
+
drawn: boolean;
|
|
129
|
+
} & {
|
|
130
|
+
/**
|
|
131
|
+
* #getter
|
|
132
|
+
*/
|
|
133
|
+
readonly displayModeSetting: any;
|
|
134
|
+
} & {
|
|
135
|
+
/**
|
|
136
|
+
* #action
|
|
137
|
+
*/
|
|
138
|
+
selectFeature(feature: Feature): void;
|
|
139
|
+
/**
|
|
140
|
+
* #action
|
|
141
|
+
*/
|
|
142
|
+
setLoading(flag: boolean): void;
|
|
143
|
+
/**
|
|
144
|
+
* #action
|
|
145
|
+
*/
|
|
146
|
+
setFeatures(f: Feature[]): void;
|
|
147
|
+
/**
|
|
148
|
+
* #action
|
|
149
|
+
*/
|
|
150
|
+
setDisplayMode(flag: string): void;
|
|
151
|
+
} & {
|
|
152
|
+
afterAttach(): void;
|
|
153
|
+
/**
|
|
154
|
+
* #action
|
|
155
|
+
*/
|
|
156
|
+
renderSvg(opts: {
|
|
157
|
+
rasterizeLayers?: boolean;
|
|
158
|
+
}): Promise<React.ReactNode>;
|
|
159
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
160
|
+
export type LinearArcDisplayStateModel = ReturnType<typeof stateModelFactory>;
|
|
161
|
+
export type LinearArcDisplayModel = Instance<LinearArcDisplayStateModel>;
|