@jbrowse/plugin-alignments 2.16.0 → 2.17.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 +2 -3
- package/dist/AlignmentsFeatureDetail/Flags.js +2 -2
- package/dist/AlignmentsFeatureDetail/LinkedPairedAlignments.js +2 -2
- package/dist/AlignmentsFeatureDetail/SupplementaryAlignments.js +2 -2
- package/dist/AlignmentsFeatureDetail/getSAFeatures.js +2 -2
- package/dist/AlignmentsFeatureDetail/stateModelFactory.d.ts +1 -1
- package/dist/BamAdapter/BamAdapter.d.ts +3 -2
- package/dist/BamAdapter/BamAdapter.js +34 -11
- package/dist/BamAdapter/BamSlightlyLazyFeature.d.ts +3 -17
- package/dist/BamAdapter/BamSlightlyLazyFeature.js +42 -72
- package/dist/CramAdapter/CramAdapter.d.ts +4 -3
- package/dist/CramAdapter/CramAdapter.js +24 -7
- package/dist/CramAdapter/CramSlightlyLazyFeature.d.ts +21 -27
- package/dist/CramAdapter/CramSlightlyLazyFeature.js +74 -73
- package/dist/CramAdapter/util.d.ts +1 -10
- package/dist/LinearAlignmentsDisplay/components/AlignmentsDisplay.d.ts +1 -1
- package/dist/LinearAlignmentsDisplay/index.js +2 -2
- package/dist/LinearAlignmentsDisplay/{models/model.d.ts → model.d.ts} +6 -3
- package/dist/LinearAlignmentsDisplay/{models/model.js → model.js} +11 -7
- package/dist/LinearPileupDisplay/SharedLinearPileupDisplayMixin.d.ts +6 -27
- package/dist/LinearPileupDisplay/SharedLinearPileupDisplayMixin.js +43 -21
- package/dist/LinearPileupDisplay/components/ColorByTagDialog.d.ts +5 -4
- package/dist/LinearPileupDisplay/components/ColorByTagDialog.js +3 -1
- package/dist/LinearPileupDisplay/components/GroupByDialog.js +8 -6
- package/dist/LinearPileupDisplay/components/SortByTagDialog.js +6 -4
- package/dist/LinearPileupDisplay/model.d.ts +41 -45
- package/dist/LinearPileupDisplay/model.js +118 -41
- package/dist/LinearReadArcsDisplay/components/ReactComponent.js +1 -1
- package/dist/LinearReadArcsDisplay/model.d.ts +22 -21
- package/dist/LinearReadArcsDisplay/model.js +13 -14
- package/dist/LinearReadCloudDisplay/components/ReactComponent.js +1 -1
- package/dist/LinearReadCloudDisplay/model.d.ts +14 -22
- package/dist/LinearReadCloudDisplay/model.js +12 -13
- package/dist/LinearSNPCoverageDisplay/components/Tooltip.js +49 -19
- package/dist/LinearSNPCoverageDisplay/index.js +3 -2
- package/dist/LinearSNPCoverageDisplay/{models/model.d.ts → model.d.ts} +3 -13
- package/dist/LinearSNPCoverageDisplay/{models/model.js → model.js} +71 -45
- package/dist/MismatchParser/cigarToMismatches.d.ts +3 -0
- package/dist/MismatchParser/cigarToMismatches.js +94 -0
- package/dist/MismatchParser/getNextRefPos.d.ts +4 -0
- package/dist/MismatchParser/getNextRefPos.js +40 -0
- package/dist/MismatchParser/index.d.ts +4 -29
- package/dist/MismatchParser/index.js +10 -321
- package/dist/MismatchParser/mdToMismatches.d.ts +3 -0
- package/dist/MismatchParser/mdToMismatches.js +80 -0
- package/dist/ModificationParser/index.d.ts +19 -0
- package/dist/ModificationParser/index.js +144 -0
- package/dist/PileupRPC/methods/GetGlobalValueForTag.js +1 -2
- package/dist/PileupRPC/methods/GetReducedFeatures.d.ts +1 -1
- package/dist/PileupRPC/methods/GetReducedFeatures.js +19 -16
- package/dist/PileupRPC/methods/GetVisibleModifications.d.ts +2 -1
- package/dist/PileupRPC/methods/GetVisibleModifications.js +9 -6
- package/dist/PileupRenderer/PileupLayoutSession.d.ts +8 -7
- package/dist/PileupRenderer/PileupRenderer.d.ts +6 -14
- package/dist/PileupRenderer/PileupRenderer.js +7 -5
- package/dist/PileupRenderer/renderAlignment.js +17 -4
- package/dist/PileupRenderer/renderAlignmentShape.js +102 -21
- package/dist/PileupRenderer/renderMethylation.d.ts +2 -1
- package/dist/PileupRenderer/renderMethylation.js +17 -9
- package/dist/PileupRenderer/renderMismatches.js +19 -19
- package/dist/PileupRenderer/renderModifications.d.ts +3 -2
- package/dist/PileupRenderer/renderModifications.js +31 -34
- package/dist/PileupRenderer/renderPerBaseLettering.d.ts +2 -1
- package/dist/PileupRenderer/renderPerBaseLettering.js +1 -3
- package/dist/PileupRenderer/renderPerBaseQuality.d.ts +2 -1
- package/dist/PileupRenderer/renderPerBaseQuality.js +1 -3
- package/dist/PileupRenderer/renderSoftClipping.js +6 -6
- package/dist/PileupRenderer/sortUtil.d.ts +2 -7
- package/dist/PileupRenderer/sortUtil.js +13 -13
- package/dist/SNPCoverageAdapter/SNPCoverageAdapter.js +10 -5
- package/dist/SNPCoverageAdapter/generateCoverageBins.d.ts +13 -9
- package/dist/SNPCoverageAdapter/generateCoverageBins.js +269 -166
- package/dist/SNPCoverageRenderer/SNPCoverageRenderer.d.ts +2 -1
- package/dist/SNPCoverageRenderer/SNPCoverageRenderer.js +171 -54
- package/dist/shared/color.d.ts +0 -10
- package/dist/shared/color.js +1 -7
- package/{esm/shared → dist/shared/components}/BaseDisplayComponent.d.ts +2 -2
- package/{esm/shared → dist/shared/components}/FilterByTagDialog.d.ts +3 -3
- package/dist/shared/{FilterByTagDialog.js → components/FilterByTagDialog.js} +5 -1
- package/dist/shared/fetchChains.js +1 -2
- package/dist/shared/getMaximumModificationAtEachPosition.d.ts +8 -0
- package/dist/shared/getMaximumModificationAtEachPosition.js +42 -0
- package/dist/shared/getUniqueModifications.d.ts +14 -0
- package/dist/shared/getUniqueModifications.js +16 -0
- package/dist/shared/getUniqueTags.d.ts +15 -0
- package/dist/shared/getUniqueTags.js +18 -0
- package/dist/shared/types.d.ts +94 -0
- package/dist/shared/util.d.ts +8 -0
- package/dist/shared/util.js +26 -0
- package/dist/util.d.ts +7 -4
- package/dist/util.js +30 -30
- package/esm/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js +2 -3
- package/esm/AlignmentsFeatureDetail/Flags.js +1 -1
- package/esm/AlignmentsFeatureDetail/LinkedPairedAlignments.js +1 -1
- package/esm/AlignmentsFeatureDetail/SupplementaryAlignments.js +1 -1
- package/esm/AlignmentsFeatureDetail/getSAFeatures.js +2 -2
- package/esm/AlignmentsFeatureDetail/stateModelFactory.d.ts +1 -1
- package/esm/BamAdapter/BamAdapter.d.ts +3 -2
- package/esm/BamAdapter/BamAdapter.js +31 -8
- package/esm/BamAdapter/BamSlightlyLazyFeature.d.ts +3 -17
- package/esm/BamAdapter/BamSlightlyLazyFeature.js +43 -73
- package/esm/CramAdapter/CramAdapter.d.ts +4 -3
- package/esm/CramAdapter/CramAdapter.js +22 -5
- package/esm/CramAdapter/CramSlightlyLazyFeature.d.ts +21 -27
- package/esm/CramAdapter/CramSlightlyLazyFeature.js +74 -73
- package/esm/CramAdapter/util.d.ts +1 -10
- package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.d.ts +1 -1
- package/esm/LinearAlignmentsDisplay/index.js +2 -2
- package/esm/LinearAlignmentsDisplay/{models/model.d.ts → model.d.ts} +6 -3
- package/esm/LinearAlignmentsDisplay/{models/model.js → model.js} +11 -7
- package/esm/LinearPileupDisplay/SharedLinearPileupDisplayMixin.d.ts +6 -27
- package/esm/LinearPileupDisplay/SharedLinearPileupDisplayMixin.js +45 -23
- package/esm/LinearPileupDisplay/components/ColorByTagDialog.d.ts +5 -4
- package/esm/LinearPileupDisplay/components/ColorByTagDialog.js +3 -1
- package/esm/LinearPileupDisplay/components/GroupByDialog.js +8 -6
- package/esm/LinearPileupDisplay/components/SortByTagDialog.js +6 -4
- package/esm/LinearPileupDisplay/model.d.ts +41 -45
- package/esm/LinearPileupDisplay/model.js +119 -42
- package/esm/LinearReadArcsDisplay/components/ReactComponent.js +1 -1
- package/esm/LinearReadArcsDisplay/model.d.ts +22 -21
- package/esm/LinearReadArcsDisplay/model.js +14 -15
- package/esm/LinearReadCloudDisplay/components/ReactComponent.js +1 -1
- package/esm/LinearReadCloudDisplay/model.d.ts +14 -22
- package/esm/LinearReadCloudDisplay/model.js +13 -14
- package/esm/LinearSNPCoverageDisplay/components/Tooltip.js +49 -19
- package/esm/LinearSNPCoverageDisplay/index.js +3 -2
- package/esm/LinearSNPCoverageDisplay/{models/model.d.ts → model.d.ts} +3 -13
- package/esm/LinearSNPCoverageDisplay/{models/model.js → model.js} +72 -46
- package/esm/MismatchParser/cigarToMismatches.d.ts +3 -0
- package/esm/MismatchParser/cigarToMismatches.js +91 -0
- package/esm/MismatchParser/getNextRefPos.d.ts +4 -0
- package/esm/MismatchParser/getNextRefPos.js +37 -0
- package/esm/MismatchParser/index.d.ts +4 -29
- package/esm/MismatchParser/index.js +5 -311
- package/esm/MismatchParser/mdToMismatches.d.ts +3 -0
- package/esm/MismatchParser/mdToMismatches.js +77 -0
- package/esm/ModificationParser/index.d.ts +19 -0
- package/esm/ModificationParser/index.js +138 -0
- package/esm/PileupRPC/methods/GetGlobalValueForTag.js +1 -2
- package/esm/PileupRPC/methods/GetReducedFeatures.d.ts +1 -1
- package/esm/PileupRPC/methods/GetReducedFeatures.js +19 -16
- package/esm/PileupRPC/methods/GetVisibleModifications.d.ts +2 -1
- package/esm/PileupRPC/methods/GetVisibleModifications.js +9 -6
- package/esm/PileupRenderer/PileupLayoutSession.d.ts +8 -7
- package/esm/PileupRenderer/PileupRenderer.d.ts +6 -14
- package/esm/PileupRenderer/PileupRenderer.js +8 -6
- package/esm/PileupRenderer/renderAlignment.js +17 -4
- package/esm/PileupRenderer/renderAlignmentShape.js +102 -21
- package/esm/PileupRenderer/renderMethylation.d.ts +2 -1
- package/esm/PileupRenderer/renderMethylation.js +17 -9
- package/esm/PileupRenderer/renderMismatches.js +19 -19
- package/esm/PileupRenderer/renderModifications.d.ts +3 -2
- package/esm/PileupRenderer/renderModifications.js +30 -33
- package/esm/PileupRenderer/renderPerBaseLettering.d.ts +2 -1
- package/esm/PileupRenderer/renderPerBaseLettering.js +1 -3
- package/esm/PileupRenderer/renderPerBaseQuality.d.ts +2 -1
- package/esm/PileupRenderer/renderPerBaseQuality.js +1 -3
- package/esm/PileupRenderer/renderSoftClipping.js +6 -6
- package/esm/PileupRenderer/sortUtil.d.ts +2 -7
- package/esm/PileupRenderer/sortUtil.js +13 -13
- package/esm/SNPCoverageAdapter/SNPCoverageAdapter.js +10 -5
- package/esm/SNPCoverageAdapter/generateCoverageBins.d.ts +13 -9
- package/esm/SNPCoverageAdapter/generateCoverageBins.js +269 -166
- package/esm/SNPCoverageRenderer/SNPCoverageRenderer.d.ts +2 -1
- package/esm/SNPCoverageRenderer/SNPCoverageRenderer.js +171 -54
- package/esm/shared/color.d.ts +0 -10
- package/esm/shared/color.js +0 -6
- package/{dist/shared → esm/shared/components}/BaseDisplayComponent.d.ts +2 -2
- package/{dist/shared → esm/shared/components}/FilterByTagDialog.d.ts +3 -3
- package/esm/shared/{FilterByTagDialog.js → components/FilterByTagDialog.js} +5 -1
- package/esm/shared/fetchChains.js +1 -2
- package/esm/shared/getMaximumModificationAtEachPosition.d.ts +8 -0
- package/esm/shared/getMaximumModificationAtEachPosition.js +39 -0
- package/esm/shared/getUniqueModifications.d.ts +14 -0
- package/esm/shared/getUniqueModifications.js +13 -0
- package/esm/shared/getUniqueTags.d.ts +15 -0
- package/esm/shared/getUniqueTags.js +15 -0
- package/esm/shared/types.d.ts +94 -0
- package/esm/shared/util.d.ts +8 -0
- package/esm/shared/util.js +23 -0
- package/esm/util.d.ts +7 -4
- package/esm/util.js +28 -27
- package/package.json +4 -4
- package/dist/LinearPileupDisplay/components/ColorByModificationsDialog.d.ts +0 -15
- package/dist/LinearPileupDisplay/components/ColorByModificationsDialog.js +0 -41
- package/dist/LinearPileupDisplay/components/ModificationsTable.d.ts +0 -4
- package/dist/LinearPileupDisplay/components/ModificationsTable.js +0 -28
- package/dist/SNPCoverageAdapter/util.d.ts +0 -25
- package/dist/shared/index.d.ts +0 -49
- package/dist/shared/index.js +0 -41
- package/esm/LinearPileupDisplay/components/ColorByModificationsDialog.d.ts +0 -15
- package/esm/LinearPileupDisplay/components/ColorByModificationsDialog.js +0 -36
- package/esm/LinearPileupDisplay/components/ModificationsTable.d.ts +0 -4
- package/esm/LinearPileupDisplay/components/ModificationsTable.js +0 -22
- package/esm/SNPCoverageAdapter/util.d.ts +0 -25
- package/esm/shared/index.d.ts +0 -49
- package/esm/shared/index.js +0 -36
- /package/dist/LinearAlignmentsDisplay/{models/alignmentsModel.d.ts → alignmentsModel.d.ts} +0 -0
- /package/dist/LinearAlignmentsDisplay/{models/alignmentsModel.js → alignmentsModel.js} +0 -0
- /package/dist/LinearAlignmentsDisplay/{models/configSchema.d.ts → configSchema.d.ts} +0 -0
- /package/dist/LinearAlignmentsDisplay/{models/configSchema.js → configSchema.js} +0 -0
- /package/dist/LinearAlignmentsDisplay/{models/util.d.ts → util.d.ts} +0 -0
- /package/dist/LinearAlignmentsDisplay/{models/util.js → util.js} +0 -0
- /package/dist/LinearSNPCoverageDisplay/{models/configSchema.d.ts → configSchema.d.ts} +0 -0
- /package/dist/LinearSNPCoverageDisplay/{models/configSchema.js → configSchema.js} +0 -0
- /package/dist/shared/{BaseDisplayComponent.js → components/BaseDisplayComponent.js} +0 -0
- /package/dist/shared/{renderSvg.d.ts → renderSvgUtil.d.ts} +0 -0
- /package/dist/shared/{renderSvg.js → renderSvgUtil.js} +0 -0
- /package/dist/{SNPCoverageAdapter/util.js → shared/types.js} +0 -0
- /package/esm/LinearAlignmentsDisplay/{models/alignmentsModel.d.ts → alignmentsModel.d.ts} +0 -0
- /package/esm/LinearAlignmentsDisplay/{models/alignmentsModel.js → alignmentsModel.js} +0 -0
- /package/esm/LinearAlignmentsDisplay/{models/configSchema.d.ts → configSchema.d.ts} +0 -0
- /package/esm/LinearAlignmentsDisplay/{models/configSchema.js → configSchema.js} +0 -0
- /package/esm/LinearAlignmentsDisplay/{models/util.d.ts → util.d.ts} +0 -0
- /package/esm/LinearAlignmentsDisplay/{models/util.js → util.js} +0 -0
- /package/esm/LinearSNPCoverageDisplay/{models/configSchema.d.ts → configSchema.d.ts} +0 -0
- /package/esm/LinearSNPCoverageDisplay/{models/configSchema.js → configSchema.js} +0 -0
- /package/esm/shared/{BaseDisplayComponent.js → components/BaseDisplayComponent.js} +0 -0
- /package/esm/shared/{renderSvg.d.ts → renderSvgUtil.d.ts} +0 -0
- /package/esm/shared/{renderSvg.js → renderSvgUtil.js} +0 -0
- /package/esm/{SNPCoverageAdapter/util.js → shared/types.js} +0 -0
|
@@ -4,12 +4,26 @@ const ui_1 = require("@jbrowse/core/ui");
|
|
|
4
4
|
const util_1 = require("@jbrowse/core/util");
|
|
5
5
|
const configuration_1 = require("@jbrowse/core/configuration");
|
|
6
6
|
const plugin_wiggle_1 = require("@jbrowse/plugin-wiggle");
|
|
7
|
+
const util_2 = require("../shared/util");
|
|
8
|
+
// width/height of the triangle above e.g. insertion indicators
|
|
9
|
+
const INTERBASE_INDICATOR_WIDTH = 7;
|
|
10
|
+
const INTERBASE_INDICATOR_HEIGHT = 4.5;
|
|
11
|
+
// minimum read depth to draw the insertion indicators, below this the
|
|
12
|
+
// 'statistical significance' is low
|
|
13
|
+
const MINIMUM_INTERBASE_INDICATOR_READ_DEPTH = 7;
|
|
14
|
+
const complementBase = {
|
|
15
|
+
C: 'G',
|
|
16
|
+
G: 'C',
|
|
17
|
+
A: 'T',
|
|
18
|
+
T: 'A',
|
|
19
|
+
};
|
|
7
20
|
const fudgeFactor = 0.6;
|
|
8
21
|
class SNPCoverageRenderer extends plugin_wiggle_1.WiggleBaseRenderer {
|
|
9
22
|
// note: the snps are drawn on linear scale even if the data is drawn in log
|
|
10
23
|
// scape hence the two different scales being used
|
|
11
24
|
async draw(ctx, props) {
|
|
12
|
-
|
|
25
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
26
|
+
const { features, regions, bpPerPx, colorBy, displayCrossHatches, visibleModifications = {}, scaleOpts, height: unadjustedHeight, theme: configTheme, config: cfg, ticks, } = props;
|
|
13
27
|
const theme = (0, ui_1.createJBrowseTheme)(configTheme);
|
|
14
28
|
const region = regions[0];
|
|
15
29
|
const width = (region.end - region.start) / bpPerPx;
|
|
@@ -48,16 +62,18 @@ class SNPCoverageRenderer extends plugin_wiggle_1.WiggleBaseRenderer {
|
|
|
48
62
|
softclip: 'blue',
|
|
49
63
|
hardclip: 'red',
|
|
50
64
|
total: (0, configuration_1.readConfObject)(cfg, 'color'),
|
|
51
|
-
|
|
52
|
-
|
|
65
|
+
mod_NONE: 'blue',
|
|
66
|
+
cpg_meth: 'red',
|
|
67
|
+
cpg_unmeth: 'blue',
|
|
53
68
|
};
|
|
54
69
|
const feats = [...features.values()];
|
|
55
|
-
const coverage = feats.filter(f => f.get('type') !== 'skip');
|
|
56
|
-
const skips = feats.filter(f => f.get('type') === 'skip');
|
|
57
70
|
// Use two pass rendering, which helps in visualizing the SNPs at higher
|
|
58
71
|
// bpPerPx First pass: draw the gray background
|
|
59
72
|
ctx.fillStyle = colorForBase.total;
|
|
60
|
-
for (const feature of
|
|
73
|
+
for (const feature of feats) {
|
|
74
|
+
if (feature.get('type') === 'skip') {
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
61
77
|
const [leftPx, rightPx] = (0, util_1.featureSpanPx)(feature, region, bpPerPx);
|
|
62
78
|
const w = rightPx - leftPx + fudgeFactor;
|
|
63
79
|
const score = feature.get('score');
|
|
@@ -65,45 +81,148 @@ class SNPCoverageRenderer extends plugin_wiggle_1.WiggleBaseRenderer {
|
|
|
65
81
|
}
|
|
66
82
|
// Keep track of previous total which we will use it to draw the interbase
|
|
67
83
|
// indicator (if there is a sudden clip, there will be no read coverage but
|
|
68
|
-
// there will be "clip" coverage) at that position beyond the read.
|
|
69
|
-
//
|
|
70
|
-
//
|
|
84
|
+
// there will be "clip" coverage) at that position beyond the read.
|
|
85
|
+
//
|
|
86
|
+
// if the clip is right at a block boundary then prevTotal will not be
|
|
87
|
+
// available, so this is a best attempt to plot interbase indicator at the
|
|
88
|
+
// "cliffs"
|
|
71
89
|
let prevTotal = 0;
|
|
72
90
|
// extraHorizontallyFlippedOffset is used to draw interbase items, which
|
|
73
91
|
// are located to the left when forward and right when reversed
|
|
74
92
|
const extraHorizontallyFlippedOffset = region.reversed ? 1 / bpPerPx : 0;
|
|
93
|
+
// @ts-expect-error
|
|
94
|
+
const drawingModifications = (colorBy === null || colorBy === void 0 ? void 0 : colorBy.type) === 'modifications';
|
|
95
|
+
// @ts-expect-error
|
|
96
|
+
const drawingMethylation = (colorBy === null || colorBy === void 0 ? void 0 : colorBy.type) === 'methylation';
|
|
97
|
+
const isolatedModification =
|
|
98
|
+
// @ts-expect-error
|
|
99
|
+
(_a = colorBy === null || colorBy === void 0 ? void 0 : colorBy.modifications) === null || _a === void 0 ? void 0 : _a.isolatedModification;
|
|
75
100
|
// Second pass: draw the SNP data, and add a minimum feature width of 1px
|
|
76
101
|
// which can be wider than the actual bpPerPx This reduces overdrawing of
|
|
77
102
|
// the grey background over the SNPs
|
|
78
|
-
for (const feature of
|
|
103
|
+
for (const feature of feats) {
|
|
104
|
+
if (feature.get('type') === 'skip') {
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
79
107
|
const [leftPx, rightPx] = (0, util_1.featureSpanPx)(feature, region, bpPerPx);
|
|
80
|
-
const score = feature.get('score');
|
|
81
108
|
const snpinfo = feature.get('snpinfo');
|
|
82
109
|
const w = Math.max(rightPx - leftPx, 1);
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
const {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
110
|
+
const score0 = feature.get('score');
|
|
111
|
+
if (drawingModifications) {
|
|
112
|
+
let curr = 0;
|
|
113
|
+
const refbase = (_b = snpinfo.refbase) === null || _b === void 0 ? void 0 : _b.toUpperCase();
|
|
114
|
+
const { nonmods, mods, snps, ref } = snpinfo;
|
|
115
|
+
for (const m of Object.keys(nonmods).sort().reverse()) {
|
|
116
|
+
const mod = visibleModifications[m.replace('nonmod_', '')] ||
|
|
117
|
+
visibleModifications[m.replace('mod_', '')];
|
|
118
|
+
if (!mod) {
|
|
119
|
+
console.warn(`${m} not known yet`);
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
if (isolatedModification && mod.type !== isolatedModification) {
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
const cmp = complementBase[mod.base];
|
|
126
|
+
// this approach is inspired from the 'simplex' approach in igv
|
|
127
|
+
// https://github.com/igvteam/igv/blob/af07c3b1be8806cfd77343ee04982aeff17d2beb/src/main/java/org/broad/igv/sam/mods/BaseModificationCoverageRenderer.java#L51
|
|
128
|
+
const detectable = mod.base === 'N'
|
|
129
|
+
? score0
|
|
130
|
+
: (((_c = snps[mod.base]) === null || _c === void 0 ? void 0 : _c.entryDepth) || 0) +
|
|
131
|
+
(((_d = snps[cmp]) === null || _d === void 0 ? void 0 : _d.entryDepth) || 0) +
|
|
132
|
+
(refbase === mod.base ? ref['1'] : 0) +
|
|
133
|
+
(refbase === cmp ? ref['-1'] : 0);
|
|
134
|
+
const modifiable = mod.base === 'N'
|
|
135
|
+
? score0
|
|
136
|
+
: (((_e = snps[mod.base]) === null || _e === void 0 ? void 0 : _e.entryDepth) || 0) +
|
|
137
|
+
(((_f = snps[cmp]) === null || _f === void 0 ? void 0 : _f.entryDepth) || 0) +
|
|
138
|
+
(refbase === mod.base ? ref.entryDepth : 0) +
|
|
139
|
+
(refbase === cmp ? ref.entryDepth : 0);
|
|
140
|
+
const { entryDepth, avgProbability = 0 } = snpinfo.nonmods[m];
|
|
141
|
+
const modFraction = (modifiable / score0) * (entryDepth / detectable);
|
|
142
|
+
const nonModColor = 'blue';
|
|
143
|
+
const c = (0, util_2.alphaColor)(nonModColor, avgProbability);
|
|
144
|
+
const height = toHeight(score0);
|
|
145
|
+
const bottom = toY(score0) + height;
|
|
146
|
+
ctx.fillStyle = c;
|
|
147
|
+
ctx.fillRect(Math.round(leftPx), bottom - (curr + modFraction * height), w, modFraction * height);
|
|
148
|
+
curr += modFraction * height;
|
|
149
|
+
}
|
|
150
|
+
for (const m of Object.keys(mods).sort().reverse()) {
|
|
151
|
+
const mod = visibleModifications[m.replace('mod_', '')];
|
|
152
|
+
if (!mod) {
|
|
153
|
+
console.warn(`${m} not known yet`);
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
if (isolatedModification && mod.type !== isolatedModification) {
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
const cmp = complementBase[mod.base];
|
|
160
|
+
// this approach is inspired from the 'simplex' approach in igv
|
|
161
|
+
// https://github.com/igvteam/igv/blob/af07c3b1be8806cfd77343ee04982aeff17d2beb/src/main/java/org/broad/igv/sam/mods/BaseModificationCoverageRenderer.java#L51
|
|
162
|
+
const detectable = mod.base === 'N'
|
|
163
|
+
? score0
|
|
164
|
+
: (((_g = snps[mod.base]) === null || _g === void 0 ? void 0 : _g.entryDepth) || 0) +
|
|
165
|
+
(((_h = snps[cmp]) === null || _h === void 0 ? void 0 : _h.entryDepth) || 0) +
|
|
166
|
+
(refbase === mod.base ? ref['1'] : 0) +
|
|
167
|
+
(refbase === cmp ? ref['-1'] : 0);
|
|
168
|
+
const modifiable = mod.base === 'N'
|
|
169
|
+
? score0
|
|
170
|
+
: (((_j = snps[mod.base]) === null || _j === void 0 ? void 0 : _j.entryDepth) || 0) +
|
|
171
|
+
(((_k = snps[cmp]) === null || _k === void 0 ? void 0 : _k.entryDepth) || 0) +
|
|
172
|
+
(refbase === mod.base ? ref.entryDepth : 0) +
|
|
173
|
+
(refbase === cmp ? ref.entryDepth : 0);
|
|
174
|
+
const { entryDepth, avgProbability = 0 } = mods[m];
|
|
175
|
+
const modFraction = (modifiable / score0) * (entryDepth / detectable);
|
|
176
|
+
const baseColor = mod.color || 'black';
|
|
177
|
+
const c = (0, util_2.alphaColor)(baseColor, avgProbability);
|
|
178
|
+
const height = toHeight(score0);
|
|
179
|
+
const bottom = toY(score0) + height;
|
|
180
|
+
ctx.fillStyle = c;
|
|
181
|
+
ctx.fillRect(Math.round(leftPx), bottom - (curr + modFraction * height), w, modFraction * height);
|
|
182
|
+
curr += modFraction * height;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
else if (drawingMethylation) {
|
|
186
|
+
const { depth, nonmods, mods } = snpinfo;
|
|
187
|
+
let curr = 0;
|
|
188
|
+
for (const base of Object.keys(mods).sort().reverse()) {
|
|
189
|
+
const { entryDepth } = mods[base];
|
|
190
|
+
const height = toHeight(score0);
|
|
191
|
+
const bottom = toY(score0) + height;
|
|
192
|
+
ctx.fillStyle = colorForBase[base] || 'black';
|
|
193
|
+
ctx.fillRect(Math.round(leftPx), bottom - ((entryDepth + curr) / depth) * height, w, (entryDepth / depth) * height);
|
|
194
|
+
curr += entryDepth;
|
|
195
|
+
}
|
|
196
|
+
for (const base of Object.keys(nonmods).sort().reverse()) {
|
|
197
|
+
const { entryDepth } = nonmods[base];
|
|
198
|
+
const height = toHeight(score0);
|
|
199
|
+
const bottom = toY(score0) + height;
|
|
200
|
+
ctx.fillStyle = colorForBase[base] || 'black';
|
|
201
|
+
ctx.fillRect(Math.round(leftPx), bottom - ((entryDepth + curr) / depth) * height, w, (entryDepth / depth) * height);
|
|
202
|
+
curr += entryDepth;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
const { depth, snps } = snpinfo;
|
|
207
|
+
let curr = 0;
|
|
208
|
+
for (const base of Object.keys(snps).sort().reverse()) {
|
|
209
|
+
const { entryDepth } = snps[base];
|
|
210
|
+
const height = toHeight(score0);
|
|
211
|
+
const bottom = toY(score0) + height;
|
|
212
|
+
ctx.fillStyle = colorForBase[base] || 'black';
|
|
213
|
+
ctx.fillRect(Math.round(leftPx), bottom - ((entryDepth + curr) / depth) * height, w, (entryDepth / depth) * height);
|
|
214
|
+
curr += entryDepth;
|
|
215
|
+
}
|
|
96
216
|
}
|
|
97
217
|
const interbaseEvents = Object.keys(snpinfo.noncov);
|
|
98
|
-
const indicatorHeight = 4.5;
|
|
99
218
|
if (drawInterbaseCounts) {
|
|
100
219
|
let curr = 0;
|
|
101
220
|
for (const base of interbaseEvents) {
|
|
102
|
-
const {
|
|
221
|
+
const { entryDepth } = snpinfo.noncov[base];
|
|
103
222
|
const r = 0.6;
|
|
104
223
|
ctx.fillStyle = colorForBase[base];
|
|
105
|
-
ctx.fillRect(leftPx - r + extraHorizontallyFlippedOffset,
|
|
106
|
-
curr +=
|
|
224
|
+
ctx.fillRect(leftPx - r + extraHorizontallyFlippedOffset, INTERBASE_INDICATOR_HEIGHT + toHeight2(curr), r * 2, toHeight2(entryDepth));
|
|
225
|
+
curr += entryDepth;
|
|
107
226
|
}
|
|
108
227
|
}
|
|
109
228
|
if (drawIndicators) {
|
|
@@ -111,48 +230,46 @@ class SNPCoverageRenderer extends plugin_wiggle_1.WiggleBaseRenderer {
|
|
|
111
230
|
let max = 0;
|
|
112
231
|
let maxBase = '';
|
|
113
232
|
for (const base of interbaseEvents) {
|
|
114
|
-
const {
|
|
115
|
-
accum +=
|
|
116
|
-
if (
|
|
117
|
-
max =
|
|
233
|
+
const { entryDepth } = snpinfo.noncov[base];
|
|
234
|
+
accum += entryDepth;
|
|
235
|
+
if (entryDepth > max) {
|
|
236
|
+
max = entryDepth;
|
|
118
237
|
maxBase = base;
|
|
119
238
|
}
|
|
120
239
|
}
|
|
121
|
-
// avoid drawing a bunch of indicators if coverage is very low
|
|
122
|
-
//
|
|
123
|
-
const indicatorComparatorScore = Math.max(
|
|
240
|
+
// avoid drawing a bunch of indicators if coverage is very low. note:
|
|
241
|
+
// also uses the prev total in the case of the "cliff"
|
|
242
|
+
const indicatorComparatorScore = Math.max(score0, prevTotal);
|
|
124
243
|
if (accum > indicatorComparatorScore * indicatorThreshold &&
|
|
125
|
-
indicatorComparatorScore >
|
|
244
|
+
indicatorComparatorScore > MINIMUM_INTERBASE_INDICATOR_READ_DEPTH) {
|
|
126
245
|
ctx.fillStyle = colorForBase[maxBase];
|
|
127
246
|
ctx.beginPath();
|
|
128
247
|
const l = leftPx + extraHorizontallyFlippedOffset;
|
|
129
|
-
ctx.moveTo(l -
|
|
130
|
-
ctx.lineTo(l +
|
|
131
|
-
ctx.lineTo(l,
|
|
248
|
+
ctx.moveTo(l - INTERBASE_INDICATOR_WIDTH / 2, 0);
|
|
249
|
+
ctx.lineTo(l + INTERBASE_INDICATOR_WIDTH / 2, 0);
|
|
250
|
+
ctx.lineTo(l, INTERBASE_INDICATOR_HEIGHT);
|
|
132
251
|
ctx.fill();
|
|
133
252
|
}
|
|
134
253
|
}
|
|
135
|
-
prevTotal =
|
|
254
|
+
prevTotal = score0;
|
|
136
255
|
}
|
|
137
256
|
if (drawArcs) {
|
|
138
|
-
for (const f of
|
|
139
|
-
|
|
257
|
+
for (const f of feats) {
|
|
258
|
+
if (f.get('type') !== 'skip') {
|
|
259
|
+
continue;
|
|
260
|
+
}
|
|
261
|
+
const s = f.get('start');
|
|
262
|
+
const e = f.get('end');
|
|
263
|
+
const [left, right] = (0, util_1.bpSpanPx)(s, e, region, bpPerPx);
|
|
140
264
|
ctx.beginPath();
|
|
141
|
-
const
|
|
142
|
-
const xs = f.get('xs');
|
|
265
|
+
const effectiveStrand = f.get('effectiveStrand');
|
|
143
266
|
const pos = 'rgba(255,200,200,0.7)';
|
|
144
267
|
const neg = 'rgba(200,200,255,0.7)';
|
|
145
268
|
const neutral = 'rgba(200,200,200,0.7)';
|
|
146
|
-
if (
|
|
269
|
+
if (effectiveStrand === 1) {
|
|
147
270
|
ctx.strokeStyle = pos;
|
|
148
271
|
}
|
|
149
|
-
else if (
|
|
150
|
-
ctx.strokeStyle = neg;
|
|
151
|
-
}
|
|
152
|
-
else if (str === 1) {
|
|
153
|
-
ctx.strokeStyle = pos;
|
|
154
|
-
}
|
|
155
|
-
else if (str === -1) {
|
|
272
|
+
else if (effectiveStrand === -1) {
|
|
156
273
|
ctx.strokeStyle = neg;
|
|
157
274
|
}
|
|
158
275
|
else {
|
|
@@ -167,12 +284,12 @@ class SNPCoverageRenderer extends plugin_wiggle_1.WiggleBaseRenderer {
|
|
|
167
284
|
if (displayCrossHatches) {
|
|
168
285
|
ctx.lineWidth = 1;
|
|
169
286
|
ctx.strokeStyle = 'rgba(140,140,140,0.8)';
|
|
170
|
-
ticks.values
|
|
287
|
+
for (const tick of ticks.values) {
|
|
171
288
|
ctx.beginPath();
|
|
172
289
|
ctx.moveTo(0, Math.round(toY(tick)));
|
|
173
290
|
ctx.lineTo(width, Math.round(toY(tick)));
|
|
174
291
|
ctx.stroke();
|
|
175
|
-
}
|
|
292
|
+
}
|
|
176
293
|
}
|
|
177
294
|
return undefined;
|
|
178
295
|
}
|
package/dist/shared/color.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Instance } from 'mobx-state-tree';
|
|
2
1
|
import { ChainStats } from './fetchChains';
|
|
3
2
|
export declare const fillColor: {
|
|
4
3
|
color_fwd_strand_not_proper: string;
|
|
@@ -57,12 +56,3 @@ export declare function getPairedOrientationColorOrDefault(f: {
|
|
|
57
56
|
export declare function getPairedOrientationColor(f: {
|
|
58
57
|
pair_orientation?: string;
|
|
59
58
|
}): readonly [string, string];
|
|
60
|
-
export interface ExtraColorBy {
|
|
61
|
-
custom?: Record<string, string>;
|
|
62
|
-
}
|
|
63
|
-
export declare const ColorByModel: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IModelType<{
|
|
64
|
-
type: import("mobx-state-tree").ISimpleType<string>;
|
|
65
|
-
tag: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
66
|
-
extra: import("mobx-state-tree").IType<any, any, any>;
|
|
67
|
-
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
68
|
-
export type IColorByModel = Instance<typeof ColorByModel>;
|
package/dist/shared/color.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.strokeColor = exports.fillColor = void 0;
|
|
4
4
|
exports.getPairedInsertSizeColor = getPairedInsertSizeColor;
|
|
5
5
|
exports.getPairedInsertSizeAndOrientationColor = getPairedInsertSizeAndOrientationColor;
|
|
6
6
|
exports.getPairedOrientationColorOrDefault = getPairedOrientationColorOrDefault;
|
|
7
7
|
exports.getPairedOrientationColor = getPairedOrientationColor;
|
|
8
|
-
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
9
8
|
const util_1 = require("../util");
|
|
10
9
|
exports.fillColor = {
|
|
11
10
|
color_fwd_strand_not_proper: '#ECC8C8',
|
|
@@ -86,8 +85,3 @@ function getPairedOrientationColorOrDefault(f) {
|
|
|
86
85
|
function getPairedOrientationColor(f) {
|
|
87
86
|
return getPairedOrientationColorOrDefault(f) || defaultColor;
|
|
88
87
|
}
|
|
89
|
-
exports.ColorByModel = mobx_state_tree_1.types.maybe(mobx_state_tree_1.types.model({
|
|
90
|
-
type: mobx_state_tree_1.types.string,
|
|
91
|
-
tag: mobx_state_tree_1.types.maybe(mobx_state_tree_1.types.string),
|
|
92
|
-
extra: mobx_state_tree_1.types.frozen(),
|
|
93
|
-
}));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { LinearReadCloudDisplayModel } from '
|
|
3
|
-
import { LinearReadArcsDisplayModel } from '
|
|
2
|
+
import { LinearReadCloudDisplayModel } from '../../LinearReadCloudDisplay/model';
|
|
3
|
+
import { LinearReadArcsDisplayModel } from '../../LinearReadArcsDisplay/model';
|
|
4
4
|
declare const BaseDisplayComponent: ({ model, children, }: {
|
|
5
5
|
model: LinearReadArcsDisplayModel | LinearReadCloudDisplayModel;
|
|
6
6
|
children?: React.ReactNode;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { FilterBy } from '../types';
|
|
3
3
|
declare const FilterByTagDialog: (props: {
|
|
4
4
|
model: {
|
|
5
|
-
filterBy:
|
|
6
|
-
setFilterBy: (arg:
|
|
5
|
+
filterBy: FilterBy;
|
|
6
|
+
setFilterBy: (arg: FilterBy) => void;
|
|
7
7
|
};
|
|
8
8
|
handleClose: () => void;
|
|
9
9
|
}) => React.JSX.Element;
|
|
@@ -103,7 +103,11 @@ const FilterByTagDialog = (0, mobx_react_1.observer)(function (props) {
|
|
|
103
103
|
react_1.default.createElement(material_1.Typography, null, "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"),
|
|
104
104
|
react_1.default.createElement(material_1.TextField, { className: classes.field, value: tag, onChange: event => {
|
|
105
105
|
setTag(event.target.value);
|
|
106
|
-
}, placeholder: "Enter tag name",
|
|
106
|
+
}, placeholder: "Enter tag name", error: tag.length === 2 && !validTag, helperText: tag.length === 2 && !validTag ? 'Not a valid tag' : '', slotProps: {
|
|
107
|
+
htmlInput: {
|
|
108
|
+
maxLength: 2,
|
|
109
|
+
},
|
|
110
|
+
} }),
|
|
107
111
|
react_1.default.createElement(material_1.TextField, { className: classes.field, value: tagValue, onChange: event => {
|
|
108
112
|
setTagValue(event.target.value);
|
|
109
113
|
}, placeholder: "Enter tag value" })),
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.fetchChains = fetchChains;
|
|
4
4
|
const util_1 = require("@jbrowse/core/util");
|
|
5
|
-
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
6
5
|
async function fetchChains(self) {
|
|
7
6
|
// @ts-expect-error
|
|
8
7
|
const { rpcSessionId: sessionId } = (0, util_1.getContainingTrack)(self);
|
|
@@ -15,7 +14,7 @@ async function fetchChains(self) {
|
|
|
15
14
|
const ret = (await rpcManager.call(sessionId, 'PileupGetReducedFeatures', {
|
|
16
15
|
sessionId,
|
|
17
16
|
regions: view.staticBlocks.contentBlocks,
|
|
18
|
-
filterBy:
|
|
17
|
+
filterBy: self.filterBy,
|
|
19
18
|
adapterConfig: self.adapterConfig,
|
|
20
19
|
}));
|
|
21
20
|
self.setChainData(ret);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Feature } from '@jbrowse/core/util';
|
|
2
|
+
interface MaximumProbabilityMod {
|
|
3
|
+
type: string;
|
|
4
|
+
prob: number;
|
|
5
|
+
allProbs: number[];
|
|
6
|
+
}
|
|
7
|
+
export declare function getMaxProbModAtEachPosition(feature: Feature, cigarOps?: string[]): MaximumProbabilityMod[] | undefined;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMaxProbModAtEachPosition = getMaxProbModAtEachPosition;
|
|
4
|
+
// locals
|
|
5
|
+
const ModificationParser_1 = require("../ModificationParser");
|
|
6
|
+
const MismatchParser_1 = require("../MismatchParser");
|
|
7
|
+
const util_1 = require("../util");
|
|
8
|
+
function getMaxProbModAtEachPosition(feature, cigarOps) {
|
|
9
|
+
const fstrand = feature.get('strand');
|
|
10
|
+
const seq = feature.get('seq');
|
|
11
|
+
const mm = (0, util_1.getTagAlt)(feature, 'MM', 'Mm') || '';
|
|
12
|
+
const ops = cigarOps || (0, MismatchParser_1.parseCigar)(feature.get('CIGAR'));
|
|
13
|
+
if (seq) {
|
|
14
|
+
const modifications = (0, ModificationParser_1.getModPositions)(mm, seq, fstrand);
|
|
15
|
+
const probabilities = (0, ModificationParser_1.getModProbabilities)(feature);
|
|
16
|
+
const maxProbModForPosition = [];
|
|
17
|
+
let probIndex = 0;
|
|
18
|
+
for (const { type, positions } of modifications) {
|
|
19
|
+
for (const { ref, idx } of (0, MismatchParser_1.getNextRefPos)(ops, positions)) {
|
|
20
|
+
const prob = (probabilities === null || probabilities === void 0 ? void 0 : probabilities[probIndex + (fstrand === -1 ? positions.length - 1 - idx : idx)]) || 0;
|
|
21
|
+
if (!maxProbModForPosition[ref]) {
|
|
22
|
+
maxProbModForPosition[ref] = {
|
|
23
|
+
type,
|
|
24
|
+
prob,
|
|
25
|
+
allProbs: [prob],
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
const old = maxProbModForPosition[ref];
|
|
30
|
+
maxProbModForPosition[ref] = {
|
|
31
|
+
allProbs: [...old.allProbs, prob],
|
|
32
|
+
prob: Math.max(old.prob, prob),
|
|
33
|
+
type: old.prob > prob ? old.type : type,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
probIndex += positions.length;
|
|
38
|
+
}
|
|
39
|
+
return maxProbModForPosition;
|
|
40
|
+
}
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IAnyStateTreeNode } from 'mobx-state-tree';
|
|
2
|
+
import { BlockSet } from '@jbrowse/core/util/blockTypes';
|
|
3
|
+
import { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
4
|
+
import { ModificationType } from './types';
|
|
5
|
+
export declare function getUniqueModifications({ self, adapterConfig, blocks, opts, }: {
|
|
6
|
+
self: IAnyStateTreeNode;
|
|
7
|
+
adapterConfig: AnyConfigurationModel;
|
|
8
|
+
blocks: BlockSet;
|
|
9
|
+
opts?: {
|
|
10
|
+
headers?: Record<string, string>;
|
|
11
|
+
signal?: AbortSignal;
|
|
12
|
+
filters: string[];
|
|
13
|
+
};
|
|
14
|
+
}): Promise<ModificationType[]>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getUniqueModifications = getUniqueModifications;
|
|
4
|
+
const util_1 = require("@jbrowse/core/util");
|
|
5
|
+
const tracks_1 = require("@jbrowse/core/util/tracks");
|
|
6
|
+
async function getUniqueModifications({ self, adapterConfig, blocks, opts, }) {
|
|
7
|
+
const { rpcManager } = (0, util_1.getSession)(self);
|
|
8
|
+
const sessionId = (0, tracks_1.getRpcSessionId)(self);
|
|
9
|
+
const values = await rpcManager.call(sessionId, 'PileupGetVisibleModifications', {
|
|
10
|
+
adapterConfig,
|
|
11
|
+
sessionId,
|
|
12
|
+
regions: blocks.contentBlocks,
|
|
13
|
+
...opts,
|
|
14
|
+
});
|
|
15
|
+
return values;
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IAnyStateTreeNode } from 'mobx-state-tree';
|
|
2
|
+
import { BlockSet } from '@jbrowse/core/util/blockTypes';
|
|
3
|
+
import { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
4
|
+
export declare function getUniqueTags({ self, tag, blocks, opts, }: {
|
|
5
|
+
self: IAnyStateTreeNode & {
|
|
6
|
+
adapterConfig: AnyConfigurationModel;
|
|
7
|
+
};
|
|
8
|
+
tag: string;
|
|
9
|
+
blocks: BlockSet;
|
|
10
|
+
opts?: {
|
|
11
|
+
headers?: Record<string, string>;
|
|
12
|
+
signal?: AbortSignal;
|
|
13
|
+
filters: string[];
|
|
14
|
+
};
|
|
15
|
+
}): Promise<string[]>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getUniqueTags = getUniqueTags;
|
|
4
|
+
const util_1 = require("@jbrowse/core/util");
|
|
5
|
+
const tracks_1 = require("@jbrowse/core/util/tracks");
|
|
6
|
+
async function getUniqueTags({ self, tag, blocks, opts, }) {
|
|
7
|
+
const { rpcManager } = (0, util_1.getSession)(self);
|
|
8
|
+
const { adapterConfig } = self;
|
|
9
|
+
const sessionId = (0, tracks_1.getRpcSessionId)(self);
|
|
10
|
+
const values = await rpcManager.call((0, tracks_1.getRpcSessionId)(self), 'PileupGetGlobalValueForTag', {
|
|
11
|
+
adapterConfig,
|
|
12
|
+
tag,
|
|
13
|
+
sessionId,
|
|
14
|
+
regions: blocks.contentBlocks,
|
|
15
|
+
...opts,
|
|
16
|
+
});
|
|
17
|
+
return values;
|
|
18
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
export type SkipMap = Record<string, {
|
|
2
|
+
score: number;
|
|
3
|
+
feature: unknown;
|
|
4
|
+
start: number;
|
|
5
|
+
end: number;
|
|
6
|
+
strand: number;
|
|
7
|
+
effectiveStrand: number;
|
|
8
|
+
}>;
|
|
9
|
+
export interface BinEntry {
|
|
10
|
+
entryDepth: number;
|
|
11
|
+
'-1': number;
|
|
12
|
+
'0': number;
|
|
13
|
+
'1': number;
|
|
14
|
+
avgProbability?: number;
|
|
15
|
+
}
|
|
16
|
+
type BinType = Record<string, BinEntry>;
|
|
17
|
+
export interface BaseCoverageBin {
|
|
18
|
+
refbase?: string;
|
|
19
|
+
depth: number;
|
|
20
|
+
readsCounted: number;
|
|
21
|
+
ref: BinEntry;
|
|
22
|
+
snps: BinType;
|
|
23
|
+
mods: BinType;
|
|
24
|
+
nonmods: BinType;
|
|
25
|
+
delskips: BinType;
|
|
26
|
+
noncov: BinType;
|
|
27
|
+
}
|
|
28
|
+
export interface PreBinEntry {
|
|
29
|
+
entryDepth: number;
|
|
30
|
+
'-1': number;
|
|
31
|
+
'0': number;
|
|
32
|
+
'1': number;
|
|
33
|
+
probabilities: number[];
|
|
34
|
+
}
|
|
35
|
+
type PreBinType = Record<string, PreBinEntry>;
|
|
36
|
+
export interface PreBaseCoverageBin extends PreBaseCoverageBinSubtypes {
|
|
37
|
+
refbase?: string;
|
|
38
|
+
depth: number;
|
|
39
|
+
readsCounted: number;
|
|
40
|
+
ref: PreBinEntry;
|
|
41
|
+
}
|
|
42
|
+
export interface PreBaseCoverageBinSubtypes {
|
|
43
|
+
snps: PreBinType;
|
|
44
|
+
mods: PreBinType;
|
|
45
|
+
nonmods: PreBinType;
|
|
46
|
+
delskips: PreBinType;
|
|
47
|
+
noncov: PreBinType;
|
|
48
|
+
}
|
|
49
|
+
export interface ModificationType {
|
|
50
|
+
type: string;
|
|
51
|
+
base: string;
|
|
52
|
+
strand: string;
|
|
53
|
+
}
|
|
54
|
+
export interface ModificationTypeWithColor {
|
|
55
|
+
color: string;
|
|
56
|
+
type: string;
|
|
57
|
+
base: string;
|
|
58
|
+
strand: string;
|
|
59
|
+
}
|
|
60
|
+
export interface ColorBy {
|
|
61
|
+
type: string;
|
|
62
|
+
tag?: string;
|
|
63
|
+
modifications?: {
|
|
64
|
+
twoColor?: boolean;
|
|
65
|
+
isolatedModification?: string;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
export interface FilterBy {
|
|
69
|
+
flagExclude: number;
|
|
70
|
+
flagInclude: number;
|
|
71
|
+
readName?: string;
|
|
72
|
+
tagFilter?: {
|
|
73
|
+
tag: string;
|
|
74
|
+
value?: string;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export interface SortedBy {
|
|
78
|
+
type: string;
|
|
79
|
+
pos: number;
|
|
80
|
+
refName: string;
|
|
81
|
+
assemblyName: string;
|
|
82
|
+
tag?: string;
|
|
83
|
+
}
|
|
84
|
+
export interface Mismatch {
|
|
85
|
+
qual?: number;
|
|
86
|
+
start: number;
|
|
87
|
+
length: number;
|
|
88
|
+
type: string;
|
|
89
|
+
base: string;
|
|
90
|
+
altbase?: string;
|
|
91
|
+
seq?: string;
|
|
92
|
+
cliplen?: number;
|
|
93
|
+
}
|
|
94
|
+
export {};
|
package/dist/shared/util.d.ts
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
import { ChainData } from './fetchChains';
|
|
2
2
|
export declare function hasPairedReads(features: ChainData): boolean;
|
|
3
|
+
export declare function alphaColor(baseColor: string, p: number): string;
|
|
4
|
+
export declare const defaultFilterFlags: {
|
|
5
|
+
flagInclude: number;
|
|
6
|
+
flagExclude: number;
|
|
7
|
+
};
|
|
8
|
+
export declare function cacheGetter<T>(ctor: {
|
|
9
|
+
prototype: T;
|
|
10
|
+
}, prop: keyof T): void;
|