@jbrowse/plugin-alignments 2.13.1 → 2.15.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/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js +5 -3
- package/dist/AlignmentsFeatureDetail/BreakendOptionDialog.js +12 -4
- package/dist/AlignmentsFeatureDetail/Formatter.js +6 -2
- package/dist/AlignmentsFeatureDetail/SuppAlignmentsLocStrings.js +4 -2
- package/dist/AlignmentsFeatureDetail/getSAFeatures.js +4 -4
- package/dist/AlignmentsFeatureDetail/launchBreakpointSplitView.js +2 -2
- package/dist/BamAdapter/BamAdapter.js +12 -18
- package/dist/BamAdapter/BamSlightlyLazyFeature.js +0 -1
- package/dist/CramAdapter/CramAdapter.d.ts +1 -1
- package/dist/CramAdapter/CramAdapter.js +7 -6
- package/dist/CramAdapter/CramTestAdapters.js +8 -2
- package/dist/GuessAlignmentsTypes/index.js +2 -2
- package/dist/LinearAlignmentsDisplay/components/AlignmentsDisplay.d.ts +2 -2
- package/dist/LinearAlignmentsDisplay/models/model.d.ts +13 -20
- package/dist/LinearAlignmentsDisplay/models/model.js +13 -3
- package/dist/LinearPileupDisplay/SharedLinearPileupDisplayMixin.d.ts +9 -4
- package/dist/LinearPileupDisplay/SharedLinearPileupDisplayMixin.js +41 -22
- package/dist/LinearPileupDisplay/components/{ColorByModifications.js → ColorByModificationsDialog.js} +3 -1
- package/dist/LinearPileupDisplay/components/{ColorByTag.js → ColorByTagDialog.js} +4 -2
- package/dist/LinearPileupDisplay/components/GroupByDialog.d.ts +11 -0
- package/dist/LinearPileupDisplay/components/GroupByDialog.js +129 -0
- package/dist/LinearPileupDisplay/components/LinearPileupDisplayBlurb.js +1 -3
- package/dist/LinearPileupDisplay/components/{SetFeatureHeight.js → SetFeatureHeightDialog.js} +9 -3
- package/{esm/LinearPileupDisplay/components/SetMaxHeight.d.ts → dist/LinearPileupDisplay/components/SetMaxHeightDialog.d.ts} +1 -1
- package/dist/LinearPileupDisplay/components/{SetMaxHeight.js → SetMaxHeightDialog.js} +7 -3
- package/dist/LinearPileupDisplay/components/{SortByTag.d.ts → SortByTagDialog.d.ts} +1 -1
- package/dist/LinearPileupDisplay/components/{SortByTag.js → SortByTagDialog.js} +7 -3
- package/dist/LinearPileupDisplay/configSchema.js +0 -1
- package/dist/LinearPileupDisplay/model.d.ts +58 -46
- package/dist/LinearPileupDisplay/model.js +69 -41
- package/dist/LinearReadArcsDisplay/components/ReactComponent.js +1 -0
- package/dist/LinearReadArcsDisplay/model.d.ts +2 -2
- package/dist/LinearReadArcsDisplay/model.js +37 -13
- package/dist/LinearReadCloudDisplay/components/ReactComponent.js +4 -1
- package/dist/LinearReadCloudDisplay/drawPairChains.js +3 -3
- package/dist/LinearReadCloudDisplay/model.d.ts +4 -8
- package/dist/LinearReadCloudDisplay/model.js +16 -6
- package/dist/LinearSNPCoverageDisplay/components/Tooltip.d.ts +1 -1
- package/dist/LinearSNPCoverageDisplay/components/Tooltip.js +1 -1
- package/dist/LinearSNPCoverageDisplay/models/model.d.ts +1 -1
- package/dist/LinearSNPCoverageDisplay/models/model.js +15 -5
- package/dist/MismatchParser/index.js +12 -10
- package/dist/PileupRPC/base.d.ts +1 -1
- package/dist/PileupRPC/methods/GetGlobalValueForTag.d.ts +1 -1
- package/dist/PileupRPC/methods/GetReducedFeatures.d.ts +3 -3
- package/dist/PileupRPC/methods/GetVisibleModifications.d.ts +1 -1
- package/dist/PileupRenderer/PileupLayoutSession.d.ts +1 -1
- package/dist/PileupRenderer/PileupLayoutSession.js +3 -2
- package/dist/PileupRenderer/PileupRenderer.d.ts +1 -1
- package/dist/PileupRenderer/PileupRenderer.js +16 -13
- package/dist/PileupRenderer/colorBy.js +3 -5
- package/dist/PileupRenderer/components/PileupRendering.d.ts +1 -1
- package/dist/PileupRenderer/components/PileupRendering.js +65 -60
- package/dist/PileupRenderer/getAlignmentShapeColor.js +24 -16
- package/dist/PileupRenderer/layoutFeature.js +6 -1
- package/dist/PileupRenderer/layoutFeatures.js +1 -7
- package/dist/PileupRenderer/makeImageData.d.ts +1 -1
- package/dist/PileupRenderer/makeImageData.js +1 -0
- package/dist/PileupRenderer/renderAlignmentShape.js +1 -1
- package/dist/PileupRenderer/renderMismatches.js +1 -1
- package/dist/PileupRenderer/renderSoftClipping.js +1 -1
- package/dist/PileupRenderer/util.js +3 -5
- package/dist/SNPCoverageAdapter/generateCoverageBins.js +4 -10
- package/dist/SNPCoverageRenderer/SNPCoverageRenderer.d.ts +2 -2
- package/dist/SNPCoverageRenderer/SNPCoverageRenderer.js +2 -5
- package/dist/index.js +3 -1
- package/dist/shared/BaseDisplayComponent.js +3 -1
- package/dist/shared/{FilterByTag.js → FilterByTagDialog.js} +16 -6
- package/dist/shared/color.js +2 -2
- package/dist/shared/index.d.ts +24 -20
- package/dist/shared/index.js +4 -5
- package/dist/shared/renderSvg.js +1 -3
- package/dist/util.d.ts +1 -1
- package/esm/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js +5 -3
- package/esm/AlignmentsFeatureDetail/BreakendOptionDialog.js +12 -4
- package/esm/AlignmentsFeatureDetail/Formatter.js +6 -2
- package/esm/AlignmentsFeatureDetail/SuppAlignmentsLocStrings.js +4 -2
- package/esm/AlignmentsFeatureDetail/getSAFeatures.js +4 -4
- package/esm/AlignmentsFeatureDetail/launchBreakpointSplitView.js +2 -2
- package/esm/BamAdapter/BamAdapter.js +12 -18
- package/esm/BamAdapter/BamSlightlyLazyFeature.js +0 -1
- package/esm/CramAdapter/CramAdapter.d.ts +1 -1
- package/esm/CramAdapter/CramAdapter.js +7 -6
- package/esm/CramAdapter/CramTestAdapters.js +8 -2
- package/esm/GuessAlignmentsTypes/index.js +2 -2
- package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.d.ts +2 -2
- package/esm/LinearAlignmentsDisplay/models/model.d.ts +13 -20
- package/esm/LinearAlignmentsDisplay/models/model.js +13 -3
- package/esm/LinearPileupDisplay/SharedLinearPileupDisplayMixin.d.ts +9 -4
- package/esm/LinearPileupDisplay/SharedLinearPileupDisplayMixin.js +42 -23
- package/esm/LinearPileupDisplay/components/{ColorByModifications.js → ColorByModificationsDialog.js} +3 -1
- package/esm/LinearPileupDisplay/components/{ColorByTag.js → ColorByTagDialog.js} +4 -2
- package/esm/LinearPileupDisplay/components/GroupByDialog.d.ts +11 -0
- package/esm/LinearPileupDisplay/components/GroupByDialog.js +104 -0
- package/esm/LinearPileupDisplay/components/LinearPileupDisplayBlurb.js +1 -3
- package/esm/LinearPileupDisplay/components/{SetFeatureHeight.js → SetFeatureHeightDialog.js} +9 -3
- package/{dist/LinearPileupDisplay/components/SetMaxHeight.d.ts → esm/LinearPileupDisplay/components/SetMaxHeightDialog.d.ts} +1 -1
- package/esm/LinearPileupDisplay/components/{SetMaxHeight.js → SetMaxHeightDialog.js} +7 -3
- package/esm/LinearPileupDisplay/components/{SortByTag.d.ts → SortByTagDialog.d.ts} +1 -1
- package/esm/LinearPileupDisplay/components/{SortByTag.js → SortByTagDialog.js} +7 -3
- package/esm/LinearPileupDisplay/configSchema.js +0 -1
- package/esm/LinearPileupDisplay/model.d.ts +58 -46
- package/esm/LinearPileupDisplay/model.js +69 -41
- package/esm/LinearReadArcsDisplay/components/ReactComponent.js +1 -0
- package/esm/LinearReadArcsDisplay/model.d.ts +2 -2
- package/esm/LinearReadArcsDisplay/model.js +37 -13
- package/esm/LinearReadCloudDisplay/components/ReactComponent.js +4 -1
- package/esm/LinearReadCloudDisplay/drawPairChains.js +3 -3
- package/esm/LinearReadCloudDisplay/model.d.ts +4 -8
- package/esm/LinearReadCloudDisplay/model.js +16 -6
- package/esm/LinearSNPCoverageDisplay/components/Tooltip.d.ts +1 -1
- package/esm/LinearSNPCoverageDisplay/components/Tooltip.js +1 -1
- package/esm/LinearSNPCoverageDisplay/models/model.d.ts +1 -1
- package/esm/LinearSNPCoverageDisplay/models/model.js +15 -5
- package/esm/MismatchParser/index.js +12 -10
- package/esm/PileupRPC/base.d.ts +1 -1
- package/esm/PileupRPC/methods/GetGlobalValueForTag.d.ts +1 -1
- package/esm/PileupRPC/methods/GetReducedFeatures.d.ts +3 -3
- package/esm/PileupRPC/methods/GetVisibleModifications.d.ts +1 -1
- package/esm/PileupRenderer/PileupLayoutSession.d.ts +1 -1
- package/esm/PileupRenderer/PileupLayoutSession.js +3 -2
- package/esm/PileupRenderer/PileupRenderer.d.ts +1 -1
- package/esm/PileupRenderer/PileupRenderer.js +16 -13
- package/esm/PileupRenderer/colorBy.js +3 -5
- package/esm/PileupRenderer/components/PileupRendering.d.ts +1 -1
- package/esm/PileupRenderer/components/PileupRendering.js +65 -60
- package/esm/PileupRenderer/getAlignmentShapeColor.js +24 -16
- package/esm/PileupRenderer/layoutFeature.js +6 -1
- package/esm/PileupRenderer/layoutFeatures.js +1 -7
- package/esm/PileupRenderer/makeImageData.d.ts +1 -1
- package/esm/PileupRenderer/makeImageData.js +1 -0
- package/esm/PileupRenderer/renderAlignmentShape.js +1 -1
- package/esm/PileupRenderer/renderMismatches.js +1 -1
- package/esm/PileupRenderer/renderSoftClipping.js +1 -1
- package/esm/PileupRenderer/util.js +3 -5
- package/esm/SNPCoverageAdapter/generateCoverageBins.js +4 -10
- package/esm/SNPCoverageRenderer/SNPCoverageRenderer.d.ts +2 -2
- package/esm/SNPCoverageRenderer/SNPCoverageRenderer.js +2 -5
- package/esm/index.js +3 -1
- package/esm/shared/BaseDisplayComponent.js +3 -1
- package/esm/shared/{FilterByTag.js → FilterByTagDialog.js} +16 -6
- package/esm/shared/color.js +2 -2
- package/esm/shared/index.d.ts +24 -20
- package/esm/shared/index.js +4 -5
- package/esm/shared/renderSvg.js +1 -3
- package/esm/util.d.ts +1 -1
- package/package.json +6 -6
- /package/dist/LinearPileupDisplay/components/{ColorByModifications.d.ts → ColorByModificationsDialog.d.ts} +0 -0
- /package/dist/LinearPileupDisplay/components/{ColorByTag.d.ts → ColorByTagDialog.d.ts} +0 -0
- /package/dist/LinearPileupDisplay/components/{SetFeatureHeight.d.ts → SetFeatureHeightDialog.d.ts} +0 -0
- /package/dist/shared/{FilterByTag.d.ts → FilterByTagDialog.d.ts} +0 -0
- /package/esm/LinearPileupDisplay/components/{ColorByModifications.d.ts → ColorByModificationsDialog.d.ts} +0 -0
- /package/esm/LinearPileupDisplay/components/{ColorByTag.d.ts → ColorByTagDialog.d.ts} +0 -0
- /package/esm/LinearPileupDisplay/components/{SetFeatureHeight.d.ts → SetFeatureHeightDialog.d.ts} +0 -0
- /package/esm/shared/{FilterByTag.d.ts → FilterByTagDialog.d.ts} +0 -0
|
@@ -26,15 +26,21 @@ const BreakendOptionDialog = observer(function ({ model, handleClose, f1, f2, })
|
|
|
26
26
|
const [mirror, setMirror] = useState(true);
|
|
27
27
|
return (React.createElement(Dialog, { open: true, onClose: handleClose, title: "Breakpoint split view options" },
|
|
28
28
|
React.createElement(DialogContent, null,
|
|
29
|
-
React.createElement(Checkbox2, { checked: copyTracks, onChange: event =>
|
|
30
|
-
|
|
29
|
+
React.createElement(Checkbox2, { checked: copyTracks, onChange: event => {
|
|
30
|
+
setCopyTracks(event.target.checked);
|
|
31
|
+
}, label: "Copy tracks into the new view" }),
|
|
32
|
+
React.createElement(Checkbox2, { checked: mirror, onChange: event => {
|
|
33
|
+
setMirror(event.target.checked);
|
|
34
|
+
}, label: "Mirror tracks vertically in vertically stacked view" })),
|
|
31
35
|
React.createElement(DialogActions, null,
|
|
32
36
|
React.createElement(Button, { onClick: () => {
|
|
33
37
|
const { view } = model;
|
|
34
38
|
const session = getSession(model);
|
|
35
39
|
try {
|
|
36
40
|
const viewSnapshot = getBreakpointSplitView({ view, f1, f2 });
|
|
37
|
-
const
|
|
41
|
+
const views = viewSnapshot.views;
|
|
42
|
+
const view1 = views[0];
|
|
43
|
+
const view2 = views[1];
|
|
38
44
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
39
45
|
const viewTracks = getSnapshot(view.tracks);
|
|
40
46
|
session.addView('BreakpointSplitView', {
|
|
@@ -59,6 +65,8 @@ const BreakendOptionDialog = observer(function ({ model, handleClose, f1, f2, })
|
|
|
59
65
|
}
|
|
60
66
|
handleClose();
|
|
61
67
|
}, variant: "contained", color: "primary", autoFocus: true }, "OK"),
|
|
62
|
-
React.createElement(Button, { onClick: () =>
|
|
68
|
+
React.createElement(Button, { onClick: () => {
|
|
69
|
+
handleClose();
|
|
70
|
+
}, color: "secondary", variant: "contained" }, "Cancel"))));
|
|
63
71
|
});
|
|
64
72
|
export default BreakendOptionDialog;
|
|
@@ -11,8 +11,12 @@ export default function Formatter({ value }) {
|
|
|
11
11
|
React.createElement("button", { type: "button", onClick: () => {
|
|
12
12
|
copy(display);
|
|
13
13
|
setCopied(true);
|
|
14
|
-
setTimeout(() =>
|
|
14
|
+
setTimeout(() => {
|
|
15
|
+
setCopied(false);
|
|
16
|
+
}, 700);
|
|
15
17
|
} }, copied ? 'Copied to clipboard' : 'Copy'),
|
|
16
|
-
React.createElement("button", { type: "button", onClick: () =>
|
|
18
|
+
React.createElement("button", { type: "button", onClick: () => {
|
|
19
|
+
setShow(val => !val);
|
|
20
|
+
} }, show ? 'Show less' : 'Show more'),
|
|
17
21
|
React.createElement("div", null, show ? display : `${display.slice(0, 100)}...`))) : (React.createElement("div", null, display));
|
|
18
22
|
}
|
|
@@ -9,7 +9,7 @@ export default function SuppAlignmentsLocStrings({ tag, model, }) {
|
|
|
9
9
|
React.createElement("ul", null, tag
|
|
10
10
|
.split(';')
|
|
11
11
|
.filter(SA => !!SA)
|
|
12
|
-
.map((SA,
|
|
12
|
+
.map((SA, idx) => {
|
|
13
13
|
const [saRef, saStart, saStrand, saCigar] = SA.split(',');
|
|
14
14
|
const saLength = getLengthOnRef(saCigar);
|
|
15
15
|
const extra = Math.floor(saLength / 5);
|
|
@@ -21,7 +21,9 @@ export default function SuppAlignmentsLocStrings({ tag, model, }) {
|
|
|
21
21
|
const displayStart = start.toLocaleString('en-US');
|
|
22
22
|
const displayEnd = end.toLocaleString('en-US');
|
|
23
23
|
const displayString = `${saRef}:${displayStart}-${displayEnd} (${saStrand}) [${saLength}bp]`;
|
|
24
|
-
return (
|
|
24
|
+
return (
|
|
25
|
+
/* biome-ignore lint/suspicious/noArrayIndexKey: */
|
|
26
|
+
React.createElement("li", { key: `${locString}-${idx}` },
|
|
25
27
|
React.createElement(Link, { href: "#", onClick: async (event) => {
|
|
26
28
|
event.preventDefault();
|
|
27
29
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
@@ -9,9 +9,9 @@ export async function getSAFeatures({ view, feature, }) {
|
|
|
9
9
|
const SA = getTag(feature, 'SA') || '';
|
|
10
10
|
const readName = feature.get('name');
|
|
11
11
|
const clipPos = getClip(cigar, 1);
|
|
12
|
-
// get the canonical refname for the read because if the
|
|
13
|
-
//
|
|
14
|
-
//
|
|
12
|
+
// get the canonical refname for the read because if the read.get('refName')
|
|
13
|
+
// is chr1 and the actual fasta refName is 1 then no tracks can be opened on
|
|
14
|
+
// the top panel of the linear read vs ref
|
|
15
15
|
const assembly = await assemblyManager.waitForAssembly(view.assemblyNames[0]);
|
|
16
16
|
if (!assembly) {
|
|
17
17
|
throw new Error('assembly not found');
|
|
@@ -27,7 +27,7 @@ export async function getSAFeatures({ view, feature, }) {
|
|
|
27
27
|
};
|
|
28
28
|
const features = [feat, ...suppAlns];
|
|
29
29
|
features.forEach((f, idx) => {
|
|
30
|
-
f.refName =
|
|
30
|
+
f.refName = assembly.getCanonicalRefName(f.refName) || f.refName;
|
|
31
31
|
f.syntenyId = idx;
|
|
32
32
|
f.mate.syntenyId = idx;
|
|
33
33
|
f.mate.uniqueId = `${f.uniqueId}_mate`;
|
|
@@ -12,7 +12,7 @@ export function getBreakpointSplitView({ f1, f2, view, }) {
|
|
|
12
12
|
const topRegion = assembly.regions.find(f => f.refName === f1.refName);
|
|
13
13
|
const bottomRegion = assembly.regions.find(f => f.refName === f2.refName);
|
|
14
14
|
if (!topRegion || !bottomRegion) {
|
|
15
|
-
throw new Error(
|
|
15
|
+
throw new Error('unable to find the refName for the top or bottom of the breakpoint view');
|
|
16
16
|
}
|
|
17
17
|
const topMarkedRegion = [{ ...topRegion }, { ...topRegion }];
|
|
18
18
|
const bottomMarkedRegion = [{ ...bottomRegion }, { ...bottomRegion }];
|
|
@@ -41,6 +41,6 @@ export function getBreakpointSplitView({ f1, f2, view, }) {
|
|
|
41
41
|
offsetPx: (bottomRegion.start + e) / bpPerPx,
|
|
42
42
|
},
|
|
43
43
|
],
|
|
44
|
-
displayName:
|
|
44
|
+
displayName: 'breakend split detail',
|
|
45
45
|
};
|
|
46
46
|
}
|
|
@@ -8,8 +8,8 @@ import { firstValueFrom } from 'rxjs';
|
|
|
8
8
|
// locals
|
|
9
9
|
import BamSlightlyLazyFeature from './BamSlightlyLazyFeature';
|
|
10
10
|
export default class BamAdapter extends BaseFeatureDataAdapter {
|
|
11
|
-
// derived classes may not use the same configuration so a custom
|
|
12
|
-
//
|
|
11
|
+
// derived classes may not use the same configuration so a custom configure
|
|
12
|
+
// method allows derived classes to override this behavior
|
|
13
13
|
async configurePre() {
|
|
14
14
|
const bamLocation = this.getConf('bamLocation');
|
|
15
15
|
const location = this.getConf(['index', 'location']);
|
|
@@ -20,10 +20,7 @@ export default class BamAdapter extends BaseFeatureDataAdapter {
|
|
|
20
20
|
bamFilehandle: openLocation(bamLocation, pm),
|
|
21
21
|
csiFilehandle: csi ? openLocation(location, pm) : undefined,
|
|
22
22
|
baiFilehandle: !csi ? openLocation(location, pm) : undefined,
|
|
23
|
-
|
|
24
|
-
// helpful, and have given overly large values on the ultra long
|
|
25
|
-
// nanopore reads even with 500MB limits, so disabled with infinity
|
|
26
|
-
yieldThreadTime: Infinity,
|
|
23
|
+
yieldThreadTime: Number.POSITIVE_INFINITY,
|
|
27
24
|
});
|
|
28
25
|
const adapterConfig = this.getConf('sequenceAdapter');
|
|
29
26
|
if (adapterConfig && this.getSubAdapter) {
|
|
@@ -33,13 +30,11 @@ export default class BamAdapter extends BaseFeatureDataAdapter {
|
|
|
33
30
|
sequenceAdapter: dataAdapter,
|
|
34
31
|
};
|
|
35
32
|
}
|
|
36
|
-
|
|
37
|
-
return { bam };
|
|
38
|
-
}
|
|
33
|
+
return { bam };
|
|
39
34
|
}
|
|
40
35
|
async configure() {
|
|
41
36
|
if (!this.configureP) {
|
|
42
|
-
this.configureP = this.configurePre().catch(e => {
|
|
37
|
+
this.configureP = this.configurePre().catch((e) => {
|
|
43
38
|
this.configureP = undefined;
|
|
44
39
|
throw e;
|
|
45
40
|
});
|
|
@@ -74,7 +69,7 @@ export default class BamAdapter extends BaseFeatureDataAdapter {
|
|
|
74
69
|
}
|
|
75
70
|
async setup(opts) {
|
|
76
71
|
if (!this.setupP) {
|
|
77
|
-
this.setupP = this.setupPre(opts).catch(e => {
|
|
72
|
+
this.setupP = this.setupPre(opts).catch((e) => {
|
|
78
73
|
this.setupP = undefined;
|
|
79
74
|
throw e;
|
|
80
75
|
});
|
|
@@ -137,10 +132,11 @@ export default class BamAdapter extends BaseFeatureDataAdapter {
|
|
|
137
132
|
continue;
|
|
138
133
|
}
|
|
139
134
|
if (tagFilter) {
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
135
|
+
const readVal = record.get(tagFilter.tag);
|
|
136
|
+
const filterVal = tagFilter.value;
|
|
137
|
+
if (filterVal === '*'
|
|
138
|
+
? readVal !== undefined
|
|
139
|
+
: `${readVal}` !== `${filterVal}`) {
|
|
144
140
|
continue;
|
|
145
141
|
}
|
|
146
142
|
}
|
|
@@ -161,9 +157,7 @@ export default class BamAdapter extends BaseFeatureDataAdapter {
|
|
|
161
157
|
const fetchSizeLimit = this.getConf('fetchSizeLimit');
|
|
162
158
|
return { bytes, fetchSizeLimit };
|
|
163
159
|
}
|
|
164
|
-
|
|
165
|
-
return super.getMultiRegionFeatureDensityStats(regions, opts);
|
|
166
|
-
}
|
|
160
|
+
return super.getMultiRegionFeatureDensityStats(regions, opts);
|
|
167
161
|
}
|
|
168
162
|
freeResources( /* { region } */) { }
|
|
169
163
|
// depends on setup being called before the BAM constructor
|
|
@@ -29,7 +29,7 @@ export default class CramAdapter extends BaseFeatureDataAdapter {
|
|
|
29
29
|
getRefNames(opts?: BaseOptions): Promise<string[]>;
|
|
30
30
|
refNameToId(refName: string): number | undefined;
|
|
31
31
|
refIdToName(refId: number): string | undefined;
|
|
32
|
-
refIdToOriginalName(refId: number): string;
|
|
32
|
+
refIdToOriginalName(refId: number): string | undefined;
|
|
33
33
|
getFeatures(region: Region & {
|
|
34
34
|
originalRefName?: string;
|
|
35
35
|
}, opts?: BaseOptions & {
|
|
@@ -39,7 +39,7 @@ export default class CramAdapter extends BaseFeatureDataAdapter {
|
|
|
39
39
|
}
|
|
40
40
|
async configure() {
|
|
41
41
|
if (!this.configureP) {
|
|
42
|
-
this.configureP = this.configurePre().catch(e => {
|
|
42
|
+
this.configureP = this.configurePre().catch((e) => {
|
|
43
43
|
this.configureP = undefined;
|
|
44
44
|
throw e;
|
|
45
45
|
});
|
|
@@ -113,7 +113,7 @@ export default class CramAdapter extends BaseFeatureDataAdapter {
|
|
|
113
113
|
}
|
|
114
114
|
async setup(opts) {
|
|
115
115
|
if (!this.setupP) {
|
|
116
|
-
this.setupP = this.setupPre(opts).catch(e => {
|
|
116
|
+
this.setupP = this.setupPre(opts).catch((e) => {
|
|
117
117
|
this.setupP = undefined;
|
|
118
118
|
throw e;
|
|
119
119
|
});
|
|
@@ -172,12 +172,13 @@ export default class CramAdapter extends BaseFeatureDataAdapter {
|
|
|
172
172
|
continue;
|
|
173
173
|
}
|
|
174
174
|
if (tagFilter) {
|
|
175
|
-
const
|
|
175
|
+
const readVal = tagFilter.tag === 'RG'
|
|
176
176
|
? (_a = samHeader.readGroups) === null || _a === void 0 ? void 0 : _a[record.readGroupId]
|
|
177
177
|
: record.tags[tagFilter.tag];
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
178
|
+
const filterVal = tagFilter.value;
|
|
179
|
+
if (filterVal === '*'
|
|
180
|
+
? readVal !== undefined
|
|
181
|
+
: `${readVal}` !== `${filterVal}`) {
|
|
181
182
|
continue;
|
|
182
183
|
}
|
|
183
184
|
}
|
|
@@ -12,7 +12,11 @@ export function parseSmallFasta(text) {
|
|
|
12
12
|
const [id, ...descriptionLines] = defLine.split(' ');
|
|
13
13
|
const description = descriptionLines.join(' ');
|
|
14
14
|
const sequence = seqLines.join('').replaceAll(/\s/g, '');
|
|
15
|
-
return {
|
|
15
|
+
return {
|
|
16
|
+
id: id,
|
|
17
|
+
description,
|
|
18
|
+
sequence,
|
|
19
|
+
};
|
|
16
20
|
});
|
|
17
21
|
}
|
|
18
22
|
export class FetchableSmallFasta {
|
|
@@ -63,7 +67,9 @@ export class SequenceAdapter extends BaseFeatureDataAdapter {
|
|
|
63
67
|
}));
|
|
64
68
|
observer.complete();
|
|
65
69
|
})
|
|
66
|
-
.catch(e =>
|
|
70
|
+
.catch((e) => {
|
|
71
|
+
observer.error(e);
|
|
72
|
+
});
|
|
67
73
|
return { unsubscribe: () => { } };
|
|
68
74
|
});
|
|
69
75
|
}
|
|
@@ -13,7 +13,7 @@ export default function GuessAlignmentsTypesF(pluginManager) {
|
|
|
13
13
|
if (regexGuess.test(fileName) && !adapterHint) {
|
|
14
14
|
return obj;
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
if (adapterHint === adapterName) {
|
|
17
17
|
return obj;
|
|
18
18
|
}
|
|
19
19
|
return adapterGuesser(file, index, adapterHint);
|
|
@@ -36,7 +36,7 @@ export default function GuessAlignmentsTypesF(pluginManager) {
|
|
|
36
36
|
if (regexGuess.test(fileName) && !adapterHint) {
|
|
37
37
|
return obj;
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
if (adapterHint === adapterName) {
|
|
40
40
|
return obj;
|
|
41
41
|
}
|
|
42
42
|
return adapterGuesser(file, index, adapterHint);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { LinearAlignmentsDisplayModel } from '../models/model';
|
|
3
3
|
declare const AlignmentsDisplay: ({ model, }: {
|
|
4
|
-
model:
|
|
4
|
+
model: LinearAlignmentsDisplayModel;
|
|
5
5
|
}) => React.JSX.Element | null;
|
|
6
6
|
export default AlignmentsDisplay;
|
|
@@ -4,6 +4,7 @@ import { AnyConfigurationModel, AnyConfigurationSchemaType } from '@jbrowse/core
|
|
|
4
4
|
import PluginManager from '@jbrowse/core/PluginManager';
|
|
5
5
|
import { MenuItem } from '@jbrowse/core/ui';
|
|
6
6
|
import { FeatureDensityStats } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
7
|
+
import { IFilter } from '../../shared';
|
|
7
8
|
/**
|
|
8
9
|
* #stateModel LinearAlignmentsDisplay
|
|
9
10
|
* extends
|
|
@@ -46,7 +47,7 @@ declare function stateModelFactory(pluginManager: PluginManager, configSchema: A
|
|
|
46
47
|
error: unknown;
|
|
47
48
|
message: string | undefined;
|
|
48
49
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
49
|
-
onHorizontalScroll?:
|
|
50
|
+
onHorizontalScroll?: () => void;
|
|
50
51
|
blockState?: Record<string, any>;
|
|
51
52
|
}>;
|
|
52
53
|
readonly DisplayBlurb: React.FC<{
|
|
@@ -59,26 +60,14 @@ declare function stateModelFactory(pluginManager: PluginManager, configSchema: A
|
|
|
59
60
|
error: unknown;
|
|
60
61
|
message: string | undefined;
|
|
61
62
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
62
|
-
id: import("mobx-state-tree").IOptionalIType<import(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
*/
|
|
66
|
-
"mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
67
|
-
type: import("mobx-state-tree" /**
|
|
68
|
-
* #getter
|
|
69
|
-
*/).ISimpleType<string>;
|
|
70
|
-
rpcDriverName: import("mobx-state-tree" /**
|
|
71
|
-
* #getter
|
|
72
|
-
*/).IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
63
|
+
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
64
|
+
type: import("mobx-state-tree").ISimpleType<string>;
|
|
65
|
+
rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
73
66
|
}, {
|
|
74
67
|
rendererTypeName: string;
|
|
75
68
|
error: unknown;
|
|
76
69
|
message: string | undefined;
|
|
77
|
-
}, import("mobx-state-tree")._NotCustomized, import(
|
|
78
|
-
/**
|
|
79
|
-
* #getter
|
|
80
|
-
*/
|
|
81
|
-
"mobx-state-tree")._NotCustomized>>;
|
|
70
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
82
71
|
}> | null;
|
|
83
72
|
readonly adapterConfig: any;
|
|
84
73
|
readonly parentTrack: any;
|
|
@@ -131,7 +120,7 @@ declare function stateModelFactory(pluginManager: PluginManager, configSchema: A
|
|
|
131
120
|
*/
|
|
132
121
|
readonly features: any;
|
|
133
122
|
/**
|
|
134
|
-
* #
|
|
123
|
+
* #getteralignmentsdisplaymodel
|
|
135
124
|
*/
|
|
136
125
|
readonly DisplayBlurb: any;
|
|
137
126
|
/**
|
|
@@ -159,6 +148,10 @@ declare function stateModelFactory(pluginManager: PluginManager, configSchema: A
|
|
|
159
148
|
* #action
|
|
160
149
|
*/
|
|
161
150
|
setHeight(n: number): number;
|
|
151
|
+
/**
|
|
152
|
+
* #action
|
|
153
|
+
*/
|
|
154
|
+
setFilterBy(filter: IFilter): void;
|
|
162
155
|
/**
|
|
163
156
|
* #action
|
|
164
157
|
*/
|
|
@@ -195,5 +188,5 @@ declare function stateModelFactory(pluginManager: PluginManager, configSchema: A
|
|
|
195
188
|
lowerPanelType: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
196
189
|
}>>, import("mobx-state-tree")._NotCustomized>;
|
|
197
190
|
export default stateModelFactory;
|
|
198
|
-
export type
|
|
199
|
-
export type
|
|
191
|
+
export type LinearAlignmentsDisplayStateModel = ReturnType<typeof stateModelFactory>;
|
|
192
|
+
export type LinearAlignmentsDisplayModel = Instance<LinearAlignmentsDisplayStateModel>;
|
|
@@ -111,7 +111,7 @@ function stateModelFactory(pluginManager, configSchema) {
|
|
|
111
111
|
return self.PileupDisplay.features;
|
|
112
112
|
},
|
|
113
113
|
/**
|
|
114
|
-
* #
|
|
114
|
+
* #getteralignmentsdisplaymodel
|
|
115
115
|
*/
|
|
116
116
|
get DisplayBlurb() {
|
|
117
117
|
var _a;
|
|
@@ -168,6 +168,13 @@ function stateModelFactory(pluginManager, configSchema) {
|
|
|
168
168
|
self.heightPreConfig = Math.max(n, minDisplayHeight);
|
|
169
169
|
return self.heightPreConfig;
|
|
170
170
|
},
|
|
171
|
+
/**
|
|
172
|
+
* #action
|
|
173
|
+
*/
|
|
174
|
+
setFilterBy(filter) {
|
|
175
|
+
self.PileupDisplay.setFilterBy(filter);
|
|
176
|
+
self.SNPCoverageDisplay.setFilterBy(filter);
|
|
177
|
+
},
|
|
171
178
|
/**
|
|
172
179
|
* #action
|
|
173
180
|
*/
|
|
@@ -239,7 +246,9 @@ function stateModelFactory(pluginManager, configSchema) {
|
|
|
239
246
|
type: 'radio',
|
|
240
247
|
label: d.displayName,
|
|
241
248
|
checked: d.name === self.PileupDisplay.type,
|
|
242
|
-
onClick: () =>
|
|
249
|
+
onClick: () => {
|
|
250
|
+
self.setLowerPanelType(d.name);
|
|
251
|
+
},
|
|
243
252
|
}));
|
|
244
253
|
return [
|
|
245
254
|
...superTrackMenuItems(),
|
|
@@ -255,7 +264,7 @@ function stateModelFactory(pluginManager, configSchema) {
|
|
|
255
264
|
},
|
|
256
265
|
{
|
|
257
266
|
type: 'subMenu',
|
|
258
|
-
label:
|
|
267
|
+
label: 'Replace lower panel with...',
|
|
259
268
|
subMenu: extra,
|
|
260
269
|
},
|
|
261
270
|
];
|
|
@@ -263,6 +272,7 @@ function stateModelFactory(pluginManager, configSchema) {
|
|
|
263
272
|
};
|
|
264
273
|
})
|
|
265
274
|
.preProcessSnapshot(snap => {
|
|
275
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
266
276
|
if (!snap) {
|
|
267
277
|
return snap;
|
|
268
278
|
}
|
|
@@ -138,7 +138,7 @@ export declare function SharedLinearPileupDisplayMixin(configSchema: AnyConfigur
|
|
|
138
138
|
readName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
139
139
|
tagFilter: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IModelType<{
|
|
140
140
|
tag: import("mobx-state-tree").ISimpleType<string>;
|
|
141
|
-
value: import("mobx-state-tree").ISimpleType<string
|
|
141
|
+
value: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
142
142
|
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
143
143
|
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>, [undefined]>;
|
|
144
144
|
/**
|
|
@@ -168,7 +168,7 @@ export declare function SharedLinearPileupDisplayMixin(configSchema: AnyConfigur
|
|
|
168
168
|
error: unknown;
|
|
169
169
|
message: string | undefined;
|
|
170
170
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
171
|
-
onHorizontalScroll?:
|
|
171
|
+
onHorizontalScroll?: () => void;
|
|
172
172
|
blockState?: Record<string, any>;
|
|
173
173
|
}>;
|
|
174
174
|
readonly DisplayBlurb: import("react").FC<{
|
|
@@ -284,7 +284,7 @@ export declare function SharedLinearPileupDisplayMixin(configSchema: AnyConfigur
|
|
|
284
284
|
/**
|
|
285
285
|
* #action
|
|
286
286
|
*/
|
|
287
|
-
setMaxHeight(n
|
|
287
|
+
setMaxHeight(n?: number): void;
|
|
288
288
|
/**
|
|
289
289
|
* #action
|
|
290
290
|
*/
|
|
@@ -343,7 +343,11 @@ export declare function SharedLinearPileupDisplayMixin(configSchema: AnyConfigur
|
|
|
343
343
|
setSubschema(slotName: string, data: Record<string, unknown>): Record<string, unknown> | ({
|
|
344
344
|
[x: string]: any;
|
|
345
345
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & any & import("mobx-state-tree").IStateTreeNode<AnyConfigurationSchemaType>);
|
|
346
|
-
} & import("mobx-state-tree"
|
|
346
|
+
} & import("mobx-state-tree" /**
|
|
347
|
+
* #stateModel SharedLinearPileupDisplayMixin
|
|
348
|
+
* #category display
|
|
349
|
+
* extends `BaseLinearDisplay`
|
|
350
|
+
*/).IStateTreeNode<AnyConfigurationSchemaType>);
|
|
347
351
|
} & import("mobx-state-tree").IStateTreeNode<AnyConfigurationSchemaType>;
|
|
348
352
|
} & {
|
|
349
353
|
/**
|
|
@@ -417,6 +421,7 @@ export declare function SharedLinearPileupDisplayMixin(configSchema: AnyConfigur
|
|
|
417
421
|
icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
|
|
418
422
|
muiName: string;
|
|
419
423
|
};
|
|
424
|
+
priority: number;
|
|
420
425
|
onClick: () => void;
|
|
421
426
|
})[];
|
|
422
427
|
} & {
|
|
@@ -5,7 +5,7 @@ import copy from 'copy-to-clipboard';
|
|
|
5
5
|
import { ConfigurationReference, readConfObject, getConf, } from '@jbrowse/core/configuration';
|
|
6
6
|
import SerializableFilterChain from '@jbrowse/core/pluggableElementTypes/renderers/util/serializableFilterChain';
|
|
7
7
|
import { getRpcSessionId } from '@jbrowse/core/util/tracks';
|
|
8
|
-
import { getEnv, getSession, isSessionModelWithWidgets, getContainingView, SimpleFeature, } from '@jbrowse/core/util';
|
|
8
|
+
import { getEnv, getSession, isSessionModelWithWidgets, getContainingView, SimpleFeature, getContainingTrack, } from '@jbrowse/core/util';
|
|
9
9
|
import { BaseLinearDisplay, } from '@jbrowse/plugin-linear-genome-view';
|
|
10
10
|
// icons
|
|
11
11
|
import { ContentCopy as ContentCopyIcon } from '@jbrowse/core/ui/Icons';
|
|
@@ -16,11 +16,11 @@ import LinearPileupDisplayBlurb from './components/LinearPileupDisplayBlurb';
|
|
|
16
16
|
import { getUniqueTagValues, FilterModel } from '../shared';
|
|
17
17
|
import { createAutorun } from '../util';
|
|
18
18
|
import { ColorByModel } from '../shared/color';
|
|
19
|
-
//
|
|
20
|
-
const FilterByTagDialog = lazy(() => import('../shared/
|
|
21
|
-
const ColorByTagDialog = lazy(() => import('./components/
|
|
22
|
-
const SetFeatureHeightDialog = lazy(() => import('./components/
|
|
23
|
-
const SetMaxHeightDialog = lazy(() => import('./components/
|
|
19
|
+
// lazies
|
|
20
|
+
const FilterByTagDialog = lazy(() => import('../shared/FilterByTagDialog'));
|
|
21
|
+
const ColorByTagDialog = lazy(() => import('./components/ColorByTagDialog'));
|
|
22
|
+
const SetFeatureHeightDialog = lazy(() => import('./components/SetFeatureHeightDialog'));
|
|
23
|
+
const SetMaxHeightDialog = lazy(() => import('./components/SetMaxHeightDialog'));
|
|
24
24
|
// using a map because it preserves order
|
|
25
25
|
const rendererTypes = new Map([
|
|
26
26
|
['pileup', 'PileupRenderer'],
|
|
@@ -153,7 +153,11 @@ export function SharedLinearPileupDisplayMixin(configSchema) {
|
|
|
153
153
|
selectFeature(feature) {
|
|
154
154
|
const session = getSession(self);
|
|
155
155
|
if (isSessionModelWithWidgets(session)) {
|
|
156
|
-
const featureWidget = session.addWidget('AlignmentsFeatureWidget', 'alignmentFeature', {
|
|
156
|
+
const featureWidget = session.addWidget('AlignmentsFeatureWidget', 'alignmentFeature', {
|
|
157
|
+
featureData: feature.toJSON(),
|
|
158
|
+
view: getContainingView(self),
|
|
159
|
+
track: getContainingTrack(self),
|
|
160
|
+
});
|
|
157
161
|
session.showWidget(featureWidget);
|
|
158
162
|
}
|
|
159
163
|
session.setSelection(feature);
|
|
@@ -262,18 +266,14 @@ export function SharedLinearPileupDisplayMixin(configSchema) {
|
|
|
262
266
|
icon: MenuOpenIcon,
|
|
263
267
|
onClick: () => {
|
|
264
268
|
self.clearFeatureSelection();
|
|
265
|
-
|
|
266
|
-
self.selectFeature(feat);
|
|
267
|
-
}
|
|
269
|
+
self.selectFeature(feat);
|
|
268
270
|
},
|
|
269
271
|
},
|
|
270
272
|
{
|
|
271
273
|
label: 'Copy info to clipboard',
|
|
272
274
|
icon: ContentCopyIcon,
|
|
273
275
|
onClick: () => {
|
|
274
|
-
|
|
275
|
-
self.copyFeatureToClipboard(feat);
|
|
276
|
-
}
|
|
276
|
+
self.copyFeatureToClipboard(feat);
|
|
277
277
|
},
|
|
278
278
|
},
|
|
279
279
|
]
|
|
@@ -366,27 +366,39 @@ export function SharedLinearPileupDisplayMixin(configSchema) {
|
|
|
366
366
|
return [
|
|
367
367
|
{
|
|
368
368
|
label: 'Normal',
|
|
369
|
-
onClick: () =>
|
|
369
|
+
onClick: () => {
|
|
370
|
+
self.setColorScheme({ type: 'normal' });
|
|
371
|
+
},
|
|
370
372
|
},
|
|
371
373
|
{
|
|
372
374
|
label: 'Mapping quality',
|
|
373
|
-
onClick: () =>
|
|
375
|
+
onClick: () => {
|
|
376
|
+
self.setColorScheme({ type: 'mappingQuality' });
|
|
377
|
+
},
|
|
374
378
|
},
|
|
375
379
|
{
|
|
376
380
|
label: 'Strand',
|
|
377
|
-
onClick: () =>
|
|
381
|
+
onClick: () => {
|
|
382
|
+
self.setColorScheme({ type: 'strand' });
|
|
383
|
+
},
|
|
378
384
|
},
|
|
379
385
|
{
|
|
380
386
|
label: 'Per-base quality',
|
|
381
|
-
onClick: () =>
|
|
387
|
+
onClick: () => {
|
|
388
|
+
self.setColorScheme({ type: 'perBaseQuality' });
|
|
389
|
+
},
|
|
382
390
|
},
|
|
383
391
|
{
|
|
384
392
|
label: 'Per-base lettering',
|
|
385
|
-
onClick: () =>
|
|
393
|
+
onClick: () => {
|
|
394
|
+
self.setColorScheme({ type: 'perBaseLettering' });
|
|
395
|
+
},
|
|
386
396
|
},
|
|
387
397
|
{
|
|
388
398
|
label: 'First-of-pair strand',
|
|
389
|
-
onClick: () =>
|
|
399
|
+
onClick: () => {
|
|
400
|
+
self.setColorScheme({ type: 'stranded' });
|
|
401
|
+
},
|
|
390
402
|
},
|
|
391
403
|
{
|
|
392
404
|
label: 'Color by tag...',
|
|
@@ -406,8 +418,9 @@ export function SharedLinearPileupDisplayMixin(configSchema) {
|
|
|
406
418
|
return [
|
|
407
419
|
...superTrackMenuItems(),
|
|
408
420
|
{
|
|
409
|
-
label: 'Filter by',
|
|
421
|
+
label: 'Filter by...',
|
|
410
422
|
icon: FilterListIcon,
|
|
423
|
+
priority: -1,
|
|
411
424
|
onClick: () => {
|
|
412
425
|
getSession(self).queueDialog(doneCallback => [
|
|
413
426
|
FilterByTagDialog,
|
|
@@ -416,7 +429,8 @@ export function SharedLinearPileupDisplayMixin(configSchema) {
|
|
|
416
429
|
},
|
|
417
430
|
},
|
|
418
431
|
{
|
|
419
|
-
label: 'Set feature height',
|
|
432
|
+
label: 'Set feature height...',
|
|
433
|
+
priority: -1,
|
|
420
434
|
subMenu: [
|
|
421
435
|
{
|
|
422
436
|
label: 'Normal',
|
|
@@ -471,7 +485,11 @@ export function SharedLinearPileupDisplayMixin(configSchema) {
|
|
|
471
485
|
const { colorBy, tagsReady } = self;
|
|
472
486
|
const { staticBlocks } = view;
|
|
473
487
|
if ((colorBy === null || colorBy === void 0 ? void 0 : colorBy.tag) && !tagsReady) {
|
|
474
|
-
const vals = await getUniqueTagValues(
|
|
488
|
+
const vals = await getUniqueTagValues({
|
|
489
|
+
self,
|
|
490
|
+
tag: colorBy.tag,
|
|
491
|
+
blocks: staticBlocks,
|
|
492
|
+
});
|
|
475
493
|
self.updateColorTagMap(vals);
|
|
476
494
|
}
|
|
477
495
|
self.setTagsReady(true);
|
|
@@ -501,7 +519,8 @@ export function SharedLinearPileupDisplayMixin(configSchema) {
|
|
|
501
519
|
// feature.id that was returned e.g. that the user hasn't
|
|
502
520
|
// moused over to a new position during the async operation
|
|
503
521
|
// above
|
|
504
|
-
if (
|
|
522
|
+
if (feature &&
|
|
523
|
+
self.featureIdUnderMouse === feature.uniqueId) {
|
|
505
524
|
self.setFeatureUnderMouse(new SimpleFeature(feature));
|
|
506
525
|
}
|
|
507
526
|
}
|
package/esm/LinearPileupDisplay/components/{ColorByModifications.js → ColorByModificationsDialog.js}
RENAMED
|
@@ -29,6 +29,8 @@ const ColorByModificationsDialog = observer(function ({ model, handleClose, }) {
|
|
|
29
29
|
model.setColorScheme({ type: 'methylation' });
|
|
30
30
|
handleClose();
|
|
31
31
|
} }, "Methylation"),
|
|
32
|
-
React.createElement(Button, { variant: "contained", color: "secondary", onClick: () =>
|
|
32
|
+
React.createElement(Button, { variant: "contained", color: "secondary", onClick: () => {
|
|
33
|
+
handleClose();
|
|
34
|
+
} }, "Cancel")))));
|
|
33
35
|
});
|
|
34
36
|
export default ColorByModificationsDialog;
|
|
@@ -4,12 +4,14 @@ import { Button, DialogContent, DialogActions, TextField, Typography, } from '@m
|
|
|
4
4
|
import { Dialog } from '@jbrowse/core/ui';
|
|
5
5
|
const ColorByTagDialog = observer(function ({ model, handleClose, }) {
|
|
6
6
|
const [tag, setTag] = useState('');
|
|
7
|
-
const validTag =
|
|
7
|
+
const validTag = /^[A-Za-z][A-Za-z0-9]$/.exec(tag);
|
|
8
8
|
return (React.createElement(Dialog, { open: true, onClose: handleClose, title: "Color by tag" },
|
|
9
9
|
React.createElement(DialogContent, { style: { overflowX: 'hidden' } },
|
|
10
10
|
React.createElement(Typography, null, "Enter tag to color by: "),
|
|
11
11
|
React.createElement(Typography, { color: "textSecondary" }, "Examples: XS or TS for RNA-seq inferred read strand, ts (lower-case) for minimap2 read strand, HP for haplotype, RG for read group, etc."),
|
|
12
|
-
React.createElement(TextField, { value: tag, onChange: event =>
|
|
12
|
+
React.createElement(TextField, { value: tag, onChange: event => {
|
|
13
|
+
setTag(event.target.value);
|
|
14
|
+
}, placeholder: "Enter tag name", inputProps: { maxLength: 2 }, error: tag.length === 2 && !validTag, helperText: tag.length === 2 && !validTag ? 'Not a valid tag' : '', autoComplete: "off" }),
|
|
13
15
|
React.createElement(DialogActions, null,
|
|
14
16
|
React.createElement(Button, { variant: "contained", color: "primary", onClick: () => {
|
|
15
17
|
model.setColorScheme({ type: 'tag', tag });
|