@jbrowse/plugin-linear-comparative-view 2.18.0 → 3.0.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/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.d.ts +6 -5
- package/dist/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.js +36 -58
- package/dist/LGVSyntenyDisplay/components/util.d.ts +9 -6
- package/dist/LGVSyntenyDisplay/components/util.js +6 -12
- package/dist/LGVSyntenyDisplay/model.d.ts +21 -7
- package/dist/LGVSyntenyDisplay/model.js +19 -8
- package/dist/LinearComparativeView/components/Header.d.ts +1 -2
- package/dist/LinearComparativeView/components/Header.js +52 -81
- package/dist/LinearComparativeView/components/HeaderSearchBoxes.d.ts +1 -2
- package/dist/LinearComparativeView/components/HeaderSearchBoxes.js +2 -11
- package/dist/LinearComparativeView/components/LinearComparativeRenderArea.d.ts +1 -2
- package/dist/LinearComparativeView/components/LinearComparativeRenderArea.js +13 -21
- package/dist/LinearComparativeView/components/LinearComparativeView.d.ts +1 -2
- package/dist/LinearComparativeView/components/LinearComparativeView.js +2 -5
- package/dist/LinearComparativeView/components/Rubberband.d.ts +1 -2
- package/dist/LinearComparativeView/components/Rubberband.js +20 -51
- package/dist/LinearComparativeView/components/VerticalGuide.d.ts +1 -2
- package/dist/LinearComparativeView/components/VerticalGuide.js +4 -8
- package/dist/LinearComparativeView/index.js +17 -7
- package/dist/LinearComparativeView/model.d.ts +32 -28
- package/dist/LinearComparativeView/model.js +37 -8
- package/dist/LinearReadVsRef/LinearReadVsRef.d.ts +1 -2
- package/dist/LinearReadVsRef/LinearReadVsRef.js +5 -36
- package/dist/LinearReadVsRef/index.js +17 -7
- package/dist/LinearSyntenyDisplay/afterAttach.js +6 -3
- package/dist/LinearSyntenyDisplay/components/Component.d.ts +1 -2
- package/dist/LinearSyntenyDisplay/components/Component.js +9 -32
- package/dist/LinearSyntenyDisplay/components/LinearSyntenyRendering.d.ts +1 -2
- package/dist/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +89 -84
- package/dist/LinearSyntenyDisplay/components/SyntenyContextMenu.d.ts +1 -2
- package/dist/LinearSyntenyDisplay/components/SyntenyContextMenu.js +2 -5
- package/dist/LinearSyntenyDisplay/components/SyntenyTooltip.d.ts +1 -2
- package/dist/LinearSyntenyDisplay/components/SyntenyTooltip.js +2 -3
- package/dist/LinearSyntenyDisplay/index.js +17 -7
- package/dist/LinearSyntenyDisplay/model.js +17 -7
- package/dist/LinearSyntenyView/components/ExportSvgDialog.d.ts +1 -2
- package/dist/LinearSyntenyView/components/ExportSvgDialog.js +34 -73
- package/dist/LinearSyntenyView/components/Icons.d.ts +2 -3
- package/dist/LinearSyntenyView/components/Icons.js +3 -8
- package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +8 -0
- package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +130 -0
- package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyPreConfigured.d.ts +8 -0
- package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyPreConfigured.js +39 -0
- package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelectorArea.d.ts +7 -0
- package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelectorArea.js +22 -0
- package/dist/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.d.ts +1 -2
- package/dist/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.js +44 -143
- package/dist/LinearSyntenyView/components/ImportForm/doSubmit.d.ts +5 -0
- package/dist/LinearSyntenyView/components/ImportForm/doSubmit.js +43 -0
- package/dist/LinearSyntenyView/components/ImportForm/getAdapter.d.ts +117 -0
- package/dist/LinearSyntenyView/components/ImportForm/getAdapter.js +68 -0
- package/dist/LinearSyntenyView/components/LinearSyntenyView.d.ts +1 -2
- package/dist/LinearSyntenyView/components/LinearSyntenyView.js +20 -9
- package/dist/LinearSyntenyView/index.js +17 -7
- package/dist/LinearSyntenyView/model.d.ts +49 -30
- package/dist/LinearSyntenyView/model.js +57 -15
- package/dist/LinearSyntenyView/svgcomponents/SVGBackground.d.ts +1 -2
- package/dist/LinearSyntenyView/svgcomponents/SVGBackground.js +2 -5
- package/dist/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.d.ts +1 -2
- package/dist/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.js +2 -10
- package/dist/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +4 -16
- package/dist/LinearSyntenyView/types.d.ts +12 -0
- package/dist/LinearSyntenyView/types.js +2 -0
- package/dist/LinearSyntenyViewHelper/index.js +2 -2
- package/dist/SyntenyFeatureDetail/LinkToSyntenyView.d.ts +5 -0
- package/dist/SyntenyFeatureDetail/LinkToSyntenyView.js +87 -0
- package/dist/SyntenyFeatureDetail/SyntenyFeatureDetail.d.ts +2 -11
- package/dist/SyntenyFeatureDetail/SyntenyFeatureDetail.js +3 -79
- package/dist/SyntenyFeatureDetail/index.js +17 -7
- package/dist/SyntenyFeatureDetail/types.d.ts +9 -0
- package/dist/SyntenyFeatureDetail/types.js +2 -0
- package/esm/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.d.ts +6 -5
- package/esm/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.js +35 -34
- package/esm/LGVSyntenyDisplay/components/util.d.ts +9 -6
- package/esm/LGVSyntenyDisplay/components/util.js +6 -12
- package/esm/LGVSyntenyDisplay/model.d.ts +21 -7
- package/esm/LGVSyntenyDisplay/model.js +2 -1
- package/esm/LinearComparativeView/components/Header.d.ts +1 -2
- package/esm/LinearComparativeView/components/Header.js +52 -58
- package/esm/LinearComparativeView/components/HeaderSearchBoxes.d.ts +1 -2
- package/esm/LinearComparativeView/components/HeaderSearchBoxes.js +2 -8
- package/esm/LinearComparativeView/components/LinearComparativeRenderArea.d.ts +1 -2
- package/esm/LinearComparativeView/components/LinearComparativeRenderArea.js +13 -18
- package/esm/LinearComparativeView/components/LinearComparativeView.d.ts +1 -2
- package/esm/LinearComparativeView/components/LinearComparativeView.js +2 -5
- package/esm/LinearComparativeView/components/Rubberband.d.ts +1 -2
- package/esm/LinearComparativeView/components/Rubberband.js +20 -28
- package/esm/LinearComparativeView/components/VerticalGuide.d.ts +1 -2
- package/esm/LinearComparativeView/components/VerticalGuide.js +4 -5
- package/esm/LinearComparativeView/model.d.ts +32 -28
- package/esm/LinearComparativeView/model.js +21 -2
- package/esm/LinearReadVsRef/LinearReadVsRef.d.ts +1 -2
- package/esm/LinearReadVsRef/LinearReadVsRef.js +5 -13
- package/esm/LinearSyntenyDisplay/afterAttach.js +6 -3
- package/esm/LinearSyntenyDisplay/components/Component.d.ts +1 -2
- package/esm/LinearSyntenyDisplay/components/Component.js +9 -9
- package/esm/LinearSyntenyDisplay/components/LinearSyntenyRendering.d.ts +1 -2
- package/esm/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +72 -77
- package/esm/LinearSyntenyDisplay/components/SyntenyContextMenu.d.ts +1 -2
- package/esm/LinearSyntenyDisplay/components/SyntenyContextMenu.js +2 -2
- package/esm/LinearSyntenyDisplay/components/SyntenyTooltip.d.ts +1 -2
- package/esm/LinearSyntenyDisplay/components/SyntenyTooltip.js +2 -3
- package/esm/LinearSyntenyView/components/ExportSvgDialog.d.ts +1 -2
- package/esm/LinearSyntenyView/components/ExportSvgDialog.js +34 -50
- package/esm/LinearSyntenyView/components/Icons.d.ts +2 -3
- package/esm/LinearSyntenyView/components/Icons.js +3 -5
- package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +8 -0
- package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +125 -0
- package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyPreConfigured.d.ts +8 -0
- package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyPreConfigured.js +37 -0
- package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelectorArea.d.ts +7 -0
- package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelectorArea.js +16 -0
- package/esm/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.d.ts +1 -2
- package/esm/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.js +45 -121
- package/esm/LinearSyntenyView/components/ImportForm/doSubmit.d.ts +5 -0
- package/esm/LinearSyntenyView/components/ImportForm/doSubmit.js +40 -0
- package/esm/LinearSyntenyView/components/ImportForm/getAdapter.d.ts +117 -0
- package/esm/LinearSyntenyView/components/ImportForm/getAdapter.js +65 -0
- package/esm/LinearSyntenyView/components/LinearSyntenyView.d.ts +1 -2
- package/esm/LinearSyntenyView/components/LinearSyntenyView.js +3 -2
- package/esm/LinearSyntenyView/model.d.ts +49 -30
- package/esm/LinearSyntenyView/model.js +41 -9
- package/esm/LinearSyntenyView/svgcomponents/SVGBackground.d.ts +1 -2
- package/esm/LinearSyntenyView/svgcomponents/SVGBackground.js +2 -2
- package/esm/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.d.ts +1 -2
- package/esm/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.js +2 -7
- package/esm/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +4 -16
- package/esm/LinearSyntenyView/types.d.ts +12 -0
- package/esm/LinearSyntenyView/types.js +1 -0
- package/esm/LinearSyntenyViewHelper/index.js +2 -2
- package/esm/SyntenyFeatureDetail/LinkToSyntenyView.d.ts +5 -0
- package/esm/SyntenyFeatureDetail/LinkToSyntenyView.js +52 -0
- package/esm/SyntenyFeatureDetail/SyntenyFeatureDetail.d.ts +2 -11
- package/esm/SyntenyFeatureDetail/SyntenyFeatureDetail.js +4 -57
- package/esm/SyntenyFeatureDetail/types.d.ts +9 -0
- package/esm/SyntenyFeatureDetail/types.js +1 -0
- package/package.json +11 -11
- package/dist/LinearSyntenyView/components/ImportForm/AddCustomTrack.d.ts +0 -10
- package/dist/LinearSyntenyView/components/ImportForm/AddCustomTrack.js +0 -194
- package/dist/LinearSyntenyView/components/ImportForm/Spacer.d.ts +0 -2
- package/dist/LinearSyntenyView/components/ImportForm/Spacer.js +0 -10
- package/dist/LinearSyntenyView/components/ImportForm/TrackSelector.d.ts +0 -10
- package/dist/LinearSyntenyView/components/ImportForm/TrackSelector.js +0 -57
- package/dist/LinearSyntenyView/components/ImportForm/TrackSelectorUtil.d.ts +0 -14
- package/dist/LinearSyntenyView/components/ImportForm/TrackSelectorUtil.js +0 -52
- package/esm/LinearSyntenyView/components/ImportForm/AddCustomTrack.d.ts +0 -10
- package/esm/LinearSyntenyView/components/ImportForm/AddCustomTrack.js +0 -169
- package/esm/LinearSyntenyView/components/ImportForm/Spacer.d.ts +0 -2
- package/esm/LinearSyntenyView/components/ImportForm/Spacer.js +0 -4
- package/esm/LinearSyntenyView/components/ImportForm/TrackSelector.d.ts +0 -10
- package/esm/LinearSyntenyView/components/ImportForm/TrackSelector.js +0 -32
- package/esm/LinearSyntenyView/components/ImportForm/TrackSelectorUtil.d.ts +0 -14
- package/esm/LinearSyntenyView/components/ImportForm/TrackSelectorUtil.js +0 -23
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { ErrorMessage, FileSelector } from '@jbrowse/core/ui';
|
|
3
|
-
import { FormControlLabel, Grid, Paper, Radio, RadioGroup, Typography, } from '@mui/material';
|
|
4
|
-
import { observer } from 'mobx-react';
|
|
5
|
-
import { basename, extName, getName, stripGz } from './util';
|
|
6
|
-
function getAdapter({ radioOption, assembly1, assembly2, fileLocation, indexFileLocation, bed1Location, bed2Location, }) {
|
|
7
|
-
if (radioOption === '.paf') {
|
|
8
|
-
return {
|
|
9
|
-
type: 'PAFAdapter',
|
|
10
|
-
pafLocation: fileLocation,
|
|
11
|
-
queryAssembly: assembly1,
|
|
12
|
-
targetAssembly: assembly2,
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
else if (radioOption === '.out') {
|
|
16
|
-
return {
|
|
17
|
-
type: 'MashMapAdapter',
|
|
18
|
-
outLocation: fileLocation,
|
|
19
|
-
queryAssembly: assembly1,
|
|
20
|
-
targetAssembly: assembly2,
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
else if (radioOption === '.delta') {
|
|
24
|
-
return {
|
|
25
|
-
type: 'DeltaAdapter',
|
|
26
|
-
deltaLocation: fileLocation,
|
|
27
|
-
queryAssembly: assembly1,
|
|
28
|
-
targetAssembly: assembly2,
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
else if (radioOption === '.chain') {
|
|
32
|
-
return {
|
|
33
|
-
type: 'ChainAdapter',
|
|
34
|
-
chainLocation: fileLocation,
|
|
35
|
-
queryAssembly: assembly1,
|
|
36
|
-
targetAssembly: assembly2,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
else if (radioOption === '.anchors') {
|
|
40
|
-
return {
|
|
41
|
-
type: 'MCScanAnchorsAdapter',
|
|
42
|
-
mcscanAnchorsLocation: fileLocation,
|
|
43
|
-
bed1Location,
|
|
44
|
-
bed2Location,
|
|
45
|
-
assemblyNames: [assembly1, assembly2],
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
else if (radioOption === '.anchors.simple') {
|
|
49
|
-
return {
|
|
50
|
-
type: 'MCScanSimpleAnchorsAdapter',
|
|
51
|
-
mcscanSimpleAnchorsLocation: fileLocation,
|
|
52
|
-
bed1Location,
|
|
53
|
-
bed2Location,
|
|
54
|
-
assemblyNames: [assembly1, assembly2],
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
else if (radioOption === '.pif.gz') {
|
|
58
|
-
return {
|
|
59
|
-
type: 'PairwiseIndexedPAFAdapter',
|
|
60
|
-
pifGzLocation: fileLocation,
|
|
61
|
-
index: { location: indexFileLocation },
|
|
62
|
-
assemblyNames: [assembly1, assembly2],
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
throw new Error(`Unknown to detect type ${radioOption} from filename (select radio button to clarify)`);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
const ImportCustomTrack = observer(function ({ assembly1, assembly2, setUserOpenedSyntenyTrack, }) {
|
|
70
|
-
const [bed2Location, setBed2Location] = useState();
|
|
71
|
-
const [bed1Location, setBed1Location] = useState();
|
|
72
|
-
const [fileLocation, setFileLocation] = useState();
|
|
73
|
-
const [indexFileLocation, setIndexFileLocation] = useState();
|
|
74
|
-
const [value, setValue] = useState('');
|
|
75
|
-
const [error, setError] = useState();
|
|
76
|
-
const fileName = getName(fileLocation);
|
|
77
|
-
const radioOption = value || (fileName ? extName(stripGz(fileName)) : '');
|
|
78
|
-
useEffect(() => {
|
|
79
|
-
try {
|
|
80
|
-
if (fileLocation) {
|
|
81
|
-
const fn = fileName ? basename(fileName) : 'MyTrack';
|
|
82
|
-
const trackId = `${fn}-${Date.now()}`;
|
|
83
|
-
setError(undefined);
|
|
84
|
-
setUserOpenedSyntenyTrack({
|
|
85
|
-
trackId,
|
|
86
|
-
name: fn,
|
|
87
|
-
assemblyNames: [assembly2, assembly1],
|
|
88
|
-
type: 'SyntenyTrack',
|
|
89
|
-
adapter: getAdapter({
|
|
90
|
-
radioOption,
|
|
91
|
-
assembly1,
|
|
92
|
-
assembly2,
|
|
93
|
-
fileLocation,
|
|
94
|
-
indexFileLocation,
|
|
95
|
-
bed1Location,
|
|
96
|
-
bed2Location,
|
|
97
|
-
}),
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
catch (e) {
|
|
102
|
-
console.error(e);
|
|
103
|
-
setError(e);
|
|
104
|
-
}
|
|
105
|
-
}, [
|
|
106
|
-
fileName,
|
|
107
|
-
assembly1,
|
|
108
|
-
assembly2,
|
|
109
|
-
bed1Location,
|
|
110
|
-
bed2Location,
|
|
111
|
-
fileLocation,
|
|
112
|
-
indexFileLocation,
|
|
113
|
-
radioOption,
|
|
114
|
-
setUserOpenedSyntenyTrack,
|
|
115
|
-
]);
|
|
116
|
-
return (React.createElement(Paper, { style: { padding: 12 } },
|
|
117
|
-
error ? React.createElement(ErrorMessage, { error: error }) : null,
|
|
118
|
-
React.createElement(Typography, { style: { textAlign: 'center' } }, "Add a .paf, .out (MashMap), .delta (Mummer), .chain, .anchors or .anchors.simple (MCScan) file to view. These file types can also be gzipped. The first assembly should be the query sequence (e.g. left column of the PAF) and the second assembly should be the target sequence (e.g. right column of the PAF)"),
|
|
119
|
-
React.createElement(RadioGroup, { value: radioOption, onChange: event => {
|
|
120
|
-
setValue(event.target.value);
|
|
121
|
-
} },
|
|
122
|
-
React.createElement(Grid, { container: true, justifyContent: "center" },
|
|
123
|
-
React.createElement(Grid, { item: true },
|
|
124
|
-
React.createElement(FormControlLabel, { value: ".paf", control: React.createElement(Radio, null), label: ".paf" })),
|
|
125
|
-
React.createElement(Grid, { item: true },
|
|
126
|
-
React.createElement(FormControlLabel, { value: ".out", control: React.createElement(Radio, null), label: ".out" })),
|
|
127
|
-
React.createElement(Grid, { item: true },
|
|
128
|
-
React.createElement(FormControlLabel, { value: ".delta", control: React.createElement(Radio, null), label: ".delta" })),
|
|
129
|
-
React.createElement(Grid, { item: true },
|
|
130
|
-
React.createElement(FormControlLabel, { value: ".chain", control: React.createElement(Radio, null), label: ".chain" })),
|
|
131
|
-
React.createElement(Grid, { item: true },
|
|
132
|
-
React.createElement(FormControlLabel, { value: ".anchors", control: React.createElement(Radio, null), label: ".anchors" })),
|
|
133
|
-
React.createElement(Grid, { item: true },
|
|
134
|
-
React.createElement(FormControlLabel, { value: ".anchors.simple", control: React.createElement(Radio, null), label: ".anchors.simple" })),
|
|
135
|
-
React.createElement(Grid, { item: true },
|
|
136
|
-
React.createElement(FormControlLabel, { value: ".pif.gz", control: React.createElement(Radio, null), label: ".pif.gz" })))),
|
|
137
|
-
React.createElement(Grid, { container: true, justifyContent: "center" },
|
|
138
|
-
React.createElement(Grid, { item: true }, value === '.anchors' || value === '.anchors.simple' ? (React.createElement("div", null,
|
|
139
|
-
React.createElement("div", { style: { margin: 20 } },
|
|
140
|
-
"Open the ",
|
|
141
|
-
value,
|
|
142
|
-
" and .bed files for both genome assemblies from the MCScan (Python version) pipeline",
|
|
143
|
-
' ',
|
|
144
|
-
React.createElement("a", { href: "https://github.com/tanghaibao/jcvi/wiki/MCscan-(Python-version)" }, "(more info)")),
|
|
145
|
-
React.createElement("div", { style: { display: 'flex' } },
|
|
146
|
-
React.createElement("div", null,
|
|
147
|
-
React.createElement(FileSelector, { name: ".anchors file", description: "", location: fileLocation, setLocation: loc => {
|
|
148
|
-
setFileLocation(loc);
|
|
149
|
-
} })),
|
|
150
|
-
React.createElement("div", null,
|
|
151
|
-
React.createElement(FileSelector, { name: "genome 1 .bed (left column of anchors file)", description: "", location: bed1Location, setLocation: loc => {
|
|
152
|
-
setBed1Location(loc);
|
|
153
|
-
} })),
|
|
154
|
-
React.createElement("div", null,
|
|
155
|
-
React.createElement(FileSelector, { name: "genome 2 .bed (right column of anchors file)", description: "", location: bed2Location, setLocation: loc => {
|
|
156
|
-
setBed2Location(loc);
|
|
157
|
-
} }))))) : value === '.pif.gz' ? (React.createElement("div", { style: { display: 'flex' } },
|
|
158
|
-
React.createElement("div", null,
|
|
159
|
-
React.createElement(FileSelector, { name: `${value} location`, description: "", location: fileLocation, setLocation: loc => {
|
|
160
|
-
setFileLocation(loc);
|
|
161
|
-
} })),
|
|
162
|
-
React.createElement("div", null,
|
|
163
|
-
React.createElement(FileSelector, { name: `${value} index location`, description: "", location: indexFileLocation, setLocation: loc => {
|
|
164
|
-
setIndexFileLocation(loc);
|
|
165
|
-
} })))) : (React.createElement(FileSelector, { name: value ? `${value} location` : '', description: "", location: fileLocation, setLocation: loc => {
|
|
166
|
-
setFileLocation(loc);
|
|
167
|
-
} }))))));
|
|
168
|
-
});
|
|
169
|
-
export default ImportCustomTrack;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { LinearSyntenyViewModel } from '../../model';
|
|
3
|
-
declare const ImportSyntenyTrackSelector: ({ model, assembly1, assembly2, preConfiguredSyntenyTrack, setPreConfiguredSyntenyTrack, }: {
|
|
4
|
-
model: LinearSyntenyViewModel;
|
|
5
|
-
assembly1: string;
|
|
6
|
-
assembly2: string;
|
|
7
|
-
preConfiguredSyntenyTrack: string | undefined;
|
|
8
|
-
setPreConfiguredSyntenyTrack: (arg: string) => void;
|
|
9
|
-
}) => React.JSX.Element;
|
|
10
|
-
export default ImportSyntenyTrackSelector;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { readConfObject } from '@jbrowse/core/configuration';
|
|
3
|
-
import { ErrorMessage } from '@jbrowse/core/ui';
|
|
4
|
-
import { getSession } from '@jbrowse/core/util';
|
|
5
|
-
import { getTrackName } from '@jbrowse/core/util/tracks';
|
|
6
|
-
import { MenuItem, Paper, Select, Typography } from '@mui/material';
|
|
7
|
-
import { observer } from 'mobx-react';
|
|
8
|
-
const ImportSyntenyTrackSelector = observer(function ({ model, assembly1, assembly2, preConfiguredSyntenyTrack, setPreConfiguredSyntenyTrack, }) {
|
|
9
|
-
var _a;
|
|
10
|
-
const session = getSession(model);
|
|
11
|
-
const { tracks = [], sessionTracks = [] } = session;
|
|
12
|
-
const allTracks = [...tracks, ...sessionTracks];
|
|
13
|
-
const filteredTracks = allTracks.filter(track => {
|
|
14
|
-
const assemblyNames = readConfObject(track, 'assemblyNames');
|
|
15
|
-
return (assemblyNames.includes(assembly1) &&
|
|
16
|
-
assemblyNames.includes(assembly2) &&
|
|
17
|
-
track.type.includes('Synteny'));
|
|
18
|
-
});
|
|
19
|
-
const resetTrack = ((_a = filteredTracks[0]) === null || _a === void 0 ? void 0 : _a.trackId) || '';
|
|
20
|
-
const [value, setValue] = useState(resetTrack);
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
if (value !== preConfiguredSyntenyTrack) {
|
|
23
|
-
setPreConfiguredSyntenyTrack(value);
|
|
24
|
-
}
|
|
25
|
-
}, [value, preConfiguredSyntenyTrack, setPreConfiguredSyntenyTrack]);
|
|
26
|
-
return (React.createElement(Paper, { style: { padding: 12 } },
|
|
27
|
-
React.createElement(Typography, null, "Select a track from the select box below, the track will be shown when you hit \"Launch\"."),
|
|
28
|
-
filteredTracks.length ? (React.createElement(Select, { value: value, onChange: event => {
|
|
29
|
-
setValue(event.target.value);
|
|
30
|
-
} }, filteredTracks.map(track => (React.createElement(MenuItem, { key: track.trackId, value: track.trackId }, getTrackName(track, session)))))) : (React.createElement(ErrorMessage, { error: `No synteny tracks found for ${assembly1},${assembly2}` }))));
|
|
31
|
-
});
|
|
32
|
-
export default ImportSyntenyTrackSelector;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { LinearSyntenyViewModel } from '../../model';
|
|
3
|
-
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
4
|
-
import type { SnapshotIn } from 'mobx-state-tree';
|
|
5
|
-
type Conf = SnapshotIn<AnyConfigurationModel>;
|
|
6
|
-
export default function TrackSelector({ model, assembly1, assembly2, preConfiguredSyntenyTrack, setPreConfiguredSyntenyTrack, setUserOpenedSyntenyTrack, }: {
|
|
7
|
-
model: LinearSyntenyViewModel;
|
|
8
|
-
assembly1: string;
|
|
9
|
-
assembly2: string;
|
|
10
|
-
preConfiguredSyntenyTrack: string | undefined;
|
|
11
|
-
setUserOpenedSyntenyTrack: (arg: Conf) => void;
|
|
12
|
-
setPreConfiguredSyntenyTrack: (arg?: string) => void;
|
|
13
|
-
}): React.JSX.Element;
|
|
14
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { FormControl, FormControlLabel, Radio, RadioGroup } from '@mui/material';
|
|
3
|
-
import ImportCustomTrack from './AddCustomTrack';
|
|
4
|
-
import ImportSyntenyTrackSelector from './TrackSelector';
|
|
5
|
-
export default function TrackSelector({ model, assembly1, assembly2, preConfiguredSyntenyTrack, setPreConfiguredSyntenyTrack, setUserOpenedSyntenyTrack, }) {
|
|
6
|
-
const [choice, setChoice] = useState('tracklist');
|
|
7
|
-
useEffect(() => {
|
|
8
|
-
if (choice === 'none') {
|
|
9
|
-
setPreConfiguredSyntenyTrack(undefined);
|
|
10
|
-
setUserOpenedSyntenyTrack(undefined);
|
|
11
|
-
}
|
|
12
|
-
}, [choice, setPreConfiguredSyntenyTrack, setUserOpenedSyntenyTrack]);
|
|
13
|
-
return (React.createElement("div", null,
|
|
14
|
-
React.createElement(FormControl, null,
|
|
15
|
-
React.createElement(RadioGroup, { row: true, value: choice, onChange: event => {
|
|
16
|
-
setChoice(event.target.value);
|
|
17
|
-
}, "aria-labelledby": "group-label" },
|
|
18
|
-
React.createElement(FormControlLabel, { value: "none", control: React.createElement(Radio, null), label: "None" }),
|
|
19
|
-
React.createElement(FormControlLabel, { value: "tracklist", control: React.createElement(Radio, null), label: "Existing track" }),
|
|
20
|
-
React.createElement(FormControlLabel, { value: "custom", control: React.createElement(Radio, null), label: "New track" }))),
|
|
21
|
-
choice === 'custom' ? (React.createElement(ImportCustomTrack, { setUserOpenedSyntenyTrack: setUserOpenedSyntenyTrack, assembly2: assembly2, assembly1: assembly1 })) : null,
|
|
22
|
-
choice === 'tracklist' ? (React.createElement(ImportSyntenyTrackSelector, { key: `${assembly1}-${assembly2}`, model: model, assembly1: assembly1, assembly2: assembly2, preConfiguredSyntenyTrack: preConfiguredSyntenyTrack, setPreConfiguredSyntenyTrack: setPreConfiguredSyntenyTrack })) : null));
|
|
23
|
-
}
|