@jbrowse/plugin-breakpoint-split-view 2.17.0 → 3.0.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/BreakpointAlignmentsFeatureDetail/BreakpointAlignmentsFeatureDetail.d.ts +6 -3
- package/dist/BreakpointAlignmentsFeatureDetail/BreakpointAlignmentsFeatureDetail.js +5 -11
- package/dist/BreakpointAlignmentsFeatureDetail/index.d.ts +1 -1
- package/dist/BreakpointAlignmentsFeatureDetail/index.js +18 -8
- package/dist/BreakpointSplitView/BreakpointSplitView.d.ts +22 -40
- package/dist/BreakpointSplitView/BreakpointSplitView.js +41 -90
- package/dist/BreakpointSplitView/components/AlignmentConnections.d.ts +3 -4
- package/dist/BreakpointSplitView/components/AlignmentConnections.js +93 -124
- package/dist/BreakpointSplitView/components/Breakends.d.ts +3 -4
- package/dist/BreakpointSplitView/components/Breakends.js +67 -92
- package/dist/BreakpointSplitView/components/BreakpointSplitView.d.ts +2 -3
- package/dist/BreakpointSplitView/components/BreakpointSplitView.js +13 -17
- package/dist/BreakpointSplitView/components/BreakpointSplitViewOverlay.d.ts +2 -3
- package/dist/BreakpointSplitView/components/BreakpointSplitViewOverlay.js +10 -39
- package/dist/BreakpointSplitView/components/ExportSvgDialog.d.ts +2 -3
- package/dist/BreakpointSplitView/components/ExportSvgDialog.js +35 -76
- package/dist/BreakpointSplitView/components/Overlay.d.ts +3 -4
- package/dist/BreakpointSplitView/components/Overlay.js +8 -9
- package/dist/BreakpointSplitView/components/PairedFeatures.d.ts +3 -4
- package/dist/BreakpointSplitView/components/PairedFeatures.js +47 -72
- package/dist/BreakpointSplitView/components/Translocations.d.ts +3 -4
- package/dist/BreakpointSplitView/components/Translocations.js +57 -86
- package/dist/BreakpointSplitView/components/getOrientationColor.js +0 -8
- package/dist/BreakpointSplitView/components/util.d.ts +1 -1
- package/dist/BreakpointSplitView/components/util.js +12 -12
- package/dist/BreakpointSplitView/index.d.ts +1 -1
- package/dist/BreakpointSplitView/index.js +19 -10
- package/dist/BreakpointSplitView/model.d.ts +23 -108
- package/dist/BreakpointSplitView/model.js +50 -153
- package/dist/BreakpointSplitView/svgcomponents/SVGBackground.d.ts +1 -2
- package/dist/BreakpointSplitView/svgcomponents/SVGBackground.js +3 -6
- package/dist/BreakpointSplitView/svgcomponents/SVGBreakpointSplitView.d.ts +2 -1
- package/dist/BreakpointSplitView/svgcomponents/SVGBreakpointSplitView.js +6 -30
- package/dist/BreakpointSplitView/svgcomponents/util.d.ts +2 -2
- package/dist/BreakpointSplitView/svgcomponents/util.js +0 -1
- package/dist/BreakpointSplitView/types.d.ts +22 -0
- package/dist/BreakpointSplitView/types.js +2 -0
- package/dist/BreakpointSplitView/util.d.ts +12 -2
- package/dist/BreakpointSplitView/util.js +34 -8
- package/dist/index.d.ts +1 -1
- package/esm/BreakpointAlignmentsFeatureDetail/BreakpointAlignmentsFeatureDetail.d.ts +6 -3
- package/esm/BreakpointAlignmentsFeatureDetail/BreakpointAlignmentsFeatureDetail.js +5 -8
- package/esm/BreakpointAlignmentsFeatureDetail/index.d.ts +1 -1
- package/esm/BreakpointAlignmentsFeatureDetail/index.js +1 -1
- package/esm/BreakpointSplitView/BreakpointSplitView.d.ts +22 -40
- package/esm/BreakpointSplitView/BreakpointSplitView.js +41 -90
- package/esm/BreakpointSplitView/components/AlignmentConnections.d.ts +3 -4
- package/esm/BreakpointSplitView/components/AlignmentConnections.js +94 -102
- package/esm/BreakpointSplitView/components/Breakends.d.ts +3 -4
- package/esm/BreakpointSplitView/components/Breakends.js +68 -70
- package/esm/BreakpointSplitView/components/BreakpointSplitView.d.ts +2 -3
- package/esm/BreakpointSplitView/components/BreakpointSplitView.js +13 -17
- package/esm/BreakpointSplitView/components/BreakpointSplitViewOverlay.d.ts +2 -3
- package/esm/BreakpointSplitView/components/BreakpointSplitViewOverlay.js +10 -16
- package/esm/BreakpointSplitView/components/ExportSvgDialog.d.ts +2 -3
- package/esm/BreakpointSplitView/components/ExportSvgDialog.js +35 -53
- package/esm/BreakpointSplitView/components/Overlay.d.ts +3 -4
- package/esm/BreakpointSplitView/components/Overlay.js +8 -9
- package/esm/BreakpointSplitView/components/PairedFeatures.d.ts +3 -4
- package/esm/BreakpointSplitView/components/PairedFeatures.js +48 -50
- package/esm/BreakpointSplitView/components/Translocations.d.ts +3 -4
- package/esm/BreakpointSplitView/components/Translocations.js +58 -64
- package/esm/BreakpointSplitView/components/getOrientationColor.js +0 -8
- package/esm/BreakpointSplitView/components/util.d.ts +1 -1
- package/esm/BreakpointSplitView/components/util.js +12 -12
- package/esm/BreakpointSplitView/index.d.ts +1 -1
- package/esm/BreakpointSplitView/index.js +2 -3
- package/esm/BreakpointSplitView/model.d.ts +23 -108
- package/esm/BreakpointSplitView/model.js +30 -142
- package/esm/BreakpointSplitView/svgcomponents/SVGBackground.d.ts +1 -2
- package/esm/BreakpointSplitView/svgcomponents/SVGBackground.js +3 -3
- package/esm/BreakpointSplitView/svgcomponents/SVGBreakpointSplitView.d.ts +2 -1
- package/esm/BreakpointSplitView/svgcomponents/SVGBreakpointSplitView.js +6 -30
- package/esm/BreakpointSplitView/svgcomponents/util.d.ts +2 -2
- package/esm/BreakpointSplitView/svgcomponents/util.js +0 -1
- package/esm/BreakpointSplitView/types.d.ts +22 -0
- package/esm/BreakpointSplitView/types.js +1 -0
- package/esm/BreakpointSplitView/util.d.ts +12 -2
- package/esm/BreakpointSplitView/util.js +33 -10
- package/esm/index.d.ts +1 -1
- package/package.json +3 -3
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { LayoutRecord } from './types';
|
|
2
|
+
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
|
+
import type { Feature } from '@jbrowse/core/util';
|
|
4
|
+
import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view';
|
|
3
5
|
type LGV = LinearGenomeViewModel;
|
|
4
6
|
interface Display {
|
|
5
7
|
height: number;
|
|
@@ -7,6 +9,7 @@ interface Display {
|
|
|
7
9
|
SNPCoverageDisplay?: {
|
|
8
10
|
height: number;
|
|
9
11
|
};
|
|
12
|
+
searchFeatureByID?: (str: string) => LayoutRecord;
|
|
10
13
|
}
|
|
11
14
|
interface Track {
|
|
12
15
|
displays: Display[];
|
|
@@ -16,4 +19,11 @@ export declare function getPxFromCoordinate(view: LGV, refName: string, coord: n
|
|
|
16
19
|
export declare function yPos(trackId: string, level: number, views: LGV[], tracks: Track[], c: LayoutRecord, getYPosOverride?: (trackId: string, level: number) => number): number;
|
|
17
20
|
export declare const useNextFrame: (variable: unknown) => void;
|
|
18
21
|
export declare function intersect<T>(cb: (l: T) => string, a1?: T[], a2?: T[], ...rest: T[][]): T[];
|
|
22
|
+
export declare function getClip(cigar: string, strand: number): number;
|
|
23
|
+
export declare function calc(track: Track, f: Feature): LayoutRecord | undefined;
|
|
24
|
+
export declare function getBlockFeatures(model: {
|
|
25
|
+
views: LinearGenomeViewModel[];
|
|
26
|
+
}, track: {
|
|
27
|
+
configuration: AnyConfigurationModel;
|
|
28
|
+
}): Promise<Feature[][] | undefined>;
|
|
19
29
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { getConf } from '@jbrowse/core/configuration';
|
|
3
|
+
import { clamp, getSession } from '@jbrowse/core/util';
|
|
3
4
|
const [, TOP, , BOTTOM] = [0, 1, 2, 3];
|
|
4
5
|
function cheight(chunk) {
|
|
5
6
|
return chunk[BOTTOM] - chunk[TOP];
|
|
@@ -14,7 +15,6 @@ export function getPxFromCoordinate(view, refName, coord) {
|
|
|
14
15
|
var _a;
|
|
15
16
|
return (((_a = view.bpToPx({ refName, coord })) === null || _a === void 0 ? void 0 : _a.offsetPx) || 0) - view.offsetPx;
|
|
16
17
|
}
|
|
17
|
-
// get's the yposition of a layout record in a track
|
|
18
18
|
export function yPos(trackId, level, views, tracks, c, getYPosOverride) {
|
|
19
19
|
const display = tracks[level].displays[0];
|
|
20
20
|
const min = 0;
|
|
@@ -29,21 +29,44 @@ export function yPos(trackId, level, views, tracks, c, getYPosOverride) {
|
|
|
29
29
|
heightFromSpecificLevel(views, trackId, level, getYPosOverride) +
|
|
30
30
|
display.scrollTop);
|
|
31
31
|
}
|
|
32
|
-
// we combo a useEffect and useState combo to force rerender on snap changing.
|
|
33
|
-
// the setup of this being a useEffect+useState makes it re-render once the
|
|
34
|
-
// useEffect is called, which is generally the "next frame". If we removed the
|
|
35
|
-
// below use
|
|
36
32
|
export const useNextFrame = (variable) => {
|
|
37
33
|
const [, setNextFrameState] = useState();
|
|
38
34
|
useEffect(() => {
|
|
39
35
|
setNextFrameState(variable);
|
|
40
36
|
}, [variable]);
|
|
41
37
|
};
|
|
42
|
-
// https://stackoverflow.com/a/49186706/2129219 the array-intersection package
|
|
43
|
-
// on npm has a large kb size, and we are just intersecting open track ids so
|
|
44
|
-
// simple is better
|
|
45
38
|
export function intersect(cb, a1 = [], a2 = [], ...rest) {
|
|
46
39
|
const ids = new Set(a2.map(elt => cb(elt)));
|
|
47
40
|
const a12 = a1.filter(value => ids.has(cb(value)));
|
|
48
41
|
return rest.length === 0 ? a12 : intersect(cb, a12, ...rest);
|
|
49
42
|
}
|
|
43
|
+
const startClip = new RegExp(/(\d+)[SH]$/);
|
|
44
|
+
const endClip = new RegExp(/^(\d+)([SH])/);
|
|
45
|
+
export function getClip(cigar, strand) {
|
|
46
|
+
return strand === -1
|
|
47
|
+
? +(startClip.exec(cigar) || [])[1] || 0
|
|
48
|
+
: +(endClip.exec(cigar) || [])[1] || 0;
|
|
49
|
+
}
|
|
50
|
+
export function calc(track, f) {
|
|
51
|
+
var _a, _b;
|
|
52
|
+
return (_b = (_a = track.displays[0]).searchFeatureByID) === null || _b === void 0 ? void 0 : _b.call(_a, f.id());
|
|
53
|
+
}
|
|
54
|
+
export async function getBlockFeatures(model, track) {
|
|
55
|
+
var _a;
|
|
56
|
+
const { views } = model;
|
|
57
|
+
const { rpcManager, assemblyManager } = getSession(model);
|
|
58
|
+
const assemblyName = (_a = model.views[0]) === null || _a === void 0 ? void 0 : _a.assemblyNames[0];
|
|
59
|
+
if (!assemblyName) {
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
const assembly = await assemblyManager.waitForAssembly(assemblyName);
|
|
63
|
+
if (!assembly) {
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
const sessionId = track.configuration.trackId;
|
|
67
|
+
return Promise.all(views.map(async (view) => (await rpcManager.call(sessionId, 'CoreGetFeatures', {
|
|
68
|
+
adapterConfig: getConf(track, ['adapter']),
|
|
69
|
+
sessionId,
|
|
70
|
+
regions: view.staticBlocks.contentBlocks,
|
|
71
|
+
})).flat()));
|
|
72
|
+
}
|
package/esm/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
2
1
|
import Plugin from '@jbrowse/core/Plugin';
|
|
2
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
3
3
|
export default class BreakpointSplitViewPlugin extends Plugin {
|
|
4
4
|
name: string;
|
|
5
5
|
install(pluginManager: PluginManager): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-breakpoint-split-view",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "JBrowse 2 breakpoint detail split view",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"clean": "rimraf dist esm *.tsbuildinfo"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@gmod/vcf": "^
|
|
39
|
+
"@gmod/vcf": "^6.0.0",
|
|
40
40
|
"@mui/icons-material": "^6.0.0",
|
|
41
41
|
"@types/file-saver": "^2.0.1",
|
|
42
42
|
"file-saver": "^2.0.0"
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"access": "public"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "2c6897f1fa732b1db5b094d1dca197e333e95319"
|
|
62
62
|
}
|