@jbrowse/plugin-wiggle 3.6.4 → 3.7.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/CreateMultiWiggleExtension/ConfirmDialog.js +1 -1
- package/dist/CreateMultiWiggleExtension/index.js +1 -1
- package/dist/LinearWiggleDisplay/model.d.ts +17 -2
- package/dist/MultiLinearWiggleDisplay/components/ColorLegend.js +2 -1
- package/dist/MultiLinearWiggleDisplay/components/LegendItem.js +1 -3
- package/dist/MultiLinearWiggleDisplay/components/LegendItemText.d.ts +10 -0
- package/dist/MultiLinearWiggleDisplay/components/LegendItemText.js +13 -0
- package/dist/MultiLinearWiggleDisplay/components/SetColorDialog.js +2 -32
- package/dist/MultiLinearWiggleDisplay/components/SourcesGrid.js +1 -1
- package/dist/MultiLinearWiggleDisplay/components/Tooltip.js +10 -6
- package/dist/MultiLinearWiggleDisplay/components/WiggleClusterDialog/WiggleClusterDialogAuto.js +11 -3
- package/dist/MultiLinearWiggleDisplay/components/WiggleClusterDialog/WiggleClusterDialogManual.js +14 -6
- package/dist/MultiLinearWiggleDisplay/components/WiggleClusterDialog/types.d.ts +2 -1
- package/dist/MultiLinearWiggleDisplay/components/ui/SetColorDialog.d.ts +31 -0
- package/dist/MultiLinearWiggleDisplay/components/ui/SetColorDialog.js +51 -0
- package/dist/MultiLinearWiggleDisplay/components/ui/SetColorDialogBulkEditPanel.d.ts +10 -0
- package/dist/MultiLinearWiggleDisplay/components/ui/SetColorDialogBulkEditPanel.js +84 -0
- package/dist/MultiLinearWiggleDisplay/components/ui/SetColorDialogHelpfulTips.d.ts +1 -0
- package/dist/MultiLinearWiggleDisplay/components/ui/SetColorDialogHelpfulTips.js +7 -0
- package/dist/MultiLinearWiggleDisplay/components/ui/SetColorDialogRowPalettizer.d.ts +10 -0
- package/dist/MultiLinearWiggleDisplay/components/ui/SetColorDialogRowPalettizer.js +42 -0
- package/dist/MultiLinearWiggleDisplay/components/util.d.ts +4 -8
- package/dist/MultiLinearWiggleDisplay/model.d.ts +19 -2
- package/dist/MultiLinearWiggleDisplay/model.js +2 -2
- package/dist/MultiLinearWiggleDisplay/types.d.ts +1 -0
- package/dist/MultiLinearWiggleDisplay/util.d.ts +0 -1
- package/dist/MultiLinearWiggleDisplay/util.js +0 -9
- package/dist/MultiWiggleAdapter/MultiWiggleAdapter.d.ts +2 -1
- package/dist/MultiWiggleAdapter/MultiWiggleAdapter.js +36 -11
- package/dist/MultiWiggleAddTrackWorkflow/AddTrackWorkflow.js +1 -1
- package/dist/getMultiWiggleSourcesAutorun.d.ts +1 -0
- package/dist/shared/SharedWiggleMixin.d.ts +17 -2
- package/dist/util.d.ts +1 -0
- package/dist/util.js +1 -1
- package/esm/CreateMultiWiggleExtension/ConfirmDialog.js +1 -1
- package/esm/CreateMultiWiggleExtension/index.js +1 -1
- package/esm/LinearWiggleDisplay/model.d.ts +17 -2
- package/esm/MultiLinearWiggleDisplay/components/ColorLegend.js +2 -1
- package/esm/MultiLinearWiggleDisplay/components/LegendItem.js +1 -3
- package/esm/MultiLinearWiggleDisplay/components/LegendItemText.d.ts +10 -0
- package/esm/MultiLinearWiggleDisplay/components/LegendItemText.js +11 -0
- package/esm/MultiLinearWiggleDisplay/components/SetColorDialog.js +3 -33
- package/esm/MultiLinearWiggleDisplay/components/SourcesGrid.js +1 -1
- package/esm/MultiLinearWiggleDisplay/components/Tooltip.js +10 -6
- package/esm/MultiLinearWiggleDisplay/components/WiggleClusterDialog/WiggleClusterDialogAuto.js +11 -3
- package/esm/MultiLinearWiggleDisplay/components/WiggleClusterDialog/WiggleClusterDialogManual.js +14 -6
- package/esm/MultiLinearWiggleDisplay/components/WiggleClusterDialog/types.d.ts +2 -1
- package/esm/MultiLinearWiggleDisplay/components/ui/SetColorDialog.d.ts +31 -0
- package/esm/MultiLinearWiggleDisplay/components/ui/SetColorDialog.js +45 -0
- package/esm/MultiLinearWiggleDisplay/components/ui/SetColorDialogBulkEditPanel.d.ts +10 -0
- package/esm/MultiLinearWiggleDisplay/components/ui/SetColorDialogBulkEditPanel.js +81 -0
- package/esm/MultiLinearWiggleDisplay/components/ui/SetColorDialogHelpfulTips.d.ts +1 -0
- package/esm/MultiLinearWiggleDisplay/components/ui/SetColorDialogHelpfulTips.js +4 -0
- package/esm/MultiLinearWiggleDisplay/components/ui/SetColorDialogRowPalettizer.d.ts +10 -0
- package/esm/MultiLinearWiggleDisplay/components/ui/SetColorDialogRowPalettizer.js +39 -0
- package/esm/MultiLinearWiggleDisplay/components/util.d.ts +4 -8
- package/esm/MultiLinearWiggleDisplay/model.d.ts +19 -2
- package/esm/MultiLinearWiggleDisplay/model.js +2 -2
- package/esm/MultiLinearWiggleDisplay/types.d.ts +1 -0
- package/esm/MultiLinearWiggleDisplay/util.d.ts +0 -1
- package/esm/MultiLinearWiggleDisplay/util.js +1 -7
- package/esm/MultiWiggleAdapter/MultiWiggleAdapter.d.ts +2 -1
- package/esm/MultiWiggleAdapter/MultiWiggleAdapter.js +36 -11
- package/esm/MultiWiggleAddTrackWorkflow/AddTrackWorkflow.js +1 -1
- package/esm/getMultiWiggleSourcesAutorun.d.ts +1 -0
- package/esm/shared/SharedWiggleMixin.d.ts +17 -2
- package/esm/util.d.ts +1 -0
- package/esm/util.js +1 -1
- package/package.json +5 -5
- package/dist/WiggleRPC/type.d.ts +0 -0
- package/dist/WiggleRPC/type.js +0 -1
- package/esm/WiggleRPC/type.d.ts +0 -0
- package/esm/WiggleRPC/type.js +0 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import DraggableDialog from '@jbrowse/core/ui/DraggableDialog';
|
|
4
|
+
import { useLocalStorage } from '@jbrowse/core/util';
|
|
5
|
+
import { Button, DialogActions, DialogContent } from '@mui/material';
|
|
6
|
+
import { makeStyles } from 'tss-react/mui';
|
|
7
|
+
import SetColorDialogBulkEditPanel from './SetColorDialogBulkEditPanel';
|
|
8
|
+
import SetColorDialogHelpfulTips from './SetColorDialogHelpfulTips';
|
|
9
|
+
import SetColorDialogRowPalettizer from './SetColorDialogRowPalettizer';
|
|
10
|
+
const useStyles = makeStyles()({
|
|
11
|
+
content: {
|
|
12
|
+
minWidth: 800,
|
|
13
|
+
},
|
|
14
|
+
fr: {
|
|
15
|
+
float: 'right',
|
|
16
|
+
display: 'flex',
|
|
17
|
+
gap: 8,
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
export default function SetColorDialog({ model, handleClose, title = 'Color/arrangement editor', enableBulkEdit = false, enableRowPalettizer = false, showTipsStorageKey = 'setColorDialog-showTips', SourcesGridComponent, }) {
|
|
21
|
+
const { classes } = useStyles();
|
|
22
|
+
const { sources } = model;
|
|
23
|
+
const [showBulkEditor, setShowBulkEditor] = useState(false);
|
|
24
|
+
const [currLayout, setCurrLayout] = useState(structuredClone(sources || []));
|
|
25
|
+
const [showTips, setShowTips] = useLocalStorage(showTipsStorageKey, false);
|
|
26
|
+
return (_jsx(DraggableDialog, { open: true, onClose: handleClose, maxWidth: "xl", title: title, children: showBulkEditor && enableBulkEdit ? (_jsx(SetColorDialogBulkEditPanel, { currLayout: currLayout, onClose: arg => {
|
|
27
|
+
if (arg) {
|
|
28
|
+
setCurrLayout(arg);
|
|
29
|
+
}
|
|
30
|
+
setShowBulkEditor(false);
|
|
31
|
+
} })) : (_jsxs(_Fragment, { children: [_jsxs(DialogContent, { className: classes.content, children: [_jsxs("div", { className: classes.fr, children: [_jsx(Button, { variant: "contained", onClick: () => {
|
|
32
|
+
setShowTips(!showTips);
|
|
33
|
+
}, children: showTips ? 'Hide tips' : 'Show tips' }), enableBulkEdit ? (_jsx(Button, { color: "secondary", variant: "contained", onClick: () => {
|
|
34
|
+
setShowBulkEditor(!showBulkEditor);
|
|
35
|
+
}, children: "Show Bulk row editor" })) : null] }), showTips ? _jsx(SetColorDialogHelpfulTips, {}) : null, enableRowPalettizer ? (_jsxs(_Fragment, { children: [_jsx("br", {}), _jsx(SetColorDialogRowPalettizer, { currLayout: currLayout, setCurrLayout: setCurrLayout })] })) : null, _jsx(SourcesGridComponent, { rows: currLayout, onChange: setCurrLayout, showTips: showTips })] }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "contained", type: "submit", color: "inherit", onClick: () => {
|
|
36
|
+
model.clearLayout();
|
|
37
|
+
setCurrLayout(model.sources || []);
|
|
38
|
+
}, children: "Clear custom settings" }), _jsx(Button, { variant: "contained", color: "secondary", onClick: () => {
|
|
39
|
+
handleClose();
|
|
40
|
+
setCurrLayout([...(model.sources || [])]);
|
|
41
|
+
}, children: "Cancel" }), _jsx(Button, { variant: "contained", color: "primary", type: "submit", onClick: () => {
|
|
42
|
+
model.setLayout(currLayout);
|
|
43
|
+
handleClose();
|
|
44
|
+
}, children: "Submit" })] })] })) }));
|
|
45
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default function SetColorDialogBulkEditPanel({ onClose, currLayout, }: {
|
|
2
|
+
currLayout: {
|
|
3
|
+
name: string;
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
}[];
|
|
6
|
+
onClose: (arg?: {
|
|
7
|
+
name: string;
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
}[]) => void;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { ErrorMessage } from '@jbrowse/core/ui';
|
|
4
|
+
import { Button, DialogActions, DialogContent, TextField, Typography, } from '@mui/material';
|
|
5
|
+
import { makeStyles } from 'tss-react/mui';
|
|
6
|
+
const useStyles = makeStyles()({
|
|
7
|
+
textAreaFont: {
|
|
8
|
+
fontFamily: 'Courier New',
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
export default function SetColorDialogBulkEditPanel({ onClose, currLayout, }) {
|
|
12
|
+
const { classes } = useStyles();
|
|
13
|
+
const [val, setVal] = useState('');
|
|
14
|
+
const [error, setError] = useState();
|
|
15
|
+
return (_jsxs(_Fragment, { children: [_jsxs(DialogContent, { children: [_jsx(Typography, { children: "Paste CSV or TSV. If a header column is present. First line is a header. If a column called \"name\" is present, it uses that to connect to IDs in the table, otherwise it uses the first column no." }), error ? _jsx(ErrorMessage, { error: error }) : null, _jsx(TextField, { variant: "outlined", multiline: true, minRows: 5, placeholder: 'name,population\nHG00098,GBR\nHG00101,GBR\nHG00459,CHS\n...', maxRows: 10, fullWidth: true, value: val, onChange: event => {
|
|
16
|
+
setVal(event.target.value);
|
|
17
|
+
}, slotProps: {
|
|
18
|
+
input: {
|
|
19
|
+
classes: {
|
|
20
|
+
input: classes.textAreaFont,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
} })] }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "contained", color: "secondary", onClick: () => {
|
|
24
|
+
const lines = val
|
|
25
|
+
.split('\n')
|
|
26
|
+
.map(f => f.trim())
|
|
27
|
+
.filter(f => !!f);
|
|
28
|
+
const fields = lines[0].split(/[,\t]/gm);
|
|
29
|
+
if (fields.includes('name')) {
|
|
30
|
+
setError('');
|
|
31
|
+
const oldLayout = Object.fromEntries(currLayout.map(record => [record.name, record]));
|
|
32
|
+
const newData = Object.fromEntries(lines.slice(1).map(line => {
|
|
33
|
+
const cols = line.split(/[,\t]/gm);
|
|
34
|
+
const newRecord = Object.fromEntries(cols.map((col, idx) => [fields[idx], col]));
|
|
35
|
+
return [
|
|
36
|
+
newRecord.name,
|
|
37
|
+
{
|
|
38
|
+
...newRecord,
|
|
39
|
+
...oldLayout[newRecord.name],
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
}));
|
|
43
|
+
onClose(currLayout.map(record => ({
|
|
44
|
+
...record,
|
|
45
|
+
...newData[record.name],
|
|
46
|
+
})));
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
setError(new Error('No "name" column found on line 1'));
|
|
50
|
+
}
|
|
51
|
+
}, children: "Update rows" }), _jsx(Button, { variant: "contained", color: "primary", onClick: () => {
|
|
52
|
+
const lines = val
|
|
53
|
+
.split('\n')
|
|
54
|
+
.map(f => f.trim())
|
|
55
|
+
.filter(f => !!f);
|
|
56
|
+
const fields = lines[0].split(/[,\t]/gm);
|
|
57
|
+
if (fields.includes('name')) {
|
|
58
|
+
setError('');
|
|
59
|
+
const oldLayout = Object.fromEntries(currLayout.map(record => [record.name, record]));
|
|
60
|
+
const newData = Object.fromEntries(lines.slice(1).map(line => {
|
|
61
|
+
const cols = line.split(/[,\t]/gm);
|
|
62
|
+
const newRecord = Object.fromEntries(cols.map((col, idx) => [fields[idx], col]));
|
|
63
|
+
return [
|
|
64
|
+
newRecord.name,
|
|
65
|
+
{
|
|
66
|
+
...newRecord,
|
|
67
|
+
...oldLayout[newRecord.name],
|
|
68
|
+
},
|
|
69
|
+
];
|
|
70
|
+
}));
|
|
71
|
+
onClose(currLayout.map(record => ({
|
|
72
|
+
...newData[record.name],
|
|
73
|
+
})));
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
setError(new Error('No "name" column found on line 1'));
|
|
77
|
+
}
|
|
78
|
+
}, children: "Replace rows" }), _jsx(Button, { variant: "contained", color: "inherit", onClick: () => {
|
|
79
|
+
onClose();
|
|
80
|
+
}, children: "Cancel" })] })] }));
|
|
81
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function SetColorDialogHelpfulTips(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
export default function SetColorDialogHelpfulTips() {
|
|
3
|
+
return (_jsxs(_Fragment, { children: ["Helpful tips", _jsxs("ul", { children: [_jsx("li", { children: "You can select rows in the table with the checkboxes" }), _jsx("li", { children: "Multi-select is enabled with shift-click and control-click" }), _jsx("li", { children: "The \"Move selected items up/down\" can re-arrange subtracks" }), _jsx("li", { children: "Sorting the data grid itself can also re-arrange subtracks" }), _jsx("li", { children: "Changes are applied when you hit Submit" }), _jsx("li", { children: "You can click and drag the dialog box to move it on the screen" }), _jsx("li", { children: "Columns in the table can be hidden using a vertical '...' menu on the right side of each column" })] })] }));
|
|
4
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default function SetColorDialogRowPalettizer({ setCurrLayout, currLayout, }: {
|
|
2
|
+
currLayout: {
|
|
3
|
+
name: string;
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
}[];
|
|
6
|
+
setCurrLayout: (arg: {
|
|
7
|
+
name: string;
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
}[]) => void;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { set1 } from '@jbrowse/core/ui/colors';
|
|
3
|
+
import { randomColor } from '@jbrowse/core/util/color';
|
|
4
|
+
import { Button } from '@mui/material';
|
|
5
|
+
export default function SetColorDialogRowPalettizer({ setCurrLayout, currLayout, }) {
|
|
6
|
+
if (!currLayout.length || !currLayout[0]) {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
const fields = Object.keys(currLayout[0]).filter(f => f !== 'name' &&
|
|
10
|
+
f !== 'color' &&
|
|
11
|
+
f !== 'source' &&
|
|
12
|
+
f !== 'label' &&
|
|
13
|
+
f !== 'id' &&
|
|
14
|
+
f !== 'HP');
|
|
15
|
+
return (_jsxs("div", { children: ["Create color palette based on...", fields.map(r => (_jsx(Button, { variant: "contained", color: "inherit", onClick: () => {
|
|
16
|
+
const map = new Map();
|
|
17
|
+
for (const row of currLayout) {
|
|
18
|
+
const val = map.get(row[r]);
|
|
19
|
+
if (!val) {
|
|
20
|
+
map.set(row[r], 1);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
map.set(row[r], val + 1);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const ret = Object.fromEntries([...map.entries()]
|
|
27
|
+
.sort((a, b) => a[1] - b[1])
|
|
28
|
+
.map((r, idx) => [r[0], set1[idx] || randomColor(r[0])]));
|
|
29
|
+
setCurrLayout(currLayout.map(row => ({
|
|
30
|
+
...row,
|
|
31
|
+
color: ret[row[r]],
|
|
32
|
+
})));
|
|
33
|
+
}, children: r }, r))), _jsx(Button, { onClick: () => {
|
|
34
|
+
setCurrLayout(currLayout.map(row => ({
|
|
35
|
+
...row,
|
|
36
|
+
color: undefined,
|
|
37
|
+
})));
|
|
38
|
+
}, children: "Clear colors" })] }));
|
|
39
|
+
}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import type { WiggleDisplayModel } from '../model';
|
|
2
2
|
import type { GridRowId } from '@mui/x-data-grid';
|
|
3
|
-
export declare function moveUp
|
|
3
|
+
export declare function moveUp<T extends {
|
|
4
4
|
name: string;
|
|
5
|
-
}[], sel: GridRowId[], by?: number):
|
|
5
|
+
}>(arr: T[], sel: GridRowId[], by?: number): T[];
|
|
6
|
+
export declare function moveDown<T extends {
|
|
6
7
|
name: string;
|
|
7
|
-
}[];
|
|
8
|
-
export declare function moveDown(arr: {
|
|
9
|
-
name: string;
|
|
10
|
-
}[], sel: GridRowId[], by?: number): {
|
|
11
|
-
name: string;
|
|
12
|
-
}[];
|
|
8
|
+
}>(arr: T[], sel: GridRowId[], by?: number): T[];
|
|
13
9
|
export declare function getOffset(model: WiggleDisplayModel): number;
|
|
@@ -195,6 +195,7 @@ export declare function stateModelFactory(_pluginManager: PluginManager, configS
|
|
|
195
195
|
regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features";
|
|
196
196
|
regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): import("react/jsx-runtime").JSX.Element | null;
|
|
197
197
|
} & {
|
|
198
|
+
mouseoverExtraInformation: string | undefined;
|
|
198
199
|
featureIdUnderMouse: undefined | string;
|
|
199
200
|
contextMenuFeature: undefined | Feature;
|
|
200
201
|
} & {
|
|
@@ -209,9 +210,22 @@ export declare function stateModelFactory(_pluginManager: PluginManager, configS
|
|
|
209
210
|
} & {
|
|
210
211
|
readonly features: import("@jbrowse/core/util/compositeMap").default<string, Feature>;
|
|
211
212
|
readonly featureUnderMouse: Feature | undefined;
|
|
213
|
+
readonly layoutFeatures: import("@jbrowse/core/util/compositeMap").default<string, [number, number, number, number] | [number, number, number, number, {
|
|
214
|
+
label?: string;
|
|
215
|
+
description?: string;
|
|
216
|
+
refName: string;
|
|
217
|
+
}]>;
|
|
212
218
|
getFeatureOverlapping(blockKey: string, x: number, y: number): string | undefined;
|
|
213
|
-
getFeatureByID(blockKey: string, id: string): [number, number, number, number] |
|
|
214
|
-
|
|
219
|
+
getFeatureByID(blockKey: string, id: string): ([number, number, number, number] | [number, number, number, number, {
|
|
220
|
+
label?: string;
|
|
221
|
+
description?: string;
|
|
222
|
+
refName: string;
|
|
223
|
+
}]) | undefined;
|
|
224
|
+
searchFeatureByID(id: string): ([number, number, number, number] | [number, number, number, number, {
|
|
225
|
+
label?: string;
|
|
226
|
+
description?: string;
|
|
227
|
+
refName: string;
|
|
228
|
+
}]) | undefined;
|
|
215
229
|
} & {
|
|
216
230
|
addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
|
|
217
231
|
deleteBlock(key: string): void;
|
|
@@ -220,6 +234,7 @@ export declare function stateModelFactory(_pluginManager: PluginManager, configS
|
|
|
220
234
|
clearFeatureSelection(): void;
|
|
221
235
|
setFeatureIdUnderMouse(feature?: string): void;
|
|
222
236
|
setContextMenuFeature(feature?: Feature): void;
|
|
237
|
+
setMouseoverExtraInformation(extra?: string): void;
|
|
223
238
|
} & {
|
|
224
239
|
reload(): Promise<void>;
|
|
225
240
|
} & {
|
|
@@ -351,12 +366,14 @@ export declare function stateModelFactory(_pluginManager: PluginManager, configS
|
|
|
351
366
|
color: string;
|
|
352
367
|
baseUri?: string;
|
|
353
368
|
name: string;
|
|
369
|
+
source: string;
|
|
354
370
|
group?: string;
|
|
355
371
|
}[] | undefined;
|
|
356
372
|
readonly sources: {
|
|
357
373
|
color: string;
|
|
358
374
|
baseUri?: string;
|
|
359
375
|
name: string;
|
|
376
|
+
source: string;
|
|
360
377
|
group?: string;
|
|
361
378
|
}[] | undefined;
|
|
362
379
|
readonly quantitativeStatsReady: boolean;
|
|
@@ -198,10 +198,10 @@ export function stateModelFactory(_pluginManager, configSchema) {
|
|
|
198
198
|
})
|
|
199
199
|
.views(self => ({
|
|
200
200
|
get legendFontSize() {
|
|
201
|
-
return Math.min(self.rowHeight,
|
|
201
|
+
return Math.min(self.rowHeight, 8);
|
|
202
202
|
},
|
|
203
203
|
get canDisplayLegendLabels() {
|
|
204
|
-
return self.rowHeight >
|
|
204
|
+
return self.rowHeight > 7;
|
|
205
205
|
},
|
|
206
206
|
get labelWidth() {
|
|
207
207
|
var _a;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function randomColor(str: string): string;
|
|
@@ -8,6 +8,7 @@ interface WiggleOptions extends BaseOptions {
|
|
|
8
8
|
interface AdapterEntry {
|
|
9
9
|
dataAdapter: BaseFeatureDataAdapter;
|
|
10
10
|
source: string;
|
|
11
|
+
name: string;
|
|
11
12
|
[key: string]: unknown;
|
|
12
13
|
}
|
|
13
14
|
export default class MultiWiggleAdapter extends BaseFeatureDataAdapter {
|
|
@@ -24,7 +25,7 @@ export default class MultiWiggleAdapter extends BaseFeatureDataAdapter {
|
|
|
24
25
|
}>;
|
|
25
26
|
getSources(_regions: Region[]): Promise<{
|
|
26
27
|
name: string;
|
|
27
|
-
|
|
28
|
+
source: string;
|
|
28
29
|
}[]>;
|
|
29
30
|
}
|
|
30
31
|
export {};
|
|
@@ -7,6 +7,27 @@ function getFilename(uri) {
|
|
|
7
7
|
const filename = uri.slice(uri.lastIndexOf('/') + 1);
|
|
8
8
|
return filename.slice(0, filename.lastIndexOf('.'));
|
|
9
9
|
}
|
|
10
|
+
function getFilenameFromAdapterConfig(config) {
|
|
11
|
+
try {
|
|
12
|
+
if (config.type === 'BigWigAdapter' && config.bigWigLocation) {
|
|
13
|
+
const location = config.bigWigLocation;
|
|
14
|
+
if ('uri' in location && location.uri) {
|
|
15
|
+
return getFilename(location.uri);
|
|
16
|
+
}
|
|
17
|
+
if ('localPath' in location && location.localPath) {
|
|
18
|
+
return getFilename(location.localPath);
|
|
19
|
+
}
|
|
20
|
+
if ('blob' in location && location.blob) {
|
|
21
|
+
const blob = location.blob;
|
|
22
|
+
return blob.name ? getFilename(blob.name) : undefined;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
catch (e) {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
10
31
|
class MultiWiggleAdapter extends BaseFeatureDataAdapter {
|
|
11
32
|
async getAdapters() {
|
|
12
33
|
const getSubAdapter = this.getSubAdapter;
|
|
@@ -24,15 +45,20 @@ class MultiWiggleAdapter extends BaseFeatureDataAdapter {
|
|
|
24
45
|
},
|
|
25
46
|
}));
|
|
26
47
|
}
|
|
27
|
-
|
|
48
|
+
const ret = await Promise.all(subConfs.map(async (conf) => {
|
|
28
49
|
const dataAdapter = (await getSubAdapter(conf))
|
|
29
50
|
.dataAdapter;
|
|
51
|
+
const source = conf.source ||
|
|
52
|
+
conf.name ||
|
|
53
|
+
getFilenameFromAdapterConfig(conf) ||
|
|
54
|
+
dataAdapter.id;
|
|
30
55
|
return {
|
|
31
|
-
source: conf.name || dataAdapter.id,
|
|
32
56
|
...conf,
|
|
33
57
|
dataAdapter,
|
|
58
|
+
source,
|
|
34
59
|
};
|
|
35
60
|
}));
|
|
61
|
+
return ret;
|
|
36
62
|
}
|
|
37
63
|
async getRefNames(opts) {
|
|
38
64
|
const adapters = await this.getAdapters();
|
|
@@ -42,11 +68,9 @@ class MultiWiggleAdapter extends BaseFeatureDataAdapter {
|
|
|
42
68
|
async getGlobalStats(opts) {
|
|
43
69
|
const adapters = await this.getAdapters();
|
|
44
70
|
const stats = (await Promise.all(adapters.map(adp => { var _a, _b; return (_b = (_a = adp.dataAdapter).getGlobalStats) === null || _b === void 0 ? void 0 : _b.call(_a, opts); }))).filter(f => !!f);
|
|
45
|
-
const scoreMin = min(stats.map(s => s.scoreMin));
|
|
46
|
-
const scoreMax = max(stats.map(s => s.scoreMax));
|
|
47
71
|
return {
|
|
48
|
-
scoreMin,
|
|
49
|
-
scoreMax,
|
|
72
|
+
scoreMin: min(stats.map(s => s.scoreMin)),
|
|
73
|
+
scoreMax: max(stats.map(s => s.scoreMax)),
|
|
50
74
|
};
|
|
51
75
|
}
|
|
52
76
|
getFeatures(region, opts = {}) {
|
|
@@ -68,11 +92,12 @@ class MultiWiggleAdapter extends BaseFeatureDataAdapter {
|
|
|
68
92
|
}
|
|
69
93
|
async getSources(_regions) {
|
|
70
94
|
const adapters = await this.getAdapters();
|
|
71
|
-
return adapters.map(({
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
95
|
+
return adapters.map(({ type, bigWigLocation, dataAdapter, ...rest }) => {
|
|
96
|
+
return {
|
|
97
|
+
...rest,
|
|
98
|
+
name: rest.source,
|
|
99
|
+
};
|
|
100
|
+
});
|
|
76
101
|
}
|
|
77
102
|
}
|
|
78
103
|
MultiWiggleAdapter.capabilities = [
|
|
@@ -69,7 +69,7 @@ function doSubmit({ trackName, val, model, }) {
|
|
|
69
69
|
const MultiWiggleAddTrackWorkflow = observer(function ({ model, }) {
|
|
70
70
|
const { classes } = useStyles();
|
|
71
71
|
const [val, setVal] = useState('');
|
|
72
|
-
const [trackName, setTrackName] = useState(`MultiWiggle${
|
|
72
|
+
const [trackName, setTrackName] = useState(`MultiWiggle${Date.now()}`);
|
|
73
73
|
return (_jsxs(Paper, { className: classes.paper, children: [_jsxs("ul", { children: [_jsx("li", { children: "Enter list of URLs for bigwig files in the textbox" }), _jsx("li", { children: "Or, use the button below the text box to select files from your computer" })] }), _jsx(TextField, { multiline: true, fullWidth: true, rows: 10, value: val, placeholder: "Paste list of URLs here, or use file selector below", variant: "outlined", onChange: event => {
|
|
74
74
|
setVal(event.target.value);
|
|
75
75
|
} }), _jsxs(Button, { variant: "outlined", component: "label", children: ["Choose Files from your computer", _jsx("input", { type: "file", hidden: true, multiple: true, onChange: ({ target }) => {
|
|
@@ -187,6 +187,7 @@ export default function SharedWiggleMixin(configSchema: AnyConfigurationSchemaTy
|
|
|
187
187
|
regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features";
|
|
188
188
|
regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): import("react/jsx-runtime").JSX.Element | null;
|
|
189
189
|
} & {
|
|
190
|
+
mouseoverExtraInformation: string | undefined;
|
|
190
191
|
featureIdUnderMouse: undefined | string;
|
|
191
192
|
contextMenuFeature: undefined | Feature;
|
|
192
193
|
} & {
|
|
@@ -201,9 +202,22 @@ export default function SharedWiggleMixin(configSchema: AnyConfigurationSchemaTy
|
|
|
201
202
|
} & {
|
|
202
203
|
readonly features: import("@jbrowse/core/util/compositeMap").default<string, Feature>;
|
|
203
204
|
readonly featureUnderMouse: Feature | undefined;
|
|
205
|
+
readonly layoutFeatures: import("@jbrowse/core/util/compositeMap").default<string, [number, number, number, number] | [number, number, number, number, {
|
|
206
|
+
label?: string;
|
|
207
|
+
description?: string;
|
|
208
|
+
refName: string;
|
|
209
|
+
}]>;
|
|
204
210
|
getFeatureOverlapping(blockKey: string, x: number, y: number): string | undefined;
|
|
205
|
-
getFeatureByID(blockKey: string, id: string): [number, number, number, number] |
|
|
206
|
-
|
|
211
|
+
getFeatureByID(blockKey: string, id: string): ([number, number, number, number] | [number, number, number, number, {
|
|
212
|
+
label?: string;
|
|
213
|
+
description?: string;
|
|
214
|
+
refName: string;
|
|
215
|
+
}]) | undefined;
|
|
216
|
+
searchFeatureByID(id: string): ([number, number, number, number] | [number, number, number, number, {
|
|
217
|
+
label?: string;
|
|
218
|
+
description?: string;
|
|
219
|
+
refName: string;
|
|
220
|
+
}]) | undefined;
|
|
207
221
|
} & {
|
|
208
222
|
addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
|
|
209
223
|
deleteBlock(key: string): void;
|
|
@@ -212,6 +226,7 @@ export default function SharedWiggleMixin(configSchema: AnyConfigurationSchemaTy
|
|
|
212
226
|
clearFeatureSelection(): void;
|
|
213
227
|
setFeatureIdUnderMouse(feature?: string): void;
|
|
214
228
|
setContextMenuFeature(feature?: Feature): void;
|
|
229
|
+
setMouseoverExtraInformation(extra?: string): void;
|
|
215
230
|
} & {
|
|
216
231
|
reload(): Promise<void>;
|
|
217
232
|
} & {
|
package/esm/util.d.ts
CHANGED
package/esm/util.js
CHANGED
|
@@ -75,7 +75,7 @@ export function getNiceDomain({ scaleType, domain, bounds, }) {
|
|
|
75
75
|
return scale.domain();
|
|
76
76
|
}
|
|
77
77
|
export function toP(s = 0) {
|
|
78
|
-
return +
|
|
78
|
+
return +s.toPrecision(6);
|
|
79
79
|
}
|
|
80
80
|
export function round(value) {
|
|
81
81
|
return Math.round(value * 1e5) / 1e5;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-wiggle",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.0",
|
|
4
4
|
"description": "JBrowse 2 wiggle adapters, tracks, etc.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@gmod/bbi": "^7.0.0",
|
|
40
|
-
"@jbrowse/core": "^3.
|
|
41
|
-
"@jbrowse/plugin-data-management": "^3.
|
|
42
|
-
"@jbrowse/plugin-linear-genome-view": "^3.
|
|
40
|
+
"@jbrowse/core": "^3.7.0",
|
|
41
|
+
"@jbrowse/plugin-data-management": "^3.7.0",
|
|
42
|
+
"@jbrowse/plugin-linear-genome-view": "^3.7.0",
|
|
43
43
|
"@mui/icons-material": "^7.0.0",
|
|
44
44
|
"@mui/material": "^7.0.0",
|
|
45
45
|
"@mui/x-charts-vendor": "^8.0.0",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"distModule": "esm/index.js",
|
|
63
63
|
"srcModule": "src/index.ts",
|
|
64
64
|
"module": "esm/index.js",
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "85bdd0d58286b7adbfd408146b15847676317635"
|
|
66
66
|
}
|
package/dist/WiggleRPC/type.d.ts
DELETED
|
File without changes
|
package/dist/WiggleRPC/type.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
package/esm/WiggleRPC/type.d.ts
DELETED
|
File without changes
|
package/esm/WiggleRPC/type.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|