@jbrowse/plugin-variants 2.5.0 → 2.6.1
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/ChordVariantDisplay/models/stateModelFactory.d.ts +11 -3
- package/dist/LinearVariantDisplay/model.d.ts +52 -49
- package/dist/StructuralVariantChordRenderer/Chord.d.ts +2 -1
- package/dist/StructuralVariantChordRenderer/ReactComponent.d.ts +2 -1
- package/dist/VariantFeatureWidget/AnnotGrid.d.ts +2 -1
- package/dist/VariantFeatureWidget/AnnotGrid.js +8 -13
- package/dist/VariantFeatureWidget/AnnotGrid.js.map +1 -1
- package/dist/VariantFeatureWidget/BreakendOptionDialog.d.ts +2 -1
- package/dist/VariantFeatureWidget/BreakendPanel.d.ts +2 -1
- package/dist/VariantFeatureWidget/VariantAnnotationTable.d.ts +6 -0
- package/dist/VariantFeatureWidget/VariantAnnotationTable.js +17 -0
- package/dist/VariantFeatureWidget/VariantAnnotationTable.js.map +1 -0
- package/dist/VariantFeatureWidget/VariantFeatureWidget.d.ts +8 -1
- package/dist/VariantFeatureWidget/VariantFeatureWidget.js +26 -14
- package/dist/VariantFeatureWidget/VariantFeatureWidget.js.map +1 -1
- package/dist/VariantFeatureWidget/VariantSampleGrid.d.ts +9 -2
- package/dist/VariantFeatureWidget/VariantSampleGrid.js.map +1 -1
- package/esm/ChordVariantDisplay/models/stateModelFactory.d.ts +11 -3
- package/esm/LinearVariantDisplay/model.d.ts +52 -49
- package/esm/StructuralVariantChordRenderer/Chord.d.ts +2 -1
- package/esm/StructuralVariantChordRenderer/ReactComponent.d.ts +2 -1
- package/esm/VariantFeatureWidget/AnnotGrid.d.ts +2 -1
- package/esm/VariantFeatureWidget/AnnotGrid.js +8 -13
- package/esm/VariantFeatureWidget/AnnotGrid.js.map +1 -1
- package/esm/VariantFeatureWidget/BreakendOptionDialog.d.ts +2 -1
- package/esm/VariantFeatureWidget/BreakendPanel.d.ts +2 -1
- package/esm/VariantFeatureWidget/VariantAnnotationTable.d.ts +6 -0
- package/esm/VariantFeatureWidget/VariantAnnotationTable.js +11 -0
- package/esm/VariantFeatureWidget/VariantAnnotationTable.js.map +1 -0
- package/esm/VariantFeatureWidget/VariantFeatureWidget.d.ts +8 -1
- package/esm/VariantFeatureWidget/VariantFeatureWidget.js +26 -14
- package/esm/VariantFeatureWidget/VariantFeatureWidget.js.map +1 -1
- package/esm/VariantFeatureWidget/VariantSampleGrid.d.ts +9 -2
- package/esm/VariantFeatureWidget/VariantSampleGrid.js.map +1 -1
- package/package.json +2 -2
- package/src/VariantFeatureWidget/AnnotGrid.tsx +16 -17
- package/src/VariantFeatureWidget/VariantAnnotationTable.tsx +27 -0
- package/src/VariantFeatureWidget/VariantFeatureWidget.tsx +61 -16
- package/src/VariantFeatureWidget/VariantSampleGrid.tsx +1 -2
- package/dist/VariantFeatureWidget/VariantAnnPanel.d.ts +0 -4
- package/dist/VariantFeatureWidget/VariantAnnPanel.js +0 -25
- package/dist/VariantFeatureWidget/VariantAnnPanel.js.map +0 -1
- package/dist/VariantFeatureWidget/VariantCsqPanel.d.ts +0 -4
- package/dist/VariantFeatureWidget/VariantCsqPanel.js +0 -25
- package/dist/VariantFeatureWidget/VariantCsqPanel.js.map +0 -1
- package/esm/VariantFeatureWidget/VariantAnnPanel.d.ts +0 -4
- package/esm/VariantFeatureWidget/VariantAnnPanel.js +0 -19
- package/esm/VariantFeatureWidget/VariantAnnPanel.js.map +0 -1
- package/esm/VariantFeatureWidget/VariantCsqPanel.d.ts +0 -4
- package/esm/VariantFeatureWidget/VariantCsqPanel.js +0 -19
- package/esm/VariantFeatureWidget/VariantCsqPanel.js.map +0 -1
- package/src/VariantFeatureWidget/VariantAnnPanel.tsx +0 -31
- package/src/VariantFeatureWidget/VariantCsqPanel.tsx +0 -31
|
@@ -13,6 +13,13 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
13
13
|
rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
14
14
|
} & {
|
|
15
15
|
heightPreConfig: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
16
|
+
} & {
|
|
17
|
+
/**
|
|
18
|
+
* #property
|
|
19
|
+
*/
|
|
20
|
+
userBpPerPxLimit: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
21
|
+
userByteSizeLimit: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
22
|
+
} & {
|
|
16
23
|
blockState: import("mobx-state-tree").IMapType<import("mobx-state-tree").IModelType<{
|
|
17
24
|
key: import("mobx-state-tree").ISimpleType<string>;
|
|
18
25
|
region: import("mobx-state-tree").IModelType<{
|
|
@@ -59,8 +66,6 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
59
66
|
reload(): void;
|
|
60
67
|
beforeDestroy(): void;
|
|
61
68
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
62
|
-
userBpPerPxLimit: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
63
|
-
userByteSizeLimit: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
64
69
|
configuration: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
65
70
|
maxFeatureScreenDensity: {
|
|
66
71
|
type: string;
|
|
@@ -70,18 +75,12 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
70
75
|
fetchSizeLimit: {
|
|
71
76
|
type: string;
|
|
72
77
|
defaultValue: number;
|
|
73
|
-
description: string;
|
|
74
|
-
|
|
75
|
-
*/
|
|
76
|
-
}; /**
|
|
77
|
-
* #property
|
|
78
|
-
*/
|
|
78
|
+
description: string;
|
|
79
|
+
};
|
|
79
80
|
height: {
|
|
80
81
|
type: string;
|
|
81
82
|
defaultValue: number;
|
|
82
|
-
description: string;
|
|
83
|
-
* #action
|
|
84
|
-
*/
|
|
83
|
+
description: string;
|
|
85
84
|
};
|
|
86
85
|
mouseover: {
|
|
87
86
|
type: string;
|
|
@@ -93,9 +92,7 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
93
92
|
} & {
|
|
94
93
|
type: import("mobx-state-tree").ISimpleType<"LinearBasicDisplay">;
|
|
95
94
|
trackShowLabels: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<boolean>>;
|
|
96
|
-
trackShowDescriptions: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<boolean>>;
|
|
97
|
-
* #action
|
|
98
|
-
*/
|
|
95
|
+
trackShowDescriptions: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<boolean>>;
|
|
99
96
|
trackDisplayMode: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
100
97
|
trackMaxHeight: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
101
98
|
configuration: AnyConfigurationSchemaType;
|
|
@@ -111,6 +108,7 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
111
108
|
}, {
|
|
112
109
|
rendererTypeName: string;
|
|
113
110
|
error: unknown;
|
|
111
|
+
message: string | undefined;
|
|
114
112
|
} & {
|
|
115
113
|
readonly RenderingComponent: import("react").FC<{
|
|
116
114
|
model: {
|
|
@@ -120,6 +118,7 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
120
118
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
121
119
|
rendererTypeName: string;
|
|
122
120
|
error: unknown;
|
|
121
|
+
message: string | undefined;
|
|
123
122
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
124
123
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
125
124
|
type: import("mobx-state-tree").ISimpleType<string>;
|
|
@@ -127,6 +126,7 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
127
126
|
}, {
|
|
128
127
|
rendererTypeName: string;
|
|
129
128
|
error: unknown;
|
|
129
|
+
message: string | undefined;
|
|
130
130
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
131
131
|
onHorizontalScroll?: Function | undefined;
|
|
132
132
|
blockState?: Record<string, any> | undefined;
|
|
@@ -139,6 +139,7 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
139
139
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
140
140
|
rendererTypeName: string;
|
|
141
141
|
error: unknown;
|
|
142
|
+
message: string | undefined;
|
|
142
143
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
143
144
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
144
145
|
type: import("mobx-state-tree").ISimpleType<string>;
|
|
@@ -146,6 +147,7 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
146
147
|
}, {
|
|
147
148
|
rendererTypeName: string;
|
|
148
149
|
error: unknown;
|
|
150
|
+
message: string | undefined;
|
|
149
151
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
150
152
|
}> | null;
|
|
151
153
|
readonly adapterConfig: any;
|
|
@@ -155,21 +157,49 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
155
157
|
readonly DisplayMessageComponent: import("react").FC<any> | undefined;
|
|
156
158
|
trackMenuItems(): import("@jbrowse/core/ui").MenuItem[];
|
|
157
159
|
readonly viewMenuActions: import("@jbrowse/core/ui").MenuItem[];
|
|
158
|
-
regionCannotBeRendered():
|
|
160
|
+
regionCannotBeRendered(): null;
|
|
159
161
|
} & {
|
|
162
|
+
setMessage(arg?: string | undefined): void;
|
|
160
163
|
setError(error?: unknown): void;
|
|
161
164
|
setRpcDriverName(rpcDriverName: string): void;
|
|
162
165
|
reload(): void;
|
|
163
166
|
} & {
|
|
164
|
-
currBpPerPx: number;
|
|
165
167
|
scrollTop: number;
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
168
|
+
} & {
|
|
169
|
+
readonly height: number;
|
|
170
|
+
} & {
|
|
171
|
+
setScrollTop(scrollTop: number): void;
|
|
172
|
+
setHeight(displayHeight: number): number;
|
|
173
|
+
resizeHeight(distance: number): number;
|
|
174
|
+
} & {
|
|
169
175
|
featureDensityStatsP: Promise<import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats> | undefined;
|
|
170
176
|
featureDensityStats: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined;
|
|
177
|
+
currStatsBpPerPx: number;
|
|
178
|
+
} & {
|
|
179
|
+
readonly currentBytesRequested: number;
|
|
180
|
+
readonly currentFeatureScreenDensity: number;
|
|
181
|
+
readonly maxFeatureScreenDensity: any;
|
|
182
|
+
readonly featureDensityStatsReady: boolean;
|
|
183
|
+
readonly maxAllowableBytes: number;
|
|
184
|
+
} & {
|
|
185
|
+
afterAttach(): void;
|
|
186
|
+
} & {
|
|
187
|
+
setCurrStatsBpPerPx(n: number): void;
|
|
188
|
+
setFeatureDensityStatsLimit(stats?: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined): void;
|
|
189
|
+
getFeatureDensityStats(): Promise<import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats>;
|
|
190
|
+
setFeatureDensityStatsP(arg: any): void;
|
|
191
|
+
setFeatureDensityStats(featureDensityStats?: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined): void;
|
|
192
|
+
clearFeatureDensityStats(): void;
|
|
193
|
+
} & {
|
|
194
|
+
readonly regionTooLarge: boolean;
|
|
195
|
+
readonly regionTooLargeReason: string;
|
|
196
|
+
} & {
|
|
197
|
+
regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features";
|
|
198
|
+
regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): import("react").JSX.Element | null;
|
|
199
|
+
} & {
|
|
200
|
+
featureIdUnderMouse: string | undefined;
|
|
201
|
+
contextMenuFeature: Feature | undefined;
|
|
171
202
|
} & {
|
|
172
|
-
readonly height: number;
|
|
173
203
|
readonly blockType: "dynamicBlocks" | "staticBlocks";
|
|
174
204
|
readonly blockDefinitions: import("@jbrowse/core/util/blockTypes").BlockSet;
|
|
175
205
|
} & {
|
|
@@ -183,49 +213,22 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
183
213
|
getFeatureOverlapping(blockKey: string, x: number, y: number): string | undefined;
|
|
184
214
|
getFeatureByID(blockKey: string, id: string): [number, number, number, number] | undefined;
|
|
185
215
|
searchFeatureByID(id: string): [number, number, number, number] | undefined;
|
|
186
|
-
readonly currentBytesRequested: number;
|
|
187
|
-
readonly currentFeatureScreenDensity: number;
|
|
188
|
-
readonly maxFeatureScreenDensity: any;
|
|
189
|
-
readonly featureDensityStatsReady: boolean;
|
|
190
|
-
readonly maxAllowableBytes: number;
|
|
191
|
-
} & {
|
|
192
|
-
setMessage(message: string): void;
|
|
193
216
|
} & {
|
|
194
|
-
afterAttach(): void;
|
|
195
|
-
getFeatureDensityStats(): Promise<import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats>;
|
|
196
|
-
setFeatureDensityStatsP(arg: any): void;
|
|
197
|
-
setFeatureDensityStats(featureDensityStats?: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined): void;
|
|
198
|
-
clearFeatureDensityStats(): void;
|
|
199
|
-
setHeight(displayHeight: number): number;
|
|
200
|
-
resizeHeight(distance: number): number;
|
|
201
|
-
setScrollTop(scrollTop: number): void;
|
|
202
|
-
setFeatureDensityStatsLimit(stats?: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined): void;
|
|
203
217
|
addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
|
|
204
|
-
setCurrBpPerPx(n: number): void;
|
|
205
218
|
deleteBlock(key: string): void;
|
|
206
219
|
selectFeature(feature: Feature): void;
|
|
207
220
|
clearFeatureSelection(): void;
|
|
208
221
|
setFeatureIdUnderMouse(feature?: string | undefined): void;
|
|
209
|
-
reload(): void;
|
|
210
222
|
setContextMenuFeature(feature?: Feature | undefined): void;
|
|
211
|
-
} & {
|
|
212
|
-
readonly regionTooLarge: boolean;
|
|
213
|
-
readonly regionTooLargeReason: string;
|
|
214
223
|
} & {
|
|
215
224
|
reload(): Promise<void>;
|
|
216
225
|
} & {
|
|
217
|
-
afterAttach(): void;
|
|
218
|
-
} & {
|
|
219
|
-
regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features";
|
|
220
|
-
regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): JSX.Element | null;
|
|
221
226
|
trackMenuItems(): import("@jbrowse/core/ui").MenuItem[];
|
|
222
227
|
contextMenuItems(): import("@jbrowse/core/ui").MenuItem[];
|
|
223
228
|
renderProps(): any;
|
|
224
229
|
} & {
|
|
225
|
-
renderSvg(opts: import("@jbrowse/plugin-linear-genome-view
|
|
226
|
-
|
|
227
|
-
theme: import("@mui/material").ThemeOptions;
|
|
228
|
-
}): Promise<JSX.Element>;
|
|
230
|
+
renderSvg(opts: import("@jbrowse/plugin-linear-genome-view").ExportSvgDisplayOptions): Promise<import("react").JSX.Element>;
|
|
231
|
+
afterAttach(): void;
|
|
229
232
|
} & {
|
|
230
233
|
readonly rendererTypeName: any;
|
|
231
234
|
readonly showLabels: any;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { Feature } from '@jbrowse/core/util';
|
|
2
3
|
import { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
4
|
export interface Region {
|
|
@@ -27,5 +28,5 @@ declare const Chord: ({ feature, blocksForRefs, radius, config, bezierRadius, se
|
|
|
27
28
|
bezierRadius: number;
|
|
28
29
|
selected: boolean;
|
|
29
30
|
onClick: (feature: Feature, reg: AnyRegion, endBlock: AnyRegion, evt: unknown) => void;
|
|
30
|
-
}) => JSX.Element | null;
|
|
31
|
+
}) => React.JSX.Element | null;
|
|
31
32
|
export default Chord;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { Feature } from '@jbrowse/core/util';
|
|
2
3
|
import { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
4
|
import { Block, AnyRegion } from './Chord';
|
|
@@ -12,5 +13,5 @@ declare const _default: ({ features, config, displayModel, blockDefinitions, rad
|
|
|
12
13
|
blockDefinitions: Block[];
|
|
13
14
|
bezierRadius: number;
|
|
14
15
|
onChordClick: (feature: Feature, reg: AnyRegion, endBlock: AnyRegion, evt: unknown) => void;
|
|
15
|
-
}) => JSX.Element;
|
|
16
|
+
}) => React.JSX.Element;
|
|
16
17
|
export default _default;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { GridColDef, GridValidRowModel } from '@mui/x-data-grid';
|
|
2
3
|
export default function VariantAnnotPanel({ rows, columns, }: {
|
|
3
4
|
rows: GridValidRowModel[];
|
|
4
5
|
columns: GridColDef[];
|
|
5
|
-
}): JSX.Element | null;
|
|
6
|
+
}): React.JSX.Element | null;
|
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import { DataGrid, GridToolbar, } from '@mui/x-data-grid';
|
|
3
3
|
import { Checkbox, FormControlLabel, Typography } from '@mui/material';
|
|
4
|
+
import ResizeBar, { useResizeBar } from '@jbrowse/core/ui/ResizeBar';
|
|
5
|
+
import { measureGridWidth } from '@jbrowse/core/util';
|
|
4
6
|
export default function VariantAnnotPanel({ rows, columns, }) {
|
|
5
|
-
const
|
|
6
|
-
const headerHeight = 100;
|
|
7
|
-
const footerHeight = 50;
|
|
7
|
+
const { ref, scrollLeft } = useResizeBar();
|
|
8
8
|
const [checked, setChecked] = useState(false);
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
(checked ? 50 : 0) +
|
|
12
|
-
footerHeight;
|
|
13
|
-
return rows.length ? (React.createElement("div", null,
|
|
9
|
+
const [widths, setWidths] = useState(columns.map(e => measureGridWidth(rows.map(r => r[e.field]))));
|
|
10
|
+
return rows.length ? (React.createElement("div", { ref: ref },
|
|
14
11
|
React.createElement(FormControlLabel, { control: React.createElement(Checkbox, { checked: checked, onChange: event => setChecked(event.target.checked) }), label: React.createElement(Typography, { variant: "body2" }, "Show options") }),
|
|
15
|
-
React.createElement("div", {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
} },
|
|
19
|
-
React.createElement(DataGrid, { rowHeight: rowHeight, rows: rows, columns: columns, slots: { toolbar: checked ? GridToolbar : null } })))) : null;
|
|
12
|
+
React.createElement("div", { ref: ref },
|
|
13
|
+
React.createElement(ResizeBar, { widths: widths, setWidths: setWidths, scrollLeft: scrollLeft }),
|
|
14
|
+
React.createElement(DataGrid, { rowHeight: 25, rows: rows, columns: columns.map((c, i) => ({ ...c, width: widths[i] })), slots: { toolbar: checked ? GridToolbar : null } })))) : null;
|
|
20
15
|
}
|
|
21
16
|
//# sourceMappingURL=AnnotGrid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnnotGrid.js","sourceRoot":"","sources":["../../src/VariantFeatureWidget/AnnotGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,EACL,QAAQ,EAER,WAAW,GAEZ,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"AnnotGrid.js","sourceRoot":"","sources":["../../src/VariantFeatureWidget/AnnotGrid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AU,GACtB;YACF,oBAAC,QAAQ,IACP,SAAS,EAAE,EAAE,EACb,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAC5D,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,EAAE,GAChD,CACE,CACF,CACP,CAAC,CAAC,CAAC,IAAI,CAAA;AACV,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { Feature } from '@jbrowse/core/util';
|
|
2
3
|
declare const _default: ({ model, handleClose, feature, viewType, }: {
|
|
3
4
|
model: any;
|
|
4
5
|
handleClose: () => void;
|
|
5
6
|
feature: Feature;
|
|
6
7
|
viewType: any;
|
|
7
|
-
}) => JSX.Element;
|
|
8
|
+
}) => React.JSX.Element;
|
|
8
9
|
export default _default;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { SimpleFeatureSerialized } from '@jbrowse/core/util/simpleFeature';
|
|
2
3
|
export default function BreakendPanel(props: {
|
|
3
4
|
locStrings: string[];
|
|
4
5
|
model: any;
|
|
5
6
|
feature: SimpleFeatureSerialized;
|
|
6
|
-
}): JSX.Element;
|
|
7
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BaseCard } from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail';
|
|
3
|
+
import AnnotGrid from './AnnotGrid';
|
|
4
|
+
export default function VariantAnnotationTable({ data, fields, title, }) {
|
|
5
|
+
return data.length ? (React.createElement(BaseCard, { title: title },
|
|
6
|
+
React.createElement(AnnotGrid, { rows: data.map((elt, id) => ({
|
|
7
|
+
id,
|
|
8
|
+
...Object.fromEntries(elt.split('|').map((e, i) => [fields[i], e])),
|
|
9
|
+
})) || [], columns: fields.map(c => ({ field: c })) }))) : null;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=VariantAnnotationTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VariantAnnotationTable.js","sourceRoot":"","sources":["../../src/VariantFeatureWidget/VariantAnnotationTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,mDAAmD,CAAA;AAC5E,OAAO,SAAS,MAAM,aAAa,CAAA;AAEnC,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAC7C,IAAI,EACJ,MAAM,EACN,KAAK,GAKN;IACC,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CACnB,oBAAC,QAAQ,IAAC,KAAK,EAAE,KAAK;QACpB,oBAAC,SAAS,IACR,IAAI,EACF,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;gBACrB,EAAE;gBACF,GAAG,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;aACpE,CAAC,CAAC,IAAI,EAAE,EAEX,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,GACxC,CACO,CACZ,CAAC,CAAC,CAAC,IAAI,CAAA;AACV,CAAC"}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SimpleFeatureSerialized } from '@jbrowse/core/util';
|
|
3
|
+
declare function VariantFeatureDetails(props: {
|
|
4
|
+
model: {
|
|
5
|
+
featureData: SimpleFeatureSerialized;
|
|
6
|
+
descriptions: Record<string, string>;
|
|
7
|
+
};
|
|
8
|
+
}): React.JSX.Element;
|
|
2
9
|
declare const _default: typeof VariantFeatureDetails;
|
|
3
10
|
export default _default;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { observer } from 'mobx-react';
|
|
4
3
|
import { Divider, Paper } from '@mui/material';
|
|
@@ -6,33 +5,46 @@ import { FeatureDetails } from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetai
|
|
|
6
5
|
import { parseBreakend } from '@gmod/vcf';
|
|
7
6
|
// locals
|
|
8
7
|
import VariantSampleGrid from './VariantSampleGrid';
|
|
9
|
-
import VariantCsqPanel from './VariantCsqPanel';
|
|
10
|
-
import VariantAnnPanel from './VariantAnnPanel';
|
|
11
8
|
import BreakendPanel from './BreakendPanel';
|
|
9
|
+
import VariantAnnotationTable from './VariantAnnotationTable';
|
|
10
|
+
const basicDescriptions = {
|
|
11
|
+
CHROM: 'chromosome: An identifier from the reference genome',
|
|
12
|
+
POS: 'position: The reference position, with the 1st base having position 1',
|
|
13
|
+
ID: 'identifier: Semi-colon separated list of unique identifiers where available',
|
|
14
|
+
REF: 'reference base(s): Each base must be one of A,C,G,T,N (case insensitive).',
|
|
15
|
+
ALT: 'alternate base(s): Comma-separated list of alternate non-reference alleles',
|
|
16
|
+
QUAL: 'quality: Phred-scaled quality score for the assertion made in ALT',
|
|
17
|
+
FILTER: 'filter status: PASS if this position has passed all filters, otherwise a semicolon-separated list of codes for filters that fail',
|
|
18
|
+
};
|
|
12
19
|
function VariantFeatureDetails(props) {
|
|
13
20
|
const { model } = props;
|
|
14
21
|
const { featureData, descriptions } = model;
|
|
15
22
|
const feat = JSON.parse(JSON.stringify(featureData));
|
|
16
23
|
const { samples, ...rest } = feat;
|
|
17
|
-
const basicDescriptions = {
|
|
18
|
-
CHROM: 'chromosome: An identifier from the reference genome',
|
|
19
|
-
POS: 'position: The reference position, with the 1st base having position 1',
|
|
20
|
-
ID: 'identifier: Semi-colon separated list of unique identifiers where available',
|
|
21
|
-
REF: 'reference base(s): Each base must be one of A,C,G,T,N (case insensitive).',
|
|
22
|
-
ALT: 'alternate base(s): Comma-separated list of alternate non-reference alleles',
|
|
23
|
-
QUAL: 'quality: Phred-scaled quality score for the assertion made in ALT',
|
|
24
|
-
FILTER: 'filter status: PASS if this position has passed all filters, otherwise a semicolon-separated list of codes for filters that fail',
|
|
25
|
-
};
|
|
26
24
|
return (React.createElement(Paper, { "data-testid": "variant-side-drawer" },
|
|
27
25
|
React.createElement(FeatureDetails, { feature: rest, descriptions: { ...basicDescriptions, ...descriptions }, ...props }),
|
|
28
26
|
React.createElement(Divider, null),
|
|
29
|
-
React.createElement(
|
|
27
|
+
React.createElement(CsqPanel, { feature: rest, descriptions: descriptions }),
|
|
30
28
|
React.createElement(Divider, null),
|
|
31
|
-
React.createElement(
|
|
29
|
+
React.createElement(AnnPanel, { feature: rest, descriptions: descriptions }),
|
|
32
30
|
React.createElement(Divider, null),
|
|
33
31
|
feat.type === 'breakend' ? (React.createElement(BreakendPanel, { feature: feat, locStrings: feat.ALT.map((alt) => { var _a; return ((_a = parseBreakend(alt)) === null || _a === void 0 ? void 0 : _a.MatePosition) || ''; }), model: model })) : null,
|
|
34
32
|
feat.type === 'translocation' ? (React.createElement(BreakendPanel, { feature: feat, model: model, locStrings: [`${feat.INFO.CHR2[0]}:${feat.INFO.END}`] })) : null,
|
|
35
33
|
React.createElement(VariantSampleGrid, { feature: feat, ...props, descriptions: descriptions })));
|
|
36
34
|
}
|
|
35
|
+
function AnnPanel({ descriptions, feature, }) {
|
|
36
|
+
var _a, _b, _c, _d;
|
|
37
|
+
const annDesc = (_b = (_a = descriptions === null || descriptions === void 0 ? void 0 : descriptions.INFO) === null || _a === void 0 ? void 0 : _a.ANN) === null || _b === void 0 ? void 0 : _b.Description;
|
|
38
|
+
const annFields = ((_c = annDesc === null || annDesc === void 0 ? void 0 : annDesc.match(/.*Functional annotations:'(.*)'$/)) === null || _c === void 0 ? void 0 : _c[1].split('|')) || [];
|
|
39
|
+
const ann = ((_d = feature.INFO) === null || _d === void 0 ? void 0 : _d.ANN) || [];
|
|
40
|
+
return (React.createElement(VariantAnnotationTable, { fields: annFields, data: ann, title: "Variant ANN field" }));
|
|
41
|
+
}
|
|
42
|
+
function CsqPanel({ descriptions, feature, }) {
|
|
43
|
+
var _a, _b, _c, _d;
|
|
44
|
+
const csqDescription = (_b = (_a = descriptions === null || descriptions === void 0 ? void 0 : descriptions.INFO) === null || _a === void 0 ? void 0 : _a.CSQ) === null || _b === void 0 ? void 0 : _b.Description;
|
|
45
|
+
const csqFields = ((_c = csqDescription === null || csqDescription === void 0 ? void 0 : csqDescription.match(/.*Format: (.*)/)) === null || _c === void 0 ? void 0 : _c[1].split('|')) || [];
|
|
46
|
+
const csq = ((_d = feature.INFO) === null || _d === void 0 ? void 0 : _d.CSQ) || [];
|
|
47
|
+
return (React.createElement(VariantAnnotationTable, { fields: csqFields, data: csq, title: "Variant CSQ field" }));
|
|
48
|
+
}
|
|
37
49
|
export default observer(VariantFeatureDetails);
|
|
38
50
|
//# sourceMappingURL=VariantFeatureWidget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VariantFeatureWidget.js","sourceRoot":"","sources":["../../src/VariantFeatureWidget/VariantFeatureWidget.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"VariantFeatureWidget.js","sourceRoot":"","sources":["../../src/VariantFeatureWidget/VariantFeatureWidget.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,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,OAAO,GAIR;;IACC,MAAM,cAAc,GAAG,MAAA,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,IAAI,0CAAE,GAAG,0CAAE,WAAW,CAAA;IAC3D,MAAM,SAAS,GACb,CAAA,MAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,KAAK,CAAC,gBAAgB,CAAC,0CAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,KAAI,EAAE,CAAA;IAC/D,MAAM,GAAG,GAAG,CAAA,MAAA,OAAO,CAAC,IAAI,0CAAE,GAAG,KAAI,EAAE,CAAA;IACnC,OAAO,CACL,oBAAC,sBAAsB,IACrB,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,GAAG,EACT,KAAK,EAAC,mBAAmB,GACzB,CACH,CAAA;AACH,CAAC;AAED,eAAe,QAAQ,CAAC,qBAAqB,CAAC,CAAA"}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { SimpleFeatureSerialized } from '@jbrowse/core/util';
|
|
2
3
|
export default function VariantSamples(props: {
|
|
3
4
|
feature: SimpleFeatureSerialized;
|
|
4
|
-
descriptions:
|
|
5
|
-
|
|
5
|
+
descriptions: {
|
|
6
|
+
FORMAT?: {
|
|
7
|
+
[key: string]: {
|
|
8
|
+
Description?: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
}): React.JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VariantSampleGrid.js","sourceRoot":"","sources":["../../src/VariantFeatureWidget/VariantSampleGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEvC,OAAO,EACL,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,UAAU,GACX,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,kBAAkB,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B,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,EAAE,EAChD,SAAS,EAAE;oBACT,OAAO,EAAE,EAAE,YAAY,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,EAAE;iBAC1D,GACD,CACE,CACG,CACZ,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-variants",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.1",
|
|
4
4
|
"description": "JBrowse 2 variant adapters, tracks, etc.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"distModule": "esm/index.js",
|
|
65
65
|
"srcModule": "src/index.ts",
|
|
66
66
|
"module": "esm/index.js",
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "1cbe7ba097fb2d2763c776e5e429e4670cdd583c"
|
|
68
68
|
}
|
|
@@ -6,6 +6,8 @@ import {
|
|
|
6
6
|
GridValidRowModel,
|
|
7
7
|
} from '@mui/x-data-grid'
|
|
8
8
|
import { Checkbox, FormControlLabel, Typography } from '@mui/material'
|
|
9
|
+
import ResizeBar, { useResizeBar } from '@jbrowse/core/ui/ResizeBar'
|
|
10
|
+
import { measureGridWidth } from '@jbrowse/core/util'
|
|
9
11
|
|
|
10
12
|
export default function VariantAnnotPanel({
|
|
11
13
|
rows,
|
|
@@ -14,17 +16,14 @@ export default function VariantAnnotPanel({
|
|
|
14
16
|
rows: GridValidRowModel[]
|
|
15
17
|
columns: GridColDef[]
|
|
16
18
|
}) {
|
|
17
|
-
const
|
|
18
|
-
const headerHeight = 100
|
|
19
|
-
const footerHeight = 50
|
|
19
|
+
const { ref, scrollLeft } = useResizeBar()
|
|
20
20
|
const [checked, setChecked] = useState(false)
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
footerHeight
|
|
21
|
+
const [widths, setWidths] = useState(
|
|
22
|
+
columns.map(e => measureGridWidth(rows.map(r => r[e.field]))),
|
|
23
|
+
)
|
|
24
|
+
|
|
26
25
|
return rows.length ? (
|
|
27
|
-
<div>
|
|
26
|
+
<div ref={ref}>
|
|
28
27
|
<FormControlLabel
|
|
29
28
|
control={
|
|
30
29
|
<Checkbox
|
|
@@ -34,16 +33,16 @@ export default function VariantAnnotPanel({
|
|
|
34
33
|
}
|
|
35
34
|
label={<Typography variant="body2">Show options</Typography>}
|
|
36
35
|
/>
|
|
37
|
-
<div
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
<div ref={ref}>
|
|
37
|
+
<ResizeBar
|
|
38
|
+
widths={widths}
|
|
39
|
+
setWidths={setWidths}
|
|
40
|
+
scrollLeft={scrollLeft}
|
|
41
|
+
/>
|
|
43
42
|
<DataGrid
|
|
44
|
-
rowHeight={
|
|
43
|
+
rowHeight={25}
|
|
45
44
|
rows={rows}
|
|
46
|
-
columns={columns}
|
|
45
|
+
columns={columns.map((c, i) => ({ ...c, width: widths[i] }))}
|
|
47
46
|
slots={{ toolbar: checked ? GridToolbar : null }}
|
|
48
47
|
/>
|
|
49
48
|
</div>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { BaseCard } from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail'
|
|
3
|
+
import AnnotGrid from './AnnotGrid'
|
|
4
|
+
|
|
5
|
+
export default function VariantAnnotationTable({
|
|
6
|
+
data,
|
|
7
|
+
fields,
|
|
8
|
+
title,
|
|
9
|
+
}: {
|
|
10
|
+
data: string[]
|
|
11
|
+
fields: string[]
|
|
12
|
+
title: string
|
|
13
|
+
}) {
|
|
14
|
+
return data.length ? (
|
|
15
|
+
<BaseCard title={title}>
|
|
16
|
+
<AnnotGrid
|
|
17
|
+
rows={
|
|
18
|
+
data.map((elt, id) => ({
|
|
19
|
+
id,
|
|
20
|
+
...Object.fromEntries(elt.split('|').map((e, i) => [fields[i], e])),
|
|
21
|
+
})) || []
|
|
22
|
+
}
|
|
23
|
+
columns={fields.map(c => ({ field: c }))}
|
|
24
|
+
/>
|
|
25
|
+
</BaseCard>
|
|
26
|
+
) : null
|
|
27
|
+
}
|