@jbrowse/plugin-alignments 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/AlignmentsFeatureDetail/AlignmentsFeatureDetail.d.ts +1 -2
- package/dist/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js +20 -13
- package/dist/AlignmentsFeatureDetail/Flags.d.ts +1 -2
- package/dist/AlignmentsFeatureDetail/Flags.js +6 -8
- package/dist/AlignmentsFeatureDetail/Formatter.d.ts +1 -2
- package/dist/AlignmentsFeatureDetail/Formatter.js +11 -36
- package/dist/AlignmentsFeatureDetail/LaunchPairedEndBreakpointSplitViewPanel.d.ts +1 -2
- package/dist/AlignmentsFeatureDetail/LaunchPairedEndBreakpointSplitViewPanel.js +44 -47
- package/dist/AlignmentsFeatureDetail/LaunchSupplementaryAlignmentBreakpointSplitViewPanel.d.ts +1 -2
- package/dist/AlignmentsFeatureDetail/LaunchSupplementaryAlignmentBreakpointSplitViewPanel.js +27 -31
- package/dist/AlignmentsFeatureDetail/LinkedPairedAlignments.d.ts +1 -2
- package/dist/AlignmentsFeatureDetail/LinkedPairedAlignments.js +2 -2
- package/dist/AlignmentsFeatureDetail/PairLink.d.ts +1 -2
- package/dist/AlignmentsFeatureDetail/PairLink.js +3 -6
- package/dist/AlignmentsFeatureDetail/SupplementaryAlignments.d.ts +1 -2
- package/dist/AlignmentsFeatureDetail/SupplementaryAlignments.js +2 -4
- package/dist/AlignmentsFeatureDetail/SupplementaryAlignmentsLocStrings.d.ts +1 -2
- package/dist/AlignmentsFeatureDetail/SupplementaryAlignmentsLocStrings.js +21 -27
- package/dist/AlignmentsFeatureDetail/index.js +17 -7
- package/dist/BamAdapter/index.js +17 -7
- package/dist/CramAdapter/CramAdapter.js +7 -2
- package/dist/CramAdapter/CramTestAdapters.d.ts +1 -1
- package/dist/CramAdapter/CramTestAdapters.js +2 -1
- package/dist/CramAdapter/index.js +17 -7
- package/dist/GuessAlignmentsTypes/index.js +19 -34
- package/dist/HtsgetBamAdapter/index.js +17 -7
- package/dist/LinearAlignmentsDisplay/components/AlignmentsDisplay.d.ts +1 -2
- package/dist/LinearAlignmentsDisplay/components/AlignmentsDisplay.js +8 -16
- package/dist/LinearAlignmentsDisplay/model.d.ts +1 -2
- package/dist/LinearAlignmentsDisplay/model.js +5 -7
- package/dist/LinearPileupDisplay/SharedLinearPileupDisplayMixin.d.ts +21 -7
- package/dist/LinearPileupDisplay/SharedLinearPileupDisplayMixin.js +40 -15
- package/dist/LinearPileupDisplay/components/ColorByTagDialog.d.ts +1 -2
- package/dist/LinearPileupDisplay/components/ColorByTagDialog.js +10 -39
- package/dist/LinearPileupDisplay/components/GroupByDialog.d.ts +1 -2
- package/dist/LinearPileupDisplay/components/GroupByDialog.js +82 -121
- package/dist/LinearPileupDisplay/components/LinearPileupDisplayBlurb.d.ts +1 -2
- package/dist/LinearPileupDisplay/components/LinearPileupDisplayBlurb.js +2 -6
- package/dist/LinearPileupDisplay/components/SetFeatureHeightDialog.d.ts +1 -2
- package/dist/LinearPileupDisplay/components/SetFeatureHeightDialog.js +13 -42
- package/dist/LinearPileupDisplay/components/SetMaxHeightDialog.d.ts +1 -2
- package/dist/LinearPileupDisplay/components/SetMaxHeightDialog.js +10 -38
- package/dist/LinearPileupDisplay/components/SortByTagDialog.d.ts +1 -2
- package/dist/LinearPileupDisplay/components/SortByTagDialog.js +15 -44
- package/dist/LinearPileupDisplay/model.d.ts +21 -7
- package/dist/LinearPileupDisplay/model.js +19 -8
- package/dist/LinearReadArcsDisplay/components/ReactComponent.d.ts +1 -2
- package/dist/LinearReadArcsDisplay/components/ReactComponent.js +4 -27
- package/dist/LinearReadArcsDisplay/index.js +17 -7
- package/dist/LinearReadArcsDisplay/model.d.ts +1 -1
- package/dist/LinearReadArcsDisplay/model.js +17 -7
- package/dist/LinearReadCloudDisplay/components/ReactComponent.d.ts +1 -2
- package/dist/LinearReadCloudDisplay/components/ReactComponent.js +4 -27
- package/dist/LinearReadCloudDisplay/index.js +17 -7
- package/dist/LinearReadCloudDisplay/model.d.ts +1 -1
- package/dist/LinearReadCloudDisplay/model.js +17 -7
- package/dist/LinearSNPCoverageDisplay/components/Tooltip.d.ts +1 -2
- package/dist/LinearSNPCoverageDisplay/components/Tooltip.js +15 -54
- package/dist/LinearSNPCoverageDisplay/model.d.ts +4 -4
- package/dist/LinearSNPCoverageDisplay/model.js +49 -35
- package/dist/MismatchParser/cigarToMismatches.d.ts +1 -2
- package/dist/MismatchParser/index.d.ts +1 -2
- package/dist/MismatchParser/mdToMismatches.d.ts +1 -2
- package/dist/PileupRenderer/PileupRenderer.d.ts +4 -4
- package/dist/PileupRenderer/PileupRenderer.js +17 -7
- package/dist/PileupRenderer/components/PileupRendering.d.ts +1 -2
- package/dist/PileupRenderer/components/PileupRendering.js +15 -40
- package/dist/PileupRenderer/configSchema.d.ts +5 -0
- package/dist/PileupRenderer/configSchema.js +5 -0
- package/dist/PileupRenderer/makeImageData.js +2 -0
- package/dist/PileupRenderer/renderMismatches.d.ts +2 -1
- package/dist/PileupRenderer/renderMismatches.js +18 -13
- package/dist/SNPCoverageAdapter/index.js +17 -7
- package/dist/SNPCoverageAdapter/processModifications.js +1 -1
- package/dist/SNPCoverageRenderer/SNPCoverageRenderer.d.ts +1 -18
- package/dist/SNPCoverageRenderer/SNPCoverageRenderer.js +35 -264
- package/dist/SNPCoverageRenderer/configSchema.d.ts +3 -3
- package/dist/SNPCoverageRenderer/configSchema.js +3 -3
- package/dist/SNPCoverageRenderer/makeImage.d.ts +2 -0
- package/dist/SNPCoverageRenderer/makeImage.js +270 -0
- package/dist/SNPCoverageRenderer/types.d.ts +19 -0
- package/dist/SNPCoverageRenderer/types.js +2 -0
- package/dist/index.js +17 -7
- package/dist/shared/components/BaseDisplayComponent.d.ts +1 -2
- package/dist/shared/components/BaseDisplayComponent.js +6 -13
- package/dist/shared/components/FilterByTagDialog.d.ts +1 -2
- package/dist/shared/components/FilterByTagDialog.js +42 -92
- package/dist/shared/renderSvgUtil.d.ts +1 -2
- package/dist/shared/renderSvgUtil.js +20 -17
- package/esm/AlignmentsFeatureDetail/AlignmentsFeatureDetail.d.ts +1 -2
- package/esm/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js +3 -6
- package/esm/AlignmentsFeatureDetail/Flags.d.ts +1 -2
- package/esm/AlignmentsFeatureDetail/Flags.js +6 -8
- package/esm/AlignmentsFeatureDetail/Formatter.d.ts +1 -2
- package/esm/AlignmentsFeatureDetail/Formatter.js +11 -13
- package/esm/AlignmentsFeatureDetail/LaunchPairedEndBreakpointSplitViewPanel.d.ts +1 -2
- package/esm/AlignmentsFeatureDetail/LaunchPairedEndBreakpointSplitViewPanel.js +27 -40
- package/esm/AlignmentsFeatureDetail/LaunchSupplementaryAlignmentBreakpointSplitViewPanel.d.ts +1 -2
- package/esm/AlignmentsFeatureDetail/LaunchSupplementaryAlignmentBreakpointSplitViewPanel.js +10 -24
- package/esm/AlignmentsFeatureDetail/LinkedPairedAlignments.d.ts +1 -2
- package/esm/AlignmentsFeatureDetail/LinkedPairedAlignments.js +2 -2
- package/esm/AlignmentsFeatureDetail/PairLink.d.ts +1 -2
- package/esm/AlignmentsFeatureDetail/PairLink.js +3 -3
- package/esm/AlignmentsFeatureDetail/SupplementaryAlignments.d.ts +1 -2
- package/esm/AlignmentsFeatureDetail/SupplementaryAlignments.js +2 -4
- package/esm/AlignmentsFeatureDetail/SupplementaryAlignmentsLocStrings.d.ts +1 -2
- package/esm/AlignmentsFeatureDetail/SupplementaryAlignmentsLocStrings.js +21 -24
- package/esm/CramAdapter/CramAdapter.js +7 -2
- package/esm/CramAdapter/CramTestAdapters.d.ts +1 -1
- package/esm/CramAdapter/CramTestAdapters.js +2 -1
- package/esm/GuessAlignmentsTypes/index.js +19 -34
- package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.d.ts +1 -2
- package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.js +8 -13
- package/esm/LinearAlignmentsDisplay/model.d.ts +1 -2
- package/esm/LinearAlignmentsDisplay/model.js +5 -7
- package/esm/LinearPileupDisplay/SharedLinearPileupDisplayMixin.d.ts +21 -7
- package/esm/LinearPileupDisplay/SharedLinearPileupDisplayMixin.js +23 -8
- package/esm/LinearPileupDisplay/components/ColorByTagDialog.d.ts +1 -2
- package/esm/LinearPileupDisplay/components/ColorByTagDialog.js +10 -16
- package/esm/LinearPileupDisplay/components/GroupByDialog.d.ts +1 -2
- package/esm/LinearPileupDisplay/components/GroupByDialog.js +82 -98
- package/esm/LinearPileupDisplay/components/LinearPileupDisplayBlurb.d.ts +1 -2
- package/esm/LinearPileupDisplay/components/LinearPileupDisplayBlurb.js +2 -3
- package/esm/LinearPileupDisplay/components/SetFeatureHeightDialog.d.ts +1 -2
- package/esm/LinearPileupDisplay/components/SetFeatureHeightDialog.js +13 -19
- package/esm/LinearPileupDisplay/components/SetMaxHeightDialog.d.ts +1 -2
- package/esm/LinearPileupDisplay/components/SetMaxHeightDialog.js +10 -15
- package/esm/LinearPileupDisplay/components/SortByTagDialog.d.ts +1 -2
- package/esm/LinearPileupDisplay/components/SortByTagDialog.js +15 -21
- package/esm/LinearPileupDisplay/model.d.ts +21 -7
- package/esm/LinearPileupDisplay/model.js +2 -1
- package/esm/LinearReadArcsDisplay/components/ReactComponent.d.ts +1 -2
- package/esm/LinearReadArcsDisplay/components/ReactComponent.js +4 -4
- package/esm/LinearReadArcsDisplay/model.d.ts +1 -1
- package/esm/LinearReadCloudDisplay/components/ReactComponent.d.ts +1 -2
- package/esm/LinearReadCloudDisplay/components/ReactComponent.js +4 -4
- package/esm/LinearReadCloudDisplay/model.d.ts +1 -1
- package/esm/LinearSNPCoverageDisplay/components/Tooltip.d.ts +1 -2
- package/esm/LinearSNPCoverageDisplay/components/Tooltip.js +15 -51
- package/esm/LinearSNPCoverageDisplay/model.d.ts +4 -4
- package/esm/LinearSNPCoverageDisplay/model.js +32 -28
- package/esm/MismatchParser/cigarToMismatches.d.ts +1 -2
- package/esm/MismatchParser/index.d.ts +1 -2
- package/esm/MismatchParser/mdToMismatches.d.ts +1 -2
- package/esm/PileupRenderer/PileupRenderer.d.ts +4 -4
- package/esm/PileupRenderer/components/PileupRendering.d.ts +1 -2
- package/esm/PileupRenderer/components/PileupRendering.js +15 -17
- package/esm/PileupRenderer/configSchema.d.ts +5 -0
- package/esm/PileupRenderer/configSchema.js +5 -0
- package/esm/PileupRenderer/makeImageData.js +2 -0
- package/esm/PileupRenderer/renderMismatches.d.ts +2 -1
- package/esm/PileupRenderer/renderMismatches.js +18 -13
- package/esm/SNPCoverageAdapter/processModifications.js +1 -1
- package/esm/SNPCoverageRenderer/SNPCoverageRenderer.d.ts +1 -18
- package/esm/SNPCoverageRenderer/SNPCoverageRenderer.js +3 -265
- package/esm/SNPCoverageRenderer/configSchema.d.ts +3 -3
- package/esm/SNPCoverageRenderer/configSchema.js +3 -3
- package/esm/SNPCoverageRenderer/makeImage.d.ts +2 -0
- package/esm/SNPCoverageRenderer/makeImage.js +267 -0
- package/esm/SNPCoverageRenderer/types.d.ts +19 -0
- package/esm/SNPCoverageRenderer/types.js +1 -0
- package/esm/shared/components/BaseDisplayComponent.d.ts +1 -2
- package/esm/shared/components/BaseDisplayComponent.js +6 -10
- package/esm/shared/components/FilterByTagDialog.d.ts +1 -2
- package/esm/shared/components/FilterByTagDialog.js +42 -69
- package/esm/shared/renderSvgUtil.d.ts +1 -2
- package/esm/shared/renderSvgUtil.js +3 -7
- package/package.json +13 -13
|
@@ -9,17 +9,17 @@ declare const SNPCoverageRenderer: import("@jbrowse/core/configuration/configura
|
|
|
9
9
|
description: string;
|
|
10
10
|
defaultValue: number;
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
showArcs: {
|
|
13
13
|
type: string;
|
|
14
14
|
description: string;
|
|
15
15
|
defaultValue: boolean;
|
|
16
16
|
};
|
|
17
|
-
|
|
17
|
+
showInterbaseCounts: {
|
|
18
18
|
type: string;
|
|
19
19
|
description: string;
|
|
20
20
|
defaultValue: boolean;
|
|
21
21
|
};
|
|
22
|
-
|
|
22
|
+
showInterbaseIndicators: {
|
|
23
23
|
type: string;
|
|
24
24
|
description: string;
|
|
25
25
|
defaultValue: boolean;
|
|
@@ -13,17 +13,17 @@ const SNPCoverageRenderer = (0, configuration_1.ConfigurationSchema)('SNPCoverag
|
|
|
13
13
|
description: 'the proportion of reads containing a insertion/clip indicator',
|
|
14
14
|
defaultValue: 0.4,
|
|
15
15
|
},
|
|
16
|
-
|
|
16
|
+
showArcs: {
|
|
17
17
|
type: 'boolean',
|
|
18
18
|
description: 'Draw sashimi-style arcs for intron features',
|
|
19
19
|
defaultValue: true,
|
|
20
20
|
},
|
|
21
|
-
|
|
21
|
+
showInterbaseCounts: {
|
|
22
22
|
type: 'boolean',
|
|
23
23
|
description: 'draw count "upsidedown histogram" of the interbase events that don\'t contribute to the coverage count so are not drawn in the normal histogram',
|
|
24
24
|
defaultValue: true,
|
|
25
25
|
},
|
|
26
|
-
|
|
26
|
+
showInterbaseIndicators: {
|
|
27
27
|
type: 'boolean',
|
|
28
28
|
description: 'draw a triangular indicator where an event has been detected',
|
|
29
29
|
defaultValue: true,
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeImage = makeImage;
|
|
4
|
+
const configuration_1 = require("@jbrowse/core/configuration");
|
|
5
|
+
const ui_1 = require("@jbrowse/core/ui");
|
|
6
|
+
const util_1 = require("@jbrowse/core/util");
|
|
7
|
+
const stopToken_1 = require("@jbrowse/core/util/stopToken");
|
|
8
|
+
const plugin_wiggle_1 = require("@jbrowse/plugin-wiggle");
|
|
9
|
+
const util_2 = require("../shared/util");
|
|
10
|
+
const INTERBASE_INDICATOR_WIDTH = 7;
|
|
11
|
+
const INTERBASE_INDICATOR_HEIGHT = 4.5;
|
|
12
|
+
const MINIMUM_INTERBASE_INDICATOR_READ_DEPTH = 7;
|
|
13
|
+
const complementBase = {
|
|
14
|
+
C: 'G',
|
|
15
|
+
G: 'C',
|
|
16
|
+
A: 'T',
|
|
17
|
+
T: 'A',
|
|
18
|
+
};
|
|
19
|
+
const fudgeFactor = 0.6;
|
|
20
|
+
async function makeImage(ctx, props) {
|
|
21
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
22
|
+
const { features, regions, bpPerPx, colorBy, displayCrossHatches, visibleModifications = {}, scaleOpts, height: unadjustedHeight, theme: configTheme, config: cfg, ticks, stopToken, } = props;
|
|
23
|
+
const theme = (0, ui_1.createJBrowseTheme)(configTheme);
|
|
24
|
+
const region = regions[0];
|
|
25
|
+
const width = (region.end - region.start) / bpPerPx;
|
|
26
|
+
const offset = plugin_wiggle_1.YSCALEBAR_LABEL_OFFSET;
|
|
27
|
+
const height = unadjustedHeight - offset * 2;
|
|
28
|
+
const opts = { ...scaleOpts, range: [0, height] };
|
|
29
|
+
const viewScale = (0, plugin_wiggle_1.getScale)(opts);
|
|
30
|
+
const indicatorViewScale = (0, plugin_wiggle_1.getScale)({
|
|
31
|
+
...opts,
|
|
32
|
+
range: [0, height / 2],
|
|
33
|
+
scaleType: 'linear',
|
|
34
|
+
});
|
|
35
|
+
const originY = (0, plugin_wiggle_1.getOrigin)(scaleOpts.scaleType);
|
|
36
|
+
const originLinear = (0, plugin_wiggle_1.getOrigin)('linear');
|
|
37
|
+
const indicatorThreshold = (0, configuration_1.readConfObject)(cfg, 'indicatorThreshold');
|
|
38
|
+
const showInterbaseCounts = (0, configuration_1.readConfObject)(cfg, 'showInterbaseCounts');
|
|
39
|
+
const showArcs = (0, configuration_1.readConfObject)(cfg, 'showArcs');
|
|
40
|
+
const showInterbaseIndicators = (0, configuration_1.readConfObject)(cfg, 'showInterbaseIndicators');
|
|
41
|
+
const toY = (n) => height - (viewScale(n) || 0) + offset;
|
|
42
|
+
const toHeight = (n) => toY(originY) - toY(n);
|
|
43
|
+
const toY2 = (n) => height - (indicatorViewScale(n) || 0) + offset;
|
|
44
|
+
const toHeight2 = (n) => toY2(originLinear) - toY2(n);
|
|
45
|
+
const { bases } = theme.palette;
|
|
46
|
+
const colorForBase = {
|
|
47
|
+
A: bases.A.main,
|
|
48
|
+
C: bases.C.main,
|
|
49
|
+
G: bases.G.main,
|
|
50
|
+
T: bases.T.main,
|
|
51
|
+
insertion: 'purple',
|
|
52
|
+
softclip: 'blue',
|
|
53
|
+
hardclip: 'red',
|
|
54
|
+
total: (0, configuration_1.readConfObject)(cfg, 'color'),
|
|
55
|
+
mod_NONE: 'blue',
|
|
56
|
+
cpg_meth: 'red',
|
|
57
|
+
cpg_unmeth: 'blue',
|
|
58
|
+
};
|
|
59
|
+
const feats = [...features.values()];
|
|
60
|
+
ctx.fillStyle = colorForBase.total;
|
|
61
|
+
let start = performance.now();
|
|
62
|
+
for (const feature of feats) {
|
|
63
|
+
if (feature.get('type') === 'skip') {
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
const [leftPx, rightPx] = (0, util_1.featureSpanPx)(feature, region, bpPerPx);
|
|
67
|
+
const w = rightPx - leftPx + fudgeFactor;
|
|
68
|
+
const score = feature.get('score');
|
|
69
|
+
ctx.fillRect(leftPx, toY(score), w, toHeight(score));
|
|
70
|
+
if (performance.now() - start > 400) {
|
|
71
|
+
(0, stopToken_1.checkStopToken)(stopToken);
|
|
72
|
+
start = performance.now();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
let prevTotal = 0;
|
|
76
|
+
const extraHorizontallyFlippedOffset = region.reversed ? 1 / bpPerPx : 0;
|
|
77
|
+
const drawingModifications = colorBy.type === 'modifications';
|
|
78
|
+
const drawingMethylation = colorBy.type === 'methylation';
|
|
79
|
+
const isolatedModification = (_a = colorBy.modifications) === null || _a === void 0 ? void 0 : _a.isolatedModification;
|
|
80
|
+
start = performance.now();
|
|
81
|
+
for (const feature of feats) {
|
|
82
|
+
const now = performance.now();
|
|
83
|
+
if (now - start > 400) {
|
|
84
|
+
(0, stopToken_1.checkStopToken)(stopToken);
|
|
85
|
+
}
|
|
86
|
+
if (feature.get('type') === 'skip') {
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
const [leftPx, rightPx] = (0, util_1.featureSpanPx)(feature, region, bpPerPx);
|
|
90
|
+
const snpinfo = feature.get('snpinfo');
|
|
91
|
+
const w = Math.max(rightPx - leftPx, 1);
|
|
92
|
+
const score0 = feature.get('score');
|
|
93
|
+
if (drawingModifications) {
|
|
94
|
+
let curr = 0;
|
|
95
|
+
const refbase = (_b = snpinfo.refbase) === null || _b === void 0 ? void 0 : _b.toUpperCase();
|
|
96
|
+
const { nonmods, mods, snps, ref } = snpinfo;
|
|
97
|
+
for (const m of Object.keys(nonmods).sort().reverse()) {
|
|
98
|
+
const mod = visibleModifications[m.replace('nonmod_', '')] ||
|
|
99
|
+
visibleModifications[m.replace('mod_', '')];
|
|
100
|
+
if (!mod) {
|
|
101
|
+
console.warn(`${m} not known yet`);
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
if (isolatedModification && mod.type !== isolatedModification) {
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
const cmp = complementBase[mod.base];
|
|
108
|
+
const detectable = mod.base === 'N'
|
|
109
|
+
? score0
|
|
110
|
+
: (((_c = snps[mod.base]) === null || _c === void 0 ? void 0 : _c.entryDepth) || 0) +
|
|
111
|
+
(((_d = snps[cmp]) === null || _d === void 0 ? void 0 : _d.entryDepth) || 0) +
|
|
112
|
+
(refbase === mod.base ? ref['1'] : 0) +
|
|
113
|
+
(refbase === cmp ? ref['-1'] : 0);
|
|
114
|
+
const modifiable = mod.base === 'N'
|
|
115
|
+
? score0
|
|
116
|
+
: (((_e = snps[mod.base]) === null || _e === void 0 ? void 0 : _e.entryDepth) || 0) +
|
|
117
|
+
(((_f = snps[cmp]) === null || _f === void 0 ? void 0 : _f.entryDepth) || 0) +
|
|
118
|
+
(refbase === mod.base ? ref.entryDepth : 0) +
|
|
119
|
+
(refbase === cmp ? ref.entryDepth : 0);
|
|
120
|
+
const { entryDepth, avgProbability = 0 } = snpinfo.nonmods[m];
|
|
121
|
+
const modFraction = (modifiable / score0) * (entryDepth / detectable);
|
|
122
|
+
const nonModColor = 'blue';
|
|
123
|
+
const c = (0, util_2.alphaColor)(nonModColor, avgProbability);
|
|
124
|
+
const height = toHeight(score0);
|
|
125
|
+
const bottom = toY(score0) + height;
|
|
126
|
+
ctx.fillStyle = c;
|
|
127
|
+
ctx.fillRect(Math.round(leftPx), bottom - (curr + modFraction * height), w, modFraction * height);
|
|
128
|
+
curr += modFraction * height;
|
|
129
|
+
}
|
|
130
|
+
for (const m of Object.keys(mods).sort().reverse()) {
|
|
131
|
+
const mod = visibleModifications[m.replace('mod_', '')];
|
|
132
|
+
if (!mod) {
|
|
133
|
+
console.warn(`${m} not known yet`);
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
if (isolatedModification && mod.type !== isolatedModification) {
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
const cmp = complementBase[mod.base];
|
|
140
|
+
const detectable = mod.base === 'N'
|
|
141
|
+
? score0
|
|
142
|
+
: (((_g = snps[mod.base]) === null || _g === void 0 ? void 0 : _g.entryDepth) || 0) +
|
|
143
|
+
(((_h = snps[cmp]) === null || _h === void 0 ? void 0 : _h.entryDepth) || 0) +
|
|
144
|
+
(refbase === mod.base ? ref['1'] : 0) +
|
|
145
|
+
(refbase === cmp ? ref['-1'] : 0);
|
|
146
|
+
const modifiable = mod.base === 'N'
|
|
147
|
+
? score0
|
|
148
|
+
: (((_j = snps[mod.base]) === null || _j === void 0 ? void 0 : _j.entryDepth) || 0) +
|
|
149
|
+
(((_k = snps[cmp]) === null || _k === void 0 ? void 0 : _k.entryDepth) || 0) +
|
|
150
|
+
(refbase === mod.base ? ref.entryDepth : 0) +
|
|
151
|
+
(refbase === cmp ? ref.entryDepth : 0);
|
|
152
|
+
const { entryDepth, avgProbability = 0 } = mods[m];
|
|
153
|
+
const modFraction = (modifiable / score0) * (entryDepth / detectable);
|
|
154
|
+
const baseColor = mod.color || 'black';
|
|
155
|
+
const c = (0, util_2.alphaColor)(baseColor, avgProbability);
|
|
156
|
+
const height = toHeight(score0);
|
|
157
|
+
const bottom = toY(score0) + height;
|
|
158
|
+
ctx.fillStyle = c;
|
|
159
|
+
ctx.fillRect(Math.round(leftPx), bottom - (curr + modFraction * height), w, modFraction * height);
|
|
160
|
+
curr += modFraction * height;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
else if (drawingMethylation) {
|
|
164
|
+
const { depth, nonmods, mods } = snpinfo;
|
|
165
|
+
let curr = 0;
|
|
166
|
+
for (const base of Object.keys(mods).sort().reverse()) {
|
|
167
|
+
const { entryDepth } = mods[base];
|
|
168
|
+
const height = toHeight(score0);
|
|
169
|
+
const bottom = toY(score0) + height;
|
|
170
|
+
ctx.fillStyle = colorForBase[base] || 'black';
|
|
171
|
+
ctx.fillRect(Math.round(leftPx), bottom - ((entryDepth + curr) / depth) * height, w, (entryDepth / depth) * height);
|
|
172
|
+
curr += entryDepth;
|
|
173
|
+
}
|
|
174
|
+
for (const base of Object.keys(nonmods).sort().reverse()) {
|
|
175
|
+
const { entryDepth } = nonmods[base];
|
|
176
|
+
const height = toHeight(score0);
|
|
177
|
+
const bottom = toY(score0) + height;
|
|
178
|
+
ctx.fillStyle = colorForBase[base] || 'black';
|
|
179
|
+
ctx.fillRect(Math.round(leftPx), bottom - ((entryDepth + curr) / depth) * height, w, (entryDepth / depth) * height);
|
|
180
|
+
curr += entryDepth;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
const { depth, snps } = snpinfo;
|
|
185
|
+
let curr = 0;
|
|
186
|
+
for (const base of Object.keys(snps).sort().reverse()) {
|
|
187
|
+
const { entryDepth } = snps[base];
|
|
188
|
+
const height = toHeight(score0);
|
|
189
|
+
const bottom = toY(score0) + height;
|
|
190
|
+
ctx.fillStyle = colorForBase[base] || 'black';
|
|
191
|
+
ctx.fillRect(Math.round(leftPx), bottom - ((entryDepth + curr) / depth) * height, w, (entryDepth / depth) * height);
|
|
192
|
+
curr += entryDepth;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
const interbaseEvents = Object.keys(snpinfo.noncov);
|
|
196
|
+
if (showInterbaseCounts) {
|
|
197
|
+
let curr = 0;
|
|
198
|
+
for (const base of interbaseEvents) {
|
|
199
|
+
const { entryDepth } = snpinfo.noncov[base];
|
|
200
|
+
const r = 0.6;
|
|
201
|
+
ctx.fillStyle = colorForBase[base];
|
|
202
|
+
ctx.fillRect(leftPx - r + extraHorizontallyFlippedOffset, INTERBASE_INDICATOR_HEIGHT + toHeight2(curr), r * 2, toHeight2(entryDepth));
|
|
203
|
+
curr += entryDepth;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
if (showInterbaseIndicators) {
|
|
207
|
+
let accum = 0;
|
|
208
|
+
let max = 0;
|
|
209
|
+
let maxBase = '';
|
|
210
|
+
for (const base of interbaseEvents) {
|
|
211
|
+
const { entryDepth } = snpinfo.noncov[base];
|
|
212
|
+
accum += entryDepth;
|
|
213
|
+
if (entryDepth > max) {
|
|
214
|
+
max = entryDepth;
|
|
215
|
+
maxBase = base;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
const indicatorComparatorScore = Math.max(score0, prevTotal);
|
|
219
|
+
if (accum > indicatorComparatorScore * indicatorThreshold &&
|
|
220
|
+
indicatorComparatorScore > MINIMUM_INTERBASE_INDICATOR_READ_DEPTH) {
|
|
221
|
+
ctx.fillStyle = colorForBase[maxBase];
|
|
222
|
+
ctx.beginPath();
|
|
223
|
+
const l = leftPx + extraHorizontallyFlippedOffset;
|
|
224
|
+
ctx.moveTo(l - INTERBASE_INDICATOR_WIDTH / 2, 0);
|
|
225
|
+
ctx.lineTo(l + INTERBASE_INDICATOR_WIDTH / 2, 0);
|
|
226
|
+
ctx.lineTo(l, INTERBASE_INDICATOR_HEIGHT);
|
|
227
|
+
ctx.fill();
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
prevTotal = score0;
|
|
231
|
+
}
|
|
232
|
+
if (showArcs) {
|
|
233
|
+
for (const f of feats) {
|
|
234
|
+
if (f.get('type') !== 'skip') {
|
|
235
|
+
continue;
|
|
236
|
+
}
|
|
237
|
+
const s = f.get('start');
|
|
238
|
+
const e = f.get('end');
|
|
239
|
+
const [left, right] = (0, util_1.bpSpanPx)(s, e, region, bpPerPx);
|
|
240
|
+
ctx.beginPath();
|
|
241
|
+
const effectiveStrand = f.get('effectiveStrand');
|
|
242
|
+
const pos = 'rgba(255,200,200,0.7)';
|
|
243
|
+
const neg = 'rgba(200,200,255,0.7)';
|
|
244
|
+
const neutral = 'rgba(200,200,200,0.7)';
|
|
245
|
+
if (effectiveStrand === 1) {
|
|
246
|
+
ctx.strokeStyle = pos;
|
|
247
|
+
}
|
|
248
|
+
else if (effectiveStrand === -1) {
|
|
249
|
+
ctx.strokeStyle = neg;
|
|
250
|
+
}
|
|
251
|
+
else {
|
|
252
|
+
ctx.strokeStyle = neutral;
|
|
253
|
+
}
|
|
254
|
+
ctx.lineWidth = Math.log(f.get('score') + 1);
|
|
255
|
+
ctx.moveTo(left, height - offset * 2);
|
|
256
|
+
ctx.bezierCurveTo(left, 0, right, 0, right, height - offset * 2);
|
|
257
|
+
ctx.stroke();
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
if (displayCrossHatches) {
|
|
261
|
+
ctx.lineWidth = 1;
|
|
262
|
+
ctx.strokeStyle = 'rgba(140,140,140,0.8)';
|
|
263
|
+
for (const tick of ticks.values) {
|
|
264
|
+
ctx.beginPath();
|
|
265
|
+
ctx.moveTo(0, Math.round(toY(tick)));
|
|
266
|
+
ctx.lineTo(width, Math.round(toY(tick)));
|
|
267
|
+
ctx.stroke();
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ColorBy, ModificationTypeWithColor } from '../shared/types';
|
|
2
|
+
import type { RenderArgsDeserialized as FeatureRenderArgsDeserialized } from '@jbrowse/core/pluggableElementTypes/renderers/FeatureRendererType';
|
|
3
|
+
import type { Feature } from '@jbrowse/core/util';
|
|
4
|
+
import type { ScaleOpts } from '@jbrowse/plugin-wiggle';
|
|
5
|
+
export interface RenderArgsDeserialized extends FeatureRenderArgsDeserialized {
|
|
6
|
+
bpPerPx: number;
|
|
7
|
+
height: number;
|
|
8
|
+
highResolutionScaling: number;
|
|
9
|
+
scaleOpts: ScaleOpts;
|
|
10
|
+
}
|
|
11
|
+
export interface RenderArgsDeserializedWithFeatures extends RenderArgsDeserialized {
|
|
12
|
+
features: Map<string, Feature>;
|
|
13
|
+
ticks: {
|
|
14
|
+
values: number[];
|
|
15
|
+
};
|
|
16
|
+
displayCrossHatches: boolean;
|
|
17
|
+
visibleModifications?: Record<string, ModificationTypeWithColor>;
|
|
18
|
+
colorBy: ColorBy;
|
|
19
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { LinearReadArcsDisplayModel } from '../../LinearReadArcsDisplay/model';
|
|
3
2
|
import type { LinearReadCloudDisplayModel } from '../../LinearReadCloudDisplay/model';
|
|
4
3
|
declare const BaseDisplayComponent: ({ model, children, }: {
|
|
5
4
|
model: LinearReadArcsDisplayModel | LinearReadCloudDisplayModel;
|
|
6
5
|
children?: React.ReactNode;
|
|
7
|
-
}) =>
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
7
|
export default BaseDisplayComponent;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
4
|
const ui_1 = require("@jbrowse/core/ui");
|
|
8
5
|
const util_1 = require("@jbrowse/core/util");
|
|
9
6
|
const plugin_linear_genome_view_1 = require("@jbrowse/plugin-linear-genome-view");
|
|
@@ -25,27 +22,23 @@ const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
|
25
22
|
}));
|
|
26
23
|
const BlockError = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
27
24
|
const { error } = model;
|
|
28
|
-
return (
|
|
29
|
-
react_1.default.createElement(material_1.Button, { "data-testid": "reload_button", onClick: () => {
|
|
25
|
+
return ((0, jsx_runtime_1.jsx)(plugin_linear_genome_view_1.BlockMsg, { message: `${error}`, severity: "error", action: (0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: "Reload", children: (0, jsx_runtime_1.jsx)(material_1.Button, { "data-testid": "reload_button", onClick: () => {
|
|
30
26
|
model.reload();
|
|
31
|
-
}
|
|
27
|
+
}, children: "Reload" }) }) }));
|
|
32
28
|
});
|
|
33
29
|
const BaseDisplayComponent = (0, mobx_react_1.observer)(function ({ model, children, }) {
|
|
34
30
|
const { error, regionTooLarge } = model;
|
|
35
|
-
return error ? (
|
|
31
|
+
return error ? ((0, jsx_runtime_1.jsx)(BlockError, { model: model })) : regionTooLarge ? (model.regionCannotBeRendered()) : ((0, jsx_runtime_1.jsx)(DataDisplay, { model: model, children: children }));
|
|
36
32
|
});
|
|
37
33
|
const DataDisplay = (0, mobx_react_1.observer)(function ({ model, children, }) {
|
|
38
34
|
const { drawn, loading } = model;
|
|
39
35
|
const view = (0, util_1.getContainingView)(model);
|
|
40
36
|
const left = (model.lastDrawnOffsetPx || 0) - view.offsetPx;
|
|
41
|
-
return (
|
|
42
|
-
react_1.default.createElement("div", { style: { position: 'absolute', left } }, children),
|
|
43
|
-
left !== 0 || loading ? react_1.default.createElement(LoadingBar, { model: model }) : null));
|
|
37
|
+
return ((0, jsx_runtime_1.jsxs)("div", { "data-testid": `drawn-${drawn}`, children: [(0, jsx_runtime_1.jsx)("div", { style: { position: 'absolute', left }, children: children }), left !== 0 || loading ? (0, jsx_runtime_1.jsx)(LoadingBar, { model: model }) : null] }));
|
|
44
38
|
});
|
|
45
39
|
const LoadingBar = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
46
40
|
const { classes } = useStyles();
|
|
47
41
|
const { message } = model;
|
|
48
|
-
return (
|
|
49
|
-
react_1.default.createElement(ui_1.LoadingEllipses, { message: message })));
|
|
42
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: classes.loading, children: (0, jsx_runtime_1.jsx)(ui_1.LoadingEllipses, { message: message }) }));
|
|
50
43
|
});
|
|
51
44
|
exports.default = BaseDisplayComponent;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { FilterBy } from '../types';
|
|
3
2
|
declare const FilterByTagDialog: (props: {
|
|
4
3
|
model: {
|
|
@@ -6,5 +5,5 @@ declare const FilterByTagDialog: (props: {
|
|
|
6
5
|
setFilterBy: (arg: FilterBy) => void;
|
|
7
6
|
};
|
|
8
7
|
handleClose: () => void;
|
|
9
|
-
}) =>
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
9
|
export default FilterByTagDialog;
|
|
@@ -1,29 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
const
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const react_1 = require("react");
|
|
27
5
|
const ui_1 = require("@jbrowse/core/ui");
|
|
28
6
|
const material_1 = require("@mui/material");
|
|
29
7
|
const mobx_react_1 = require("mobx-react");
|
|
@@ -53,24 +31,20 @@ const flagNames = [
|
|
|
53
31
|
];
|
|
54
32
|
function Bitmask(props) {
|
|
55
33
|
const { flag = 0, setFlag } = props;
|
|
56
|
-
return (
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
} }),
|
|
72
|
-
react_1.default.createElement("label", { htmlFor: key }, name)));
|
|
73
|
-
})));
|
|
34
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.TextField, { type: "number", value: flag, onChange: event => {
|
|
35
|
+
setFlag(+event.target.value);
|
|
36
|
+
} }), flagNames.map((name, index) => {
|
|
37
|
+
const val = flag & (1 << index);
|
|
38
|
+
const key = `${name}_${val}`;
|
|
39
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("input", { type: "checkbox", checked: Boolean(val), onChange: event => {
|
|
40
|
+
if (event.target.checked) {
|
|
41
|
+
setFlag(flag | (1 << index));
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
setFlag(flag & ~(1 << index));
|
|
45
|
+
}
|
|
46
|
+
} }), (0, jsx_runtime_1.jsx)("label", { htmlFor: key, children: name })] }, key));
|
|
47
|
+
})] }));
|
|
74
48
|
}
|
|
75
49
|
const FilterByTagDialog = (0, mobx_react_1.observer)(function (props) {
|
|
76
50
|
var _a, _b;
|
|
@@ -84,55 +58,31 @@ const FilterByTagDialog = (0, mobx_react_1.observer)(function (props) {
|
|
|
84
58
|
const [readName, setReadName] = (0, react_1.useState)(filterBy.readName || '');
|
|
85
59
|
const validTag = /^[A-Za-z][A-Za-z0-9]$/.exec(tag);
|
|
86
60
|
const site = 'https://broadinstitute.github.io/picard/explain-flags.html';
|
|
87
|
-
return (
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}, placeholder: "Enter tag value" })),
|
|
114
|
-
react_1.default.createElement(material_1.Paper, { className: classes.paper, variant: "outlined" },
|
|
115
|
-
react_1.default.createElement(material_1.Typography, null, "Filter by read name"),
|
|
116
|
-
react_1.default.createElement(material_1.TextField, { className: classes.field, value: readName, onChange: event => {
|
|
117
|
-
setReadName(event.target.value);
|
|
118
|
-
}, placeholder: "Enter read name" })),
|
|
119
|
-
react_1.default.createElement(material_1.DialogActions, null,
|
|
120
|
-
react_1.default.createElement(material_1.Button, { variant: "contained", color: "primary", autoFocus: true, type: "submit", onClick: () => {
|
|
121
|
-
model.setFilterBy({
|
|
122
|
-
flagInclude,
|
|
123
|
-
flagExclude,
|
|
124
|
-
readName,
|
|
125
|
-
tagFilter: tag !== ''
|
|
126
|
-
? {
|
|
127
|
-
tag,
|
|
128
|
-
value: tagValue,
|
|
129
|
-
}
|
|
130
|
-
: undefined,
|
|
131
|
-
});
|
|
132
|
-
handleClose();
|
|
133
|
-
} }, "Submit"),
|
|
134
|
-
react_1.default.createElement(material_1.Button, { variant: "contained", color: "secondary", onClick: () => {
|
|
135
|
-
handleClose();
|
|
136
|
-
} }, "Cancel")))));
|
|
61
|
+
return ((0, jsx_runtime_1.jsx)(ui_1.Dialog, { open: true, onClose: handleClose, title: "Filter options", children: (0, jsx_runtime_1.jsxs)(material_1.DialogContent, { children: [(0, jsx_runtime_1.jsxs)(material_1.Typography, { children: ["Set filter bitmask options. Refer to ", (0, jsx_runtime_1.jsx)(material_1.Link, { href: site, children: site }), ' ', "for details"] }), (0, jsx_runtime_1.jsx)(material_1.Paper, { className: classes.paper, variant: "outlined", children: (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex' }, children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: "Read must have ALL these flags" }), (0, jsx_runtime_1.jsx)(Bitmask, { flag: flagInclude, setFlag: setFlagInclude })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: "Read must have NONE of these flags" }), (0, jsx_runtime_1.jsx)(Bitmask, { flag: flagExclude, setFlag: setFlagExclude })] })] }) }), (0, jsx_runtime_1.jsxs)(material_1.Paper, { className: classes.paper, variant: "outlined", children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: "Filter by tag name and value. Use * in the value field to get all reads containing any value for that tag. Example: filter tag name SA with value * to get all split/supplementary reads. Other examples include HP for haplotype, or RG for read group" }), (0, jsx_runtime_1.jsx)(material_1.TextField, { className: classes.field, value: tag, onChange: event => {
|
|
62
|
+
setTag(event.target.value);
|
|
63
|
+
}, placeholder: "Enter tag name", error: tag.length === 2 && !validTag, helperText: tag.length === 2 && !validTag ? 'Not a valid tag' : '', slotProps: {
|
|
64
|
+
htmlInput: {
|
|
65
|
+
maxLength: 2,
|
|
66
|
+
},
|
|
67
|
+
} }), (0, jsx_runtime_1.jsx)(material_1.TextField, { className: classes.field, value: tagValue, onChange: event => {
|
|
68
|
+
setTagValue(event.target.value);
|
|
69
|
+
}, placeholder: "Enter tag value" })] }), (0, jsx_runtime_1.jsxs)(material_1.Paper, { className: classes.paper, variant: "outlined", children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: "Filter by read name" }), (0, jsx_runtime_1.jsx)(material_1.TextField, { className: classes.field, value: readName, onChange: event => {
|
|
70
|
+
setReadName(event.target.value);
|
|
71
|
+
}, placeholder: "Enter read name" })] }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", color: "primary", autoFocus: true, type: "submit", onClick: () => {
|
|
72
|
+
model.setFilterBy({
|
|
73
|
+
flagInclude,
|
|
74
|
+
flagExclude,
|
|
75
|
+
readName,
|
|
76
|
+
tagFilter: tag !== ''
|
|
77
|
+
? {
|
|
78
|
+
tag,
|
|
79
|
+
value: tagValue,
|
|
80
|
+
}
|
|
81
|
+
: undefined,
|
|
82
|
+
});
|
|
83
|
+
handleClose();
|
|
84
|
+
}, children: "Submit" }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", color: "secondary", onClick: () => {
|
|
85
|
+
handleClose();
|
|
86
|
+
}, children: "Cancel" })] })] }) }));
|
|
137
87
|
});
|
|
138
88
|
exports.default = FilterByTagDialog;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
export declare function renderSvg<T extends {
|
|
3
2
|
id: string;
|
|
4
3
|
height: number;
|
|
5
4
|
}>(self: T, opts: {
|
|
6
5
|
rasterizeLayers?: boolean;
|
|
7
|
-
}, cb: (model: T, ctx: CanvasRenderingContext2D, width: number, height: number) => void): Promise<
|
|
6
|
+
}, cb: (model: T, ctx: CanvasRenderingContext2D, width: number, height: number) => void): Promise<import("react/jsx-runtime").JSX.Element | undefined>;
|