@jbrowse/plugin-alignments 3.6.5 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AlignmentsFeatureDetail/stateModelFactory.d.ts +4 -4
- package/dist/CramAdapter/CramAdapter.js +1 -1
- package/dist/CramAdapter/CramSlightlyLazyFeature.js +8 -7
- package/dist/CramAdapter/{util.js → readFeaturesToCIGAR.js} +4 -5
- package/dist/CramAdapter/readFeaturesToMismatches.d.ts +5 -0
- package/dist/CramAdapter/readFeaturesToMismatches.js +106 -0
- package/dist/LinearAlignmentsDisplay/components/AlignmentsDisplay.js +6 -2
- package/dist/LinearPileupDisplay/SharedLinearPileupDisplayMixin.d.ts +17 -2
- package/dist/LinearPileupDisplay/SharedLinearPileupDisplayMixin.js +2 -2
- package/dist/LinearPileupDisplay/components/GroupByDialog.js +4 -4
- package/dist/LinearPileupDisplay/components/SetModificationThresholdDialog.d.ts +10 -0
- package/dist/LinearPileupDisplay/components/SetModificationThresholdDialog.js +39 -0
- package/dist/LinearPileupDisplay/doAfterAttach.d.ts +1 -0
- package/dist/LinearPileupDisplay/doAfterAttach.js +3 -2
- package/dist/LinearPileupDisplay/model.d.ts +20 -2
- package/dist/LinearPileupDisplay/model.js +39 -4
- package/dist/LinearReadArcsDisplay/index.js +1 -1
- package/dist/LinearReadArcsDisplay/model.d.ts +23 -30
- package/dist/LinearReadArcsDisplay/model.js +5 -86
- package/dist/LinearReadCloudDisplay/components/ReactComponent.js +84 -2
- package/dist/LinearReadCloudDisplay/components/SetFeatureHeightDialog.d.ts +10 -0
- package/dist/LinearReadCloudDisplay/components/SetFeatureHeightDialog.js +26 -0
- package/dist/LinearReadCloudDisplay/configSchema.d.ts +7 -0
- package/dist/LinearReadCloudDisplay/configSchema.js +5 -0
- package/dist/LinearReadCloudDisplay/drawFeatsAbstract.js +13 -0
- package/dist/LinearReadCloudDisplay/drawFeatsCloud.js +24 -0
- package/dist/LinearReadCloudDisplay/drawFeatsCommon.d.ts +23 -0
- package/dist/LinearReadCloudDisplay/drawFeatsCommon.js +198 -0
- package/dist/LinearReadCloudDisplay/drawFeatsStack.d.ts +2 -0
- package/dist/LinearReadCloudDisplay/drawFeatsStack.js +36 -0
- package/dist/LinearReadCloudDisplay/index.js +1 -1
- package/dist/LinearReadCloudDisplay/model.d.ts +51 -31
- package/dist/LinearReadCloudDisplay/model.js +93 -78
- package/dist/LinearSNPCoverageDisplay/components/TooltipContents.d.ts +3 -0
- package/dist/LinearSNPCoverageDisplay/components/TooltipContents.js +148 -19
- package/dist/LinearSNPCoverageDisplay/model.js +14 -3
- package/dist/MismatchParser/cigarToMismatches.js +1 -0
- package/dist/ModificationParser/detectSimplexModifications.d.ts +4 -0
- package/dist/ModificationParser/detectSimplexModifications.js +20 -0
- package/dist/ModificationParser/getModPositions.d.ts +1 -1
- package/dist/ModificationParser/getModPositions.js +13 -16
- package/dist/PileupRPC/methods/GetVisibleModifications.d.ts +4 -1
- package/dist/PileupRPC/methods/GetVisibleModifications.js +16 -3
- package/dist/PileupRenderer/PileupRenderer.d.ts +6 -1
- package/dist/PileupRenderer/PileupRenderer.js +11 -14
- package/dist/PileupRenderer/components/PileupRendering.d.ts +8 -15
- package/dist/PileupRenderer/components/PileupRendering.js +18 -2
- package/dist/PileupRenderer/makeImageData.d.ts +5 -2
- package/dist/PileupRenderer/makeImageData.js +37 -6
- package/dist/PileupRenderer/{getAlignmentShapeColor.js → renderers/getAlignmentShapeColor.js} +2 -2
- package/{esm/PileupRenderer → dist/PileupRenderer/renderers}/renderAlignment.d.ts +6 -3
- package/dist/PileupRenderer/{renderAlignment.js → renderers/renderAlignment.js} +12 -3
- package/{esm/PileupRenderer → dist/PileupRenderer/renderers}/renderAlignmentShape.d.ts +2 -2
- package/dist/PileupRenderer/{renderAlignmentShape.js → renderers/renderAlignmentShape.js} +1 -1
- package/dist/PileupRenderer/{renderMethylation.d.ts → renderers/renderMethylation.d.ts} +2 -2
- package/dist/PileupRenderer/{renderMethylation.js → renderers/renderMethylation.js} +2 -2
- package/dist/PileupRenderer/{renderMismatches.d.ts → renderers/renderMismatches.d.ts} +6 -3
- package/dist/PileupRenderer/{renderMismatches.js → renderers/renderMismatches.js} +29 -5
- package/dist/PileupRenderer/{renderModifications.d.ts → renderers/renderModifications.d.ts} +6 -3
- package/dist/PileupRenderer/renderers/renderModifications.js +84 -0
- package/dist/PileupRenderer/{renderPerBaseLettering.d.ts → renderers/renderPerBaseLettering.d.ts} +1 -1
- package/dist/PileupRenderer/{renderPerBaseLettering.js → renderers/renderPerBaseLettering.js} +1 -1
- package/{esm/PileupRenderer → dist/PileupRenderer/renderers}/renderPerBaseQuality.d.ts +1 -1
- package/dist/PileupRenderer/{renderPerBaseQuality.js → renderers/renderPerBaseQuality.js} +1 -1
- package/dist/PileupRenderer/{renderSoftClipping.d.ts → renderers/renderSoftClipping.d.ts} +2 -2
- package/dist/PileupRenderer/{renderSoftClipping.js → renderers/renderSoftClipping.js} +2 -2
- package/dist/PileupRenderer/types.d.ts +6 -0
- package/dist/SNPCoverageAdapter/generateCoverageBins.js +5 -4
- package/dist/SNPCoverageAdapter/processModifications.js +14 -4
- package/dist/SNPCoverageRenderer/makeImage.js +44 -33
- package/dist/SNPCoverageRenderer/types.d.ts +1 -0
- package/dist/shared/LinearReadDisplayBaseMixin.d.ts +24 -0
- package/dist/shared/LinearReadDisplayBaseMixin.js +50 -0
- package/dist/shared/LinearReadDisplayWithLayoutMixin.d.ts +11 -0
- package/dist/shared/LinearReadDisplayWithLayoutMixin.js +24 -0
- package/dist/shared/LinearReadDisplayWithPairFiltersMixin.d.ts +11 -0
- package/dist/shared/LinearReadDisplayWithPairFiltersMixin.js +27 -0
- package/dist/shared/afterAttach.js +3 -2
- package/dist/shared/chainToSimpleFeature.d.ts +3 -0
- package/dist/shared/chainToSimpleFeature.js +43 -0
- package/dist/shared/chevron.d.ts +1 -0
- package/dist/shared/chevron.js +27 -0
- package/dist/shared/color.d.ts +43 -6
- package/dist/shared/color.js +101 -22
- package/dist/shared/components/BaseDisplayComponent.d.ts +12 -3
- package/dist/shared/components/BaseDisplayComponent.js +2 -2
- package/dist/shared/components/SetFeatureHeightDialog.d.ts +10 -0
- package/dist/shared/components/SetFeatureHeightDialog.js +26 -0
- package/dist/shared/components/SetMaxHeightDialog.d.ts +8 -0
- package/dist/shared/components/SetMaxHeightDialog.js +28 -0
- package/dist/shared/drawLongReadChains.d.ts +24 -0
- package/dist/shared/drawLongReadChains.js +104 -0
- package/dist/shared/drawPairChains.d.ts +24 -0
- package/dist/shared/drawPairChains.js +94 -0
- package/dist/shared/flatbushType.d.ts +12 -0
- package/dist/shared/flatbushType.js +2 -0
- package/dist/shared/getUniqueModifications.d.ts +4 -1
- package/dist/shared/menuItems.d.ts +23 -0
- package/dist/shared/menuItems.js +89 -0
- package/dist/shared/modificationData.d.ts +6 -0
- package/dist/shared/modificationData.js +22 -0
- package/dist/shared/primaryStrand.d.ts +3 -0
- package/dist/shared/primaryStrand.js +24 -0
- package/dist/shared/types.d.ts +2 -0
- package/dist/shared/util.d.ts +2 -0
- package/dist/shared/util.js +6 -1
- package/dist/util.d.ts +1 -6
- package/dist/util.js +4 -15
- package/esm/AlignmentsFeatureDetail/stateModelFactory.d.ts +4 -4
- package/esm/CramAdapter/CramAdapter.js +1 -1
- package/esm/CramAdapter/CramSlightlyLazyFeature.js +2 -1
- package/esm/CramAdapter/{util.js → readFeaturesToCIGAR.js} +4 -5
- package/esm/CramAdapter/readFeaturesToMismatches.d.ts +5 -0
- package/esm/CramAdapter/readFeaturesToMismatches.js +103 -0
- package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.js +6 -2
- package/esm/LinearPileupDisplay/SharedLinearPileupDisplayMixin.d.ts +17 -2
- package/esm/LinearPileupDisplay/SharedLinearPileupDisplayMixin.js +2 -2
- package/esm/LinearPileupDisplay/components/GroupByDialog.js +4 -4
- package/esm/LinearPileupDisplay/components/SetModificationThresholdDialog.d.ts +10 -0
- package/esm/LinearPileupDisplay/components/SetModificationThresholdDialog.js +37 -0
- package/esm/LinearPileupDisplay/doAfterAttach.d.ts +1 -0
- package/esm/LinearPileupDisplay/doAfterAttach.js +3 -2
- package/esm/LinearPileupDisplay/model.d.ts +20 -2
- package/esm/LinearPileupDisplay/model.js +39 -4
- package/esm/LinearReadArcsDisplay/index.js +1 -1
- package/esm/LinearReadArcsDisplay/model.d.ts +23 -30
- package/esm/LinearReadArcsDisplay/model.js +5 -83
- package/esm/LinearReadCloudDisplay/components/ReactComponent.js +86 -4
- package/esm/LinearReadCloudDisplay/components/SetFeatureHeightDialog.d.ts +10 -0
- package/esm/LinearReadCloudDisplay/components/SetFeatureHeightDialog.js +24 -0
- package/esm/LinearReadCloudDisplay/configSchema.d.ts +7 -0
- package/esm/LinearReadCloudDisplay/configSchema.js +5 -0
- package/esm/LinearReadCloudDisplay/drawFeatsAbstract.d.ts +2 -0
- package/esm/LinearReadCloudDisplay/drawFeatsAbstract.js +10 -0
- package/esm/LinearReadCloudDisplay/drawFeatsCloud.d.ts +2 -0
- package/esm/LinearReadCloudDisplay/drawFeatsCloud.js +21 -0
- package/esm/LinearReadCloudDisplay/drawFeatsCommon.d.ts +23 -0
- package/esm/LinearReadCloudDisplay/drawFeatsCommon.js +187 -0
- package/esm/LinearReadCloudDisplay/drawFeatsStack.d.ts +2 -0
- package/esm/LinearReadCloudDisplay/drawFeatsStack.js +30 -0
- package/esm/LinearReadCloudDisplay/index.js +1 -1
- package/esm/LinearReadCloudDisplay/model.d.ts +51 -31
- package/esm/LinearReadCloudDisplay/model.js +94 -76
- package/esm/LinearSNPCoverageDisplay/components/TooltipContents.d.ts +3 -0
- package/esm/LinearSNPCoverageDisplay/components/TooltipContents.js +149 -20
- package/esm/LinearSNPCoverageDisplay/model.js +14 -3
- package/esm/MismatchParser/cigarToMismatches.js +1 -0
- package/esm/ModificationParser/detectSimplexModifications.d.ts +4 -0
- package/esm/ModificationParser/detectSimplexModifications.js +17 -0
- package/esm/ModificationParser/getModPositions.d.ts +1 -1
- package/esm/ModificationParser/getModPositions.js +13 -16
- package/esm/PileupRPC/methods/GetVisibleModifications.d.ts +4 -1
- package/esm/PileupRPC/methods/GetVisibleModifications.js +16 -3
- package/esm/PileupRenderer/PileupRenderer.d.ts +6 -1
- package/esm/PileupRenderer/PileupRenderer.js +11 -14
- package/esm/PileupRenderer/components/PileupRendering.d.ts +8 -15
- package/esm/PileupRenderer/components/PileupRendering.js +16 -3
- package/esm/PileupRenderer/makeImageData.d.ts +5 -2
- package/esm/PileupRenderer/makeImageData.js +34 -6
- package/esm/PileupRenderer/{getAlignmentShapeColor.js → renderers/getAlignmentShapeColor.js} +2 -2
- package/{dist/PileupRenderer → esm/PileupRenderer/renderers}/renderAlignment.d.ts +6 -3
- package/esm/PileupRenderer/{renderAlignment.js → renderers/renderAlignment.js} +12 -3
- package/{dist/PileupRenderer → esm/PileupRenderer/renderers}/renderAlignmentShape.d.ts +2 -2
- package/esm/PileupRenderer/{renderAlignmentShape.js → renderers/renderAlignmentShape.js} +1 -1
- package/esm/PileupRenderer/{renderMethylation.d.ts → renderers/renderMethylation.d.ts} +2 -2
- package/esm/PileupRenderer/{renderMethylation.js → renderers/renderMethylation.js} +2 -2
- package/esm/PileupRenderer/{renderMismatches.d.ts → renderers/renderMismatches.d.ts} +6 -3
- package/esm/PileupRenderer/{renderMismatches.js → renderers/renderMismatches.js} +29 -5
- package/esm/PileupRenderer/{renderModifications.d.ts → renderers/renderModifications.d.ts} +6 -3
- package/esm/PileupRenderer/renderers/renderModifications.js +81 -0
- package/esm/PileupRenderer/{renderPerBaseLettering.d.ts → renderers/renderPerBaseLettering.d.ts} +1 -1
- package/esm/PileupRenderer/{renderPerBaseLettering.js → renderers/renderPerBaseLettering.js} +1 -1
- package/{dist/PileupRenderer → esm/PileupRenderer/renderers}/renderPerBaseQuality.d.ts +1 -1
- package/esm/PileupRenderer/{renderPerBaseQuality.js → renderers/renderPerBaseQuality.js} +1 -1
- package/esm/PileupRenderer/{renderSoftClipping.d.ts → renderers/renderSoftClipping.d.ts} +2 -2
- package/esm/PileupRenderer/{renderSoftClipping.js → renderers/renderSoftClipping.js} +2 -2
- package/esm/PileupRenderer/types.d.ts +6 -0
- package/esm/SNPCoverageAdapter/generateCoverageBins.js +5 -4
- package/esm/SNPCoverageAdapter/processModifications.js +14 -4
- package/esm/SNPCoverageRenderer/makeImage.js +44 -33
- package/esm/SNPCoverageRenderer/types.d.ts +1 -0
- package/esm/shared/LinearReadDisplayBaseMixin.d.ts +24 -0
- package/esm/shared/LinearReadDisplayBaseMixin.js +47 -0
- package/esm/shared/LinearReadDisplayWithLayoutMixin.d.ts +11 -0
- package/esm/shared/LinearReadDisplayWithLayoutMixin.js +21 -0
- package/esm/shared/LinearReadDisplayWithPairFiltersMixin.d.ts +11 -0
- package/esm/shared/LinearReadDisplayWithPairFiltersMixin.js +24 -0
- package/esm/shared/afterAttach.js +3 -2
- package/esm/shared/chainToSimpleFeature.d.ts +3 -0
- package/esm/shared/chainToSimpleFeature.js +40 -0
- package/esm/shared/chevron.d.ts +1 -0
- package/esm/shared/chevron.js +24 -0
- package/esm/shared/color.d.ts +43 -6
- package/esm/shared/color.js +96 -20
- package/esm/shared/components/BaseDisplayComponent.d.ts +12 -3
- package/esm/shared/components/BaseDisplayComponent.js +2 -2
- package/esm/shared/components/SetFeatureHeightDialog.d.ts +10 -0
- package/esm/shared/components/SetFeatureHeightDialog.js +24 -0
- package/esm/shared/components/SetMaxHeightDialog.d.ts +8 -0
- package/esm/shared/components/SetMaxHeightDialog.js +26 -0
- package/esm/shared/drawLongReadChains.d.ts +24 -0
- package/esm/shared/drawLongReadChains.js +101 -0
- package/esm/shared/drawPairChains.d.ts +24 -0
- package/esm/shared/drawPairChains.js +91 -0
- package/esm/shared/flatbushType.d.ts +12 -0
- package/esm/shared/flatbushType.js +1 -0
- package/esm/shared/getUniqueModifications.d.ts +4 -1
- package/esm/shared/menuItems.d.ts +23 -0
- package/esm/shared/menuItems.js +49 -0
- package/esm/shared/modificationData.d.ts +6 -0
- package/esm/shared/modificationData.js +18 -0
- package/esm/shared/primaryStrand.d.ts +3 -0
- package/esm/shared/primaryStrand.js +20 -0
- package/esm/shared/types.d.ts +2 -0
- package/esm/shared/util.d.ts +2 -0
- package/esm/shared/util.js +4 -0
- package/esm/util.d.ts +1 -6
- package/esm/util.js +2 -14
- package/package.json +6 -6
- package/dist/LinearReadCloudDisplay/drawFeats.js +0 -27
- package/dist/LinearReadCloudDisplay/drawLongReadChains.d.ts +0 -11
- package/dist/LinearReadCloudDisplay/drawLongReadChains.js +0 -64
- package/dist/LinearReadCloudDisplay/drawPairChains.d.ts +0 -17
- package/dist/LinearReadCloudDisplay/drawPairChains.js +0 -94
- package/dist/PileupRenderer/renderModifications.js +0 -44
- package/esm/LinearReadCloudDisplay/drawFeats.js +0 -24
- package/esm/LinearReadCloudDisplay/drawLongReadChains.d.ts +0 -11
- package/esm/LinearReadCloudDisplay/drawLongReadChains.js +0 -61
- package/esm/LinearReadCloudDisplay/drawPairChains.d.ts +0 -17
- package/esm/LinearReadCloudDisplay/drawPairChains.js +0 -90
- package/esm/PileupRenderer/renderModifications.js +0 -41
- /package/dist/CramAdapter/{util.d.ts → readFeaturesToCIGAR.d.ts} +0 -0
- /package/dist/LinearReadCloudDisplay/{drawFeats.d.ts → drawFeatsAbstract.d.ts} +0 -0
- /package/{esm/LinearReadCloudDisplay/drawFeats.d.ts → dist/LinearReadCloudDisplay/drawFeatsCloud.d.ts} +0 -0
- /package/dist/PileupRenderer/{getAlignmentShapeColor.d.ts → renderers/getAlignmentShapeColor.d.ts} +0 -0
- /package/dist/{LinearReadCloudDisplay/util.d.ts → shared/canvasUtils.d.ts} +0 -0
- /package/dist/{LinearReadCloudDisplay/util.js → shared/canvasUtils.js} +0 -0
- /package/esm/CramAdapter/{util.d.ts → readFeaturesToCIGAR.d.ts} +0 -0
- /package/esm/PileupRenderer/{getAlignmentShapeColor.d.ts → renderers/getAlignmentShapeColor.d.ts} +0 -0
- /package/esm/{LinearReadCloudDisplay/util.d.ts → shared/canvasUtils.d.ts} +0 -0
- /package/esm/{LinearReadCloudDisplay/util.js → shared/canvasUtils.js} +0 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { lazy } from 'react';
|
|
2
|
+
import { getSession } from '@jbrowse/core/util';
|
|
3
|
+
import FilterListIcon from '@mui/icons-material/ClearAll';
|
|
4
|
+
import PaletteIcon from '@mui/icons-material/Palette';
|
|
5
|
+
const FilterByTagDialog = lazy(() => import('./components/FilterByTagDialog'));
|
|
6
|
+
export function getColorSchemeMenuItem(model) {
|
|
7
|
+
return {
|
|
8
|
+
label: 'Color scheme',
|
|
9
|
+
icon: PaletteIcon,
|
|
10
|
+
subMenu: [
|
|
11
|
+
{
|
|
12
|
+
label: 'Insert size ± 3σ and orientation',
|
|
13
|
+
onClick: () => {
|
|
14
|
+
model.setColorScheme({ type: 'insertSizeAndOrientation' });
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
label: 'Insert size ± 3σ',
|
|
19
|
+
onClick: () => {
|
|
20
|
+
model.setColorScheme({ type: 'insertSize' });
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
label: 'Orientation',
|
|
25
|
+
onClick: () => {
|
|
26
|
+
model.setColorScheme({ type: 'orientation' });
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
label: 'Insert size gradient',
|
|
31
|
+
onClick: () => {
|
|
32
|
+
model.setColorScheme({ type: 'gradient' });
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export function getFilterByMenuItem(model) {
|
|
39
|
+
return {
|
|
40
|
+
label: 'Filter by',
|
|
41
|
+
icon: FilterListIcon,
|
|
42
|
+
onClick: () => {
|
|
43
|
+
getSession(model).queueDialog((handleClose) => [
|
|
44
|
+
FilterByTagDialog,
|
|
45
|
+
{ model, handleClose },
|
|
46
|
+
]);
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const modificationData = {
|
|
2
|
+
m: { color: 'rgb(255,0,0)', name: '5mC' },
|
|
3
|
+
h: { color: 'rgb(255,0,255)', name: '5hmC' },
|
|
4
|
+
o: { color: 'rgb(111, 78, 129)', name: '8oxoG' },
|
|
5
|
+
f: { color: 'rgb(246, 200, 95)', name: '5fC' },
|
|
6
|
+
c: { color: 'rgb(157, 216, 102)', name: '5cac' },
|
|
7
|
+
g: { color: 'rgb(255, 160, 86)', name: '5hmu' },
|
|
8
|
+
e: { color: 'rgb(141, 221, 208)', name: '5fU' },
|
|
9
|
+
b: { color: 'rgb(0,100,47)', name: '5caU' },
|
|
10
|
+
a: { color: 'rgb(51,0,111)', name: '6mA' },
|
|
11
|
+
17082: { color: 'rgb(51,153,255)', name: 'pseU' },
|
|
12
|
+
17596: { color: 'rgb(102,153,0)', name: 'inosine' },
|
|
13
|
+
21839: { color: 'rgb(153,0,153)', name: '4mC' },
|
|
14
|
+
};
|
|
15
|
+
export function getModificationName(type) {
|
|
16
|
+
var _a;
|
|
17
|
+
return ((_a = modificationData[type]) === null || _a === void 0 ? void 0 : _a.name) || type;
|
|
18
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export function getPrimaryStrand(feat) {
|
|
2
|
+
var _a, _b;
|
|
3
|
+
if (!(feat.flags & 2048)) {
|
|
4
|
+
return feat.strand;
|
|
5
|
+
}
|
|
6
|
+
else {
|
|
7
|
+
const res = (_b = (_a = feat.SA) === null || _a === void 0 ? void 0 : _a.split(';')[0]) === null || _b === void 0 ? void 0 : _b.split(',')[2];
|
|
8
|
+
return res === '-' ? -1 : 1;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export function getPrimaryStrandFromFlags(feat) {
|
|
12
|
+
var _a, _b;
|
|
13
|
+
if (!(feat.flags & 2048)) {
|
|
14
|
+
return feat.flags & 16 ? -1 : 1;
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
const res = (_b = (_a = feat.SA) === null || _a === void 0 ? void 0 : _a.split(';')[0]) === null || _b === void 0 ? void 0 : _b.split(',')[2];
|
|
18
|
+
return res === '-' ? -1 : 1;
|
|
19
|
+
}
|
|
20
|
+
}
|
package/esm/shared/types.d.ts
CHANGED
|
@@ -63,6 +63,7 @@ export interface ColorBy {
|
|
|
63
63
|
modifications?: {
|
|
64
64
|
twoColor?: boolean;
|
|
65
65
|
isolatedModification?: string;
|
|
66
|
+
threshold?: number;
|
|
66
67
|
};
|
|
67
68
|
}
|
|
68
69
|
export interface FilterBy {
|
|
@@ -85,6 +86,7 @@ export interface Mismatch {
|
|
|
85
86
|
qual?: number;
|
|
86
87
|
start: number;
|
|
87
88
|
length: number;
|
|
89
|
+
insertedBases?: string;
|
|
88
90
|
type: string;
|
|
89
91
|
base: string;
|
|
90
92
|
altbase?: string;
|
package/esm/shared/util.d.ts
CHANGED
|
@@ -18,3 +18,5 @@ export declare function cacheGetter<T>(ctor: {
|
|
|
18
18
|
}, prop: keyof T): void;
|
|
19
19
|
export declare function filterReadFlag(flags: number, flagInclude: number, flagExclude: number): boolean;
|
|
20
20
|
export declare function filterTagValue(readVal: unknown, filterVal?: string): boolean;
|
|
21
|
+
export declare function shouldRenderChevrons(bpPerPx: number, featureHeight: number): boolean;
|
|
22
|
+
export declare const CHEVRON_WIDTH = 5;
|
package/esm/shared/util.js
CHANGED
|
@@ -53,3 +53,7 @@ export function filterTagValue(readVal, filterVal) {
|
|
|
53
53
|
? readVal === undefined
|
|
54
54
|
: `${readVal}` !== `${filterVal}`;
|
|
55
55
|
}
|
|
56
|
+
export function shouldRenderChevrons(bpPerPx, featureHeight) {
|
|
57
|
+
return bpPerPx < 50 && featureHeight >= 3;
|
|
58
|
+
}
|
|
59
|
+
export const CHEVRON_WIDTH = 5;
|
package/esm/util.d.ts
CHANGED
|
@@ -16,15 +16,10 @@ export declare const pairMap: {
|
|
|
16
16
|
};
|
|
17
17
|
export declare function getColorWGBS(strand: number, base: string): "#f00" | "#00f" | "#888";
|
|
18
18
|
export declare function fetchSequence(region: AugmentedRegion, adapter: BaseFeatureDataAdapter): Promise<any>;
|
|
19
|
-
interface ModificationData {
|
|
20
|
-
color: string;
|
|
21
|
-
name: string;
|
|
22
|
-
}
|
|
23
|
-
export declare const modificationData: Record<string, ModificationData>;
|
|
24
19
|
type DisplayModel = IAnyStateTreeNode & {
|
|
25
20
|
setError: (arg: unknown) => void;
|
|
26
21
|
};
|
|
27
22
|
export declare function createAutorun(self: DisplayModel, cb: () => Promise<void>, opts?: IAutorunOptions): void;
|
|
28
23
|
export declare function randomColor(str: string): string;
|
|
29
24
|
export declare function getColorForModification(str: string): string;
|
|
30
|
-
export {};
|
|
25
|
+
export { modificationData } from './shared/modificationData';
|
package/esm/util.js
CHANGED
|
@@ -2,6 +2,7 @@ import { autorun } from 'mobx';
|
|
|
2
2
|
import { addDisposer, isAlive } from 'mobx-state-tree';
|
|
3
3
|
import { firstValueFrom } from 'rxjs';
|
|
4
4
|
import { toArray } from 'rxjs/operators';
|
|
5
|
+
import { modificationData } from './shared/modificationData';
|
|
5
6
|
export function getTagAlt(feature, tag, alt) {
|
|
6
7
|
var _a;
|
|
7
8
|
const tags = feature.get('tags');
|
|
@@ -77,20 +78,6 @@ export async function fetchSequence(region, adapter) {
|
|
|
77
78
|
.pipe(toArray()));
|
|
78
79
|
return (_a = feats[0]) === null || _a === void 0 ? void 0 : _a.get('seq');
|
|
79
80
|
}
|
|
80
|
-
export const modificationData = {
|
|
81
|
-
m: { color: 'rgb(255,0,0)', name: '5mC' },
|
|
82
|
-
h: { color: 'rgb(255,0,255)', name: '5hmC' },
|
|
83
|
-
o: { color: 'rgb(111, 78, 129)', name: '8oxoG' },
|
|
84
|
-
f: { color: 'rgb(246, 200, 95)', name: '5fC' },
|
|
85
|
-
c: { color: 'rgb(157, 216, 102)', name: '5cac' },
|
|
86
|
-
g: { color: 'rgb(255, 160, 86)', name: '5hmu' },
|
|
87
|
-
e: { color: 'rgb(141, 221, 208)', name: '5fU' },
|
|
88
|
-
b: { color: 'rgb(0,100,47)', name: '5caU' },
|
|
89
|
-
a: { color: 'rgb(51,0,111)', name: '6mA' },
|
|
90
|
-
17082: { color: 'rgb(51,153,255)', name: 'pseU' },
|
|
91
|
-
17596: { color: 'rgb(102,153,0)', name: 'inosine' },
|
|
92
|
-
21839: { color: 'rgb(153,0,153)', name: '4mC' },
|
|
93
|
-
};
|
|
94
81
|
export function createAutorun(self, cb, opts) {
|
|
95
82
|
addDisposer(self, autorun(async () => {
|
|
96
83
|
try {
|
|
@@ -114,3 +101,4 @@ export function getColorForModification(str) {
|
|
|
114
101
|
var _a;
|
|
115
102
|
return ((_a = modificationData[str]) === null || _a === void 0 ? void 0 : _a.color) || randomColor(str);
|
|
116
103
|
}
|
|
104
|
+
export { modificationData } from './shared/modificationData';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-alignments",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.0",
|
|
4
4
|
"description": "JBrowse 2 alignments adapters, tracks, etc.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@gmod/bam": "^6.0.1",
|
|
40
40
|
"@gmod/cram": "^5.0.4",
|
|
41
|
-
"@jbrowse/core": "^3.
|
|
42
|
-
"@jbrowse/plugin-linear-genome-view": "^3.
|
|
43
|
-
"@jbrowse/plugin-wiggle": "^3.
|
|
44
|
-
"@jbrowse/sv-core": "^3.
|
|
41
|
+
"@jbrowse/core": "^3.7.0",
|
|
42
|
+
"@jbrowse/plugin-linear-genome-view": "^3.7.0",
|
|
43
|
+
"@jbrowse/plugin-wiggle": "^3.7.0",
|
|
44
|
+
"@jbrowse/sv-core": "^3.7.0",
|
|
45
45
|
"@mui/icons-material": "^7.0.0",
|
|
46
46
|
"@mui/material": "^7.0.0",
|
|
47
47
|
"canvas2svg": "^1.0.16",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"distModule": "esm/index.js",
|
|
64
64
|
"srcModule": "src/index.ts",
|
|
65
65
|
"module": "esm/index.js",
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "85bdd0d58286b7adbfd408146b15847676317635"
|
|
67
67
|
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.drawFeats = drawFeats;
|
|
4
|
-
const util_1 = require("@jbrowse/core/util");
|
|
5
|
-
const drawLongReadChains_1 = require("./drawLongReadChains");
|
|
6
|
-
const drawPairChains_1 = require("./drawPairChains");
|
|
7
|
-
const util_2 = require("../shared/util");
|
|
8
|
-
function drawFeats(self, ctx) {
|
|
9
|
-
const { chainData } = self;
|
|
10
|
-
if (!chainData) {
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
const { assemblyManager } = (0, util_1.getSession)(self);
|
|
14
|
-
const view = (0, util_1.getContainingView)(self);
|
|
15
|
-
const assemblyName = view.assemblyNames[0];
|
|
16
|
-
const asm = assemblyManager.get(assemblyName);
|
|
17
|
-
if (!asm) {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
const hasPaired = (0, util_2.hasPairedReads)(chainData);
|
|
21
|
-
if (hasPaired) {
|
|
22
|
-
(0, drawPairChains_1.drawPairChains)({ self, view, asm, ctx, chainData });
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
(0, drawLongReadChains_1.drawLongReadChains)({ self, view, asm, ctx, chainData });
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { LinearReadCloudDisplayModel } from './model';
|
|
2
|
-
import type { ChainData } from '../shared/fetchChains';
|
|
3
|
-
import type { Assembly } from '@jbrowse/core/assemblyManager/assembly';
|
|
4
|
-
import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view';
|
|
5
|
-
export declare function drawLongReadChains({ ctx, self, chainData, view, asm, }: {
|
|
6
|
-
ctx: CanvasRenderingContext2D;
|
|
7
|
-
self: LinearReadCloudDisplayModel;
|
|
8
|
-
chainData: ChainData;
|
|
9
|
-
view: LinearGenomeViewModel;
|
|
10
|
-
asm: Assembly;
|
|
11
|
-
}): void;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.drawLongReadChains = drawLongReadChains;
|
|
4
|
-
const configuration_1 = require("@jbrowse/core/configuration");
|
|
5
|
-
const util_1 = require("@jbrowse/core/util");
|
|
6
|
-
const util_2 = require("./util");
|
|
7
|
-
const color_1 = require("../shared/color");
|
|
8
|
-
function drawLongReadChains({ ctx, self, chainData, view, asm, }) {
|
|
9
|
-
var _a, _b, _c, _d, _e;
|
|
10
|
-
const computedChains = [];
|
|
11
|
-
const { chains } = chainData;
|
|
12
|
-
const { height } = self;
|
|
13
|
-
const featureHeight = (0, configuration_1.getConf)(self, 'featureHeight');
|
|
14
|
-
for (const chain of chains) {
|
|
15
|
-
let minX = Number.MAX_VALUE;
|
|
16
|
-
let maxX = Number.MIN_VALUE;
|
|
17
|
-
for (const elt of chain) {
|
|
18
|
-
const refName = asm.getCanonicalRefName(elt.refName) || elt.refName;
|
|
19
|
-
const rs = (_a = view.bpToPx({ refName, coord: elt.start })) === null || _a === void 0 ? void 0 : _a.offsetPx;
|
|
20
|
-
const re = (_b = view.bpToPx({ refName, coord: elt.end })) === null || _b === void 0 ? void 0 : _b.offsetPx;
|
|
21
|
-
if (rs !== undefined && re !== undefined) {
|
|
22
|
-
minX = Math.min(minX, rs);
|
|
23
|
-
maxX = Math.max(maxX, re);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
computedChains.push({
|
|
27
|
-
distance: Math.abs(maxX - minX),
|
|
28
|
-
minX,
|
|
29
|
-
chain,
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
const distances = computedChains.map(d => d.distance);
|
|
33
|
-
const maxD = Math.log((0, util_1.max)(distances));
|
|
34
|
-
const minD = Math.max(Math.log((0, util_1.min)(distances)) - 1, 0);
|
|
35
|
-
const scaler = (height - 20) / (maxD - minD);
|
|
36
|
-
const halfHeight = featureHeight / 2 - 0.5;
|
|
37
|
-
for (const { minX, distance, chain } of computedChains) {
|
|
38
|
-
const w = distance;
|
|
39
|
-
const top = (Math.log(w) - minD) * scaler;
|
|
40
|
-
(0, util_2.fillRectCtx)(minX - view.offsetPx, top + halfHeight, w, 1, ctx, 'black');
|
|
41
|
-
const c1 = chain[0];
|
|
42
|
-
let primaryStrand;
|
|
43
|
-
if (!(c1.flags & 2048)) {
|
|
44
|
-
primaryStrand = c1.strand;
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
const res = (_c = c1.SA) === null || _c === void 0 ? void 0 : _c.split(';')[0].split(',')[2];
|
|
48
|
-
primaryStrand = res === '-' ? -1 : 1;
|
|
49
|
-
}
|
|
50
|
-
for (const v0 of chain) {
|
|
51
|
-
const ra = asm.getCanonicalRefName(v0.refName) || v0.refName;
|
|
52
|
-
const rs = (_d = view.bpToPx({ refName: ra, coord: v0.start })) === null || _d === void 0 ? void 0 : _d.offsetPx;
|
|
53
|
-
const re = (_e = view.bpToPx({ refName: ra, coord: v0.end })) === null || _e === void 0 ? void 0 : _e.offsetPx;
|
|
54
|
-
if (rs !== undefined && re !== undefined) {
|
|
55
|
-
const w = Math.max(re - rs, 2);
|
|
56
|
-
const l = rs - view.offsetPx;
|
|
57
|
-
const effectiveStrand = v0.strand * primaryStrand;
|
|
58
|
-
const c = effectiveStrand === -1 ? 'color_rev_strand' : 'color_fwd_strand';
|
|
59
|
-
(0, util_2.strokeRectCtx)(l, top, w, featureHeight, ctx, color_1.strokeColor[c]);
|
|
60
|
-
(0, util_2.fillRectCtx)(l, top, w, featureHeight, ctx, color_1.fillColor[c]);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { LinearReadCloudDisplayModel } from './model';
|
|
2
|
-
import type { ChainData, ChainStats, ReducedFeature } from '../shared/fetchChains';
|
|
3
|
-
import type { Assembly } from '@jbrowse/core/assemblyManager/assembly';
|
|
4
|
-
import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view';
|
|
5
|
-
export declare function drawPairChains({ ctx, self, chainData, view, asm, }: {
|
|
6
|
-
ctx: CanvasRenderingContext2D;
|
|
7
|
-
self: LinearReadCloudDisplayModel;
|
|
8
|
-
chainData: ChainData;
|
|
9
|
-
view: LinearGenomeViewModel;
|
|
10
|
-
asm: Assembly;
|
|
11
|
-
}): void;
|
|
12
|
-
export declare function getPairedColor({ type, v0, v1, stats, }: {
|
|
13
|
-
type: string;
|
|
14
|
-
v0: ReducedFeature;
|
|
15
|
-
v1: ReducedFeature;
|
|
16
|
-
stats?: ChainStats;
|
|
17
|
-
}): readonly [string, string] | undefined;
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.drawPairChains = drawPairChains;
|
|
4
|
-
exports.getPairedColor = getPairedColor;
|
|
5
|
-
const configuration_1 = require("@jbrowse/core/configuration");
|
|
6
|
-
const util_1 = require("@jbrowse/core/util");
|
|
7
|
-
const util_2 = require("./util");
|
|
8
|
-
const color_1 = require("../shared/color");
|
|
9
|
-
function drawPairChains({ ctx, self, chainData, view, asm, }) {
|
|
10
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
11
|
-
const coords = [];
|
|
12
|
-
const featureHeight = (0, configuration_1.getConf)(self, 'featureHeight');
|
|
13
|
-
const type = ((_a = self.colorBy) === null || _a === void 0 ? void 0 : _a.type) || 'insertSizeAndOrientation';
|
|
14
|
-
const { chains, stats } = chainData;
|
|
15
|
-
for (const chain of chains) {
|
|
16
|
-
if (chain.length > 1) {
|
|
17
|
-
const v0 = chain[0];
|
|
18
|
-
const v1 = chain[1];
|
|
19
|
-
const ra1 = asm.getCanonicalRefName(v0.refName) || v0.refName;
|
|
20
|
-
const ra2 = asm.getCanonicalRefName(v1.refName) || v1.refName;
|
|
21
|
-
const r1s = (_b = view.bpToPx({ refName: ra1, coord: v0.start })) === null || _b === void 0 ? void 0 : _b.offsetPx;
|
|
22
|
-
const r1e = (_c = view.bpToPx({ refName: ra1, coord: v0.end })) === null || _c === void 0 ? void 0 : _c.offsetPx;
|
|
23
|
-
const r2s = (_d = view.bpToPx({ refName: ra2, coord: v1.start })) === null || _d === void 0 ? void 0 : _d.offsetPx;
|
|
24
|
-
const r2e = (_e = view.bpToPx({ refName: ra2, coord: v1.end })) === null || _e === void 0 ? void 0 : _e.offsetPx;
|
|
25
|
-
let distance = 0;
|
|
26
|
-
if (r1s !== undefined &&
|
|
27
|
-
r1e !== undefined &&
|
|
28
|
-
r2s !== undefined &&
|
|
29
|
-
r2e !== undefined) {
|
|
30
|
-
if (v0.refName === v1.refName) {
|
|
31
|
-
const s = Math.min(v0.start, v1.start);
|
|
32
|
-
const e = Math.max(v0.end, v1.end);
|
|
33
|
-
distance = Math.abs(e - s);
|
|
34
|
-
}
|
|
35
|
-
coords.push({
|
|
36
|
-
r1s,
|
|
37
|
-
r1e,
|
|
38
|
-
r2s,
|
|
39
|
-
r2e,
|
|
40
|
-
v0,
|
|
41
|
-
v1,
|
|
42
|
-
distance,
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
else if (self.drawSingletons) {
|
|
47
|
-
const v0 = chain[0];
|
|
48
|
-
const ra1 = asm.getCanonicalRefName(v0.refName) || v0.refName;
|
|
49
|
-
const r1s = (_f = view.bpToPx({ refName: ra1, coord: v0.start })) === null || _f === void 0 ? void 0 : _f.offsetPx;
|
|
50
|
-
const r1e = (_g = view.bpToPx({ refName: ra1, coord: v0.end })) === null || _g === void 0 ? void 0 : _g.offsetPx;
|
|
51
|
-
if (r1s !== undefined && r1e !== undefined) {
|
|
52
|
-
const w1 = Math.max(r1e - r1s, 2);
|
|
53
|
-
(0, util_2.fillRectCtx)(r1s - view.offsetPx, 0, w1, featureHeight, ctx, '#f00');
|
|
54
|
-
(0, util_2.strokeRectCtx)(r1s - view.offsetPx, 0, w1, featureHeight, ctx, '#a00');
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
const maxD = Math.log((0, util_1.max)(coords.map(c => c.distance)));
|
|
59
|
-
const minD = Math.max(Math.log((0, util_1.min)(coords.map(c => c.distance))) - 1, 0);
|
|
60
|
-
const scaler = (self.height - 20) / (maxD - minD);
|
|
61
|
-
for (const { r1e, r1s, r2e, r2s, distance, v0, v1 } of coords) {
|
|
62
|
-
const w1 = Math.max(r1e - r1s, 2);
|
|
63
|
-
const w2 = Math.max(r2e - r2s, 2);
|
|
64
|
-
const [fill, stroke] = getPairedColor({ type, v0, v1, stats }) || [];
|
|
65
|
-
const top = (Math.log(distance) - minD) * scaler;
|
|
66
|
-
const halfHeight = featureHeight / 2 - 0.5;
|
|
67
|
-
const w = r2s - r1e;
|
|
68
|
-
(0, util_2.fillRectCtx)(r1e - view.offsetPx, top + halfHeight, w, 1, ctx, 'black');
|
|
69
|
-
(0, util_2.strokeRectCtx)(r1s - view.offsetPx, top, w1, featureHeight, ctx, stroke);
|
|
70
|
-
(0, util_2.strokeRectCtx)(r2s - view.offsetPx, top, w2, featureHeight, ctx, stroke);
|
|
71
|
-
(0, util_2.fillRectCtx)(r1s - view.offsetPx, top, w1, featureHeight, ctx, fill);
|
|
72
|
-
(0, util_2.fillRectCtx)(r2s - view.offsetPx, top, w2, featureHeight, ctx, fill);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
function getPairedColor({ type, v0, v1, stats, }) {
|
|
76
|
-
if (type === 'insertSizeAndOrientation') {
|
|
77
|
-
return (0, color_1.getPairedInsertSizeAndOrientationColor)(v0, v1, stats);
|
|
78
|
-
}
|
|
79
|
-
if (type === 'orientation') {
|
|
80
|
-
return (0, color_1.getPairedOrientationColor)(v0);
|
|
81
|
-
}
|
|
82
|
-
if (type === 'insertSize') {
|
|
83
|
-
return (0, color_1.getPairedInsertSizeColor)(v0, v1, stats);
|
|
84
|
-
}
|
|
85
|
-
if (type === 'gradient') {
|
|
86
|
-
const s = Math.min(v0.start, v1.start);
|
|
87
|
-
const e = Math.max(v0.end, v1.end);
|
|
88
|
-
return [
|
|
89
|
-
`hsl(${Math.log10(Math.abs(e - s)) * 10},50%,50%)`,
|
|
90
|
-
`hsl(${Math.log10(Math.abs(e - s)) * 10},50%,30%)`,
|
|
91
|
-
];
|
|
92
|
-
}
|
|
93
|
-
return undefined;
|
|
94
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.renderModifications = renderModifications;
|
|
4
|
-
const util_1 = require("@jbrowse/core/util");
|
|
5
|
-
const util_2 = require("./util");
|
|
6
|
-
const getMaximumModificationAtEachPosition_1 = require("../shared/getMaximumModificationAtEachPosition");
|
|
7
|
-
const util_3 = require("../shared/util");
|
|
8
|
-
function renderModifications({ ctx, feat, region, bpPerPx, renderArgs, canvasWidth, cigarOps, }) {
|
|
9
|
-
var _a, _b, _c;
|
|
10
|
-
const { feature, topPx, heightPx } = feat;
|
|
11
|
-
const { colorBy, visibleModifications = {} } = renderArgs;
|
|
12
|
-
const seq = feature.get('seq');
|
|
13
|
-
if (!seq) {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
const start = feature.get('start');
|
|
17
|
-
const isolatedModification = (_a = colorBy === null || colorBy === void 0 ? void 0 : colorBy.modifications) === null || _a === void 0 ? void 0 : _a.isolatedModification;
|
|
18
|
-
const twoColor = (_b = colorBy === null || colorBy === void 0 ? void 0 : colorBy.modifications) === null || _b === void 0 ? void 0 : _b.twoColor;
|
|
19
|
-
(_c = (0, getMaximumModificationAtEachPosition_1.getMaxProbModAtEachPosition)(feature, cigarOps)) === null || _c === void 0 ? void 0 : _c.forEach(({ allProbs, prob, type }, pos) => {
|
|
20
|
-
const r = start + pos;
|
|
21
|
-
const [leftPx, rightPx] = (0, util_1.bpSpanPx)(r, r + 1, region, bpPerPx);
|
|
22
|
-
const mod = visibleModifications[type];
|
|
23
|
-
if (!mod) {
|
|
24
|
-
console.warn(`${type} not known yet`);
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
if (isolatedModification && mod.type !== isolatedModification) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
const col = mod.color || 'black';
|
|
31
|
-
const s = 1 - (0, util_1.sum)(allProbs);
|
|
32
|
-
if (twoColor && s > (0, util_1.max)(allProbs)) {
|
|
33
|
-
const c = (0, util_3.alphaColor)('blue', s);
|
|
34
|
-
const w = rightPx - leftPx + 0.5;
|
|
35
|
-
(0, util_2.fillRect)(ctx, leftPx, topPx, w, heightPx, canvasWidth, c);
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
const c = (0, util_3.alphaColor)(col, prob);
|
|
39
|
-
const w = rightPx - leftPx + 0.5;
|
|
40
|
-
(0, util_2.fillRect)(ctx, leftPx, topPx, w, heightPx, canvasWidth, c);
|
|
41
|
-
}
|
|
42
|
-
pos++;
|
|
43
|
-
});
|
|
44
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { getContainingView, getSession } from '@jbrowse/core/util';
|
|
2
|
-
import { drawLongReadChains } from './drawLongReadChains';
|
|
3
|
-
import { drawPairChains } from './drawPairChains';
|
|
4
|
-
import { hasPairedReads } from '../shared/util';
|
|
5
|
-
export function drawFeats(self, ctx) {
|
|
6
|
-
const { chainData } = self;
|
|
7
|
-
if (!chainData) {
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
const { assemblyManager } = getSession(self);
|
|
11
|
-
const view = getContainingView(self);
|
|
12
|
-
const assemblyName = view.assemblyNames[0];
|
|
13
|
-
const asm = assemblyManager.get(assemblyName);
|
|
14
|
-
if (!asm) {
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
const hasPaired = hasPairedReads(chainData);
|
|
18
|
-
if (hasPaired) {
|
|
19
|
-
drawPairChains({ self, view, asm, ctx, chainData });
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
drawLongReadChains({ self, view, asm, ctx, chainData });
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { LinearReadCloudDisplayModel } from './model';
|
|
2
|
-
import type { ChainData } from '../shared/fetchChains';
|
|
3
|
-
import type { Assembly } from '@jbrowse/core/assemblyManager/assembly';
|
|
4
|
-
import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view';
|
|
5
|
-
export declare function drawLongReadChains({ ctx, self, chainData, view, asm, }: {
|
|
6
|
-
ctx: CanvasRenderingContext2D;
|
|
7
|
-
self: LinearReadCloudDisplayModel;
|
|
8
|
-
chainData: ChainData;
|
|
9
|
-
view: LinearGenomeViewModel;
|
|
10
|
-
asm: Assembly;
|
|
11
|
-
}): void;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { getConf } from '@jbrowse/core/configuration';
|
|
2
|
-
import { max, min } from '@jbrowse/core/util';
|
|
3
|
-
import { fillRectCtx, strokeRectCtx } from './util';
|
|
4
|
-
import { fillColor, strokeColor } from '../shared/color';
|
|
5
|
-
export function drawLongReadChains({ ctx, self, chainData, view, asm, }) {
|
|
6
|
-
var _a, _b, _c, _d, _e;
|
|
7
|
-
const computedChains = [];
|
|
8
|
-
const { chains } = chainData;
|
|
9
|
-
const { height } = self;
|
|
10
|
-
const featureHeight = getConf(self, 'featureHeight');
|
|
11
|
-
for (const chain of chains) {
|
|
12
|
-
let minX = Number.MAX_VALUE;
|
|
13
|
-
let maxX = Number.MIN_VALUE;
|
|
14
|
-
for (const elt of chain) {
|
|
15
|
-
const refName = asm.getCanonicalRefName(elt.refName) || elt.refName;
|
|
16
|
-
const rs = (_a = view.bpToPx({ refName, coord: elt.start })) === null || _a === void 0 ? void 0 : _a.offsetPx;
|
|
17
|
-
const re = (_b = view.bpToPx({ refName, coord: elt.end })) === null || _b === void 0 ? void 0 : _b.offsetPx;
|
|
18
|
-
if (rs !== undefined && re !== undefined) {
|
|
19
|
-
minX = Math.min(minX, rs);
|
|
20
|
-
maxX = Math.max(maxX, re);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
computedChains.push({
|
|
24
|
-
distance: Math.abs(maxX - minX),
|
|
25
|
-
minX,
|
|
26
|
-
chain,
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
const distances = computedChains.map(d => d.distance);
|
|
30
|
-
const maxD = Math.log(max(distances));
|
|
31
|
-
const minD = Math.max(Math.log(min(distances)) - 1, 0);
|
|
32
|
-
const scaler = (height - 20) / (maxD - minD);
|
|
33
|
-
const halfHeight = featureHeight / 2 - 0.5;
|
|
34
|
-
for (const { minX, distance, chain } of computedChains) {
|
|
35
|
-
const w = distance;
|
|
36
|
-
const top = (Math.log(w) - minD) * scaler;
|
|
37
|
-
fillRectCtx(minX - view.offsetPx, top + halfHeight, w, 1, ctx, 'black');
|
|
38
|
-
const c1 = chain[0];
|
|
39
|
-
let primaryStrand;
|
|
40
|
-
if (!(c1.flags & 2048)) {
|
|
41
|
-
primaryStrand = c1.strand;
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
const res = (_c = c1.SA) === null || _c === void 0 ? void 0 : _c.split(';')[0].split(',')[2];
|
|
45
|
-
primaryStrand = res === '-' ? -1 : 1;
|
|
46
|
-
}
|
|
47
|
-
for (const v0 of chain) {
|
|
48
|
-
const ra = asm.getCanonicalRefName(v0.refName) || v0.refName;
|
|
49
|
-
const rs = (_d = view.bpToPx({ refName: ra, coord: v0.start })) === null || _d === void 0 ? void 0 : _d.offsetPx;
|
|
50
|
-
const re = (_e = view.bpToPx({ refName: ra, coord: v0.end })) === null || _e === void 0 ? void 0 : _e.offsetPx;
|
|
51
|
-
if (rs !== undefined && re !== undefined) {
|
|
52
|
-
const w = Math.max(re - rs, 2);
|
|
53
|
-
const l = rs - view.offsetPx;
|
|
54
|
-
const effectiveStrand = v0.strand * primaryStrand;
|
|
55
|
-
const c = effectiveStrand === -1 ? 'color_rev_strand' : 'color_fwd_strand';
|
|
56
|
-
strokeRectCtx(l, top, w, featureHeight, ctx, strokeColor[c]);
|
|
57
|
-
fillRectCtx(l, top, w, featureHeight, ctx, fillColor[c]);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { LinearReadCloudDisplayModel } from './model';
|
|
2
|
-
import type { ChainData, ChainStats, ReducedFeature } from '../shared/fetchChains';
|
|
3
|
-
import type { Assembly } from '@jbrowse/core/assemblyManager/assembly';
|
|
4
|
-
import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view';
|
|
5
|
-
export declare function drawPairChains({ ctx, self, chainData, view, asm, }: {
|
|
6
|
-
ctx: CanvasRenderingContext2D;
|
|
7
|
-
self: LinearReadCloudDisplayModel;
|
|
8
|
-
chainData: ChainData;
|
|
9
|
-
view: LinearGenomeViewModel;
|
|
10
|
-
asm: Assembly;
|
|
11
|
-
}): void;
|
|
12
|
-
export declare function getPairedColor({ type, v0, v1, stats, }: {
|
|
13
|
-
type: string;
|
|
14
|
-
v0: ReducedFeature;
|
|
15
|
-
v1: ReducedFeature;
|
|
16
|
-
stats?: ChainStats;
|
|
17
|
-
}): readonly [string, string] | undefined;
|