@jbrowse/plugin-alignments 2.2.2 → 2.3.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.js +1 -1
- package/dist/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js.map +1 -1
- package/dist/AlignmentsTrack/index.js +1 -0
- package/dist/AlignmentsTrack/index.js.map +1 -1
- package/dist/BamAdapter/BamSlightlyLazyFeature.d.ts +3 -4
- package/dist/BamAdapter/BamSlightlyLazyFeature.js +11 -18
- package/dist/BamAdapter/BamSlightlyLazyFeature.js.map +1 -1
- package/dist/BamAdapter/index.js +1 -0
- package/dist/BamAdapter/index.js.map +1 -1
- package/dist/CramAdapter/CramSlightlyLazyFeature.d.ts +5 -7
- package/dist/CramAdapter/CramSlightlyLazyFeature.js +6 -8
- package/dist/CramAdapter/CramSlightlyLazyFeature.js.map +1 -1
- package/dist/CramAdapter/index.js +1 -0
- package/dist/CramAdapter/index.js.map +1 -1
- package/dist/GuessAlignmentsTypes/index.d.ts +3 -0
- package/dist/GuessAlignmentsTypes/index.js +56 -0
- package/dist/GuessAlignmentsTypes/index.js.map +1 -0
- package/dist/HtsgetBamAdapter/index.js +11 -11
- package/dist/HtsgetBamAdapter/index.js.map +1 -1
- package/dist/LinearAlignmentsDisplay/components/AlignmentsDisplay.js +10 -13
- package/dist/LinearAlignmentsDisplay/components/AlignmentsDisplay.js.map +1 -1
- package/dist/LinearAlignmentsDisplay/index.js +1 -0
- package/dist/LinearAlignmentsDisplay/index.js.map +1 -1
- package/dist/LinearAlignmentsDisplay/models/configSchema.d.ts +6 -3
- package/dist/LinearAlignmentsDisplay/models/configSchema.js +2 -3
- package/dist/LinearAlignmentsDisplay/models/configSchema.js.map +1 -1
- package/dist/LinearAlignmentsDisplay/models/model.d.ts +22 -36
- package/dist/LinearAlignmentsDisplay/models/model.js +166 -151
- package/dist/LinearAlignmentsDisplay/models/model.js.map +1 -1
- package/dist/LinearPileupDisplay/components/SetFeatureHeight.d.ts +2 -2
- package/dist/LinearPileupDisplay/components/SetFeatureHeight.js +2 -4
- package/dist/LinearPileupDisplay/components/SetFeatureHeight.js.map +1 -1
- package/dist/LinearPileupDisplay/configSchema.d.ts +0 -3
- package/dist/LinearPileupDisplay/configSchema.js.map +1 -1
- package/dist/LinearPileupDisplay/index.js +2 -0
- package/dist/LinearPileupDisplay/index.js.map +1 -1
- package/dist/LinearPileupDisplay/model.d.ts +19 -16
- package/dist/LinearPileupDisplay/model.js +28 -13
- package/dist/LinearPileupDisplay/model.js.map +1 -1
- package/dist/LinearReadArcsDisplay/components/ReactComponent.d.ts +6 -0
- package/dist/LinearReadArcsDisplay/components/ReactComponent.js +49 -0
- package/dist/LinearReadArcsDisplay/components/ReactComponent.js.map +1 -0
- package/dist/LinearReadArcsDisplay/configSchema.d.ts +6 -0
- package/dist/LinearReadArcsDisplay/configSchema.js +52 -0
- package/dist/LinearReadArcsDisplay/configSchema.js.map +1 -0
- package/dist/LinearReadArcsDisplay/drawFeats.d.ts +14 -0
- package/dist/LinearReadArcsDisplay/drawFeats.js +162 -0
- package/dist/LinearReadArcsDisplay/drawFeats.js.map +1 -0
- package/dist/LinearReadArcsDisplay/index.d.ts +2 -0
- package/dist/LinearReadArcsDisplay/index.js +27 -0
- package/dist/LinearReadArcsDisplay/index.js.map +1 -0
- package/dist/LinearReadArcsDisplay/model.d.ts +342 -0
- package/dist/LinearReadArcsDisplay/model.js +327 -0
- package/dist/LinearReadArcsDisplay/model.js.map +1 -0
- package/dist/LinearReadCloudDisplay/components/ReactComponent.d.ts +6 -0
- package/dist/LinearReadCloudDisplay/components/ReactComponent.js +49 -0
- package/dist/LinearReadCloudDisplay/components/ReactComponent.js.map +1 -0
- package/dist/LinearReadCloudDisplay/configSchema.d.ts +6 -0
- package/dist/LinearReadCloudDisplay/configSchema.js +51 -0
- package/dist/LinearReadCloudDisplay/configSchema.js.map +1 -0
- package/dist/LinearReadCloudDisplay/drawFeats.d.ts +10 -0
- package/dist/LinearReadCloudDisplay/drawFeats.js +159 -0
- package/dist/LinearReadCloudDisplay/drawFeats.js.map +1 -0
- package/dist/LinearReadCloudDisplay/index.d.ts +2 -0
- package/dist/LinearReadCloudDisplay/index.js +27 -0
- package/dist/LinearReadCloudDisplay/index.js.map +1 -0
- package/dist/LinearReadCloudDisplay/model.d.ts +320 -0
- package/dist/LinearReadCloudDisplay/model.js +252 -0
- package/dist/LinearReadCloudDisplay/model.js.map +1 -0
- package/dist/LinearSNPCoverageDisplay/index.js +1 -0
- package/dist/LinearSNPCoverageDisplay/index.js.map +1 -1
- package/dist/LinearSNPCoverageDisplay/models/model.d.ts +19 -20
- package/dist/LinearSNPCoverageDisplay/models/model.js +1 -6
- package/dist/LinearSNPCoverageDisplay/models/model.js.map +1 -1
- package/dist/{BamAdapter/MismatchParser.d.ts → MismatchParser/index.d.ts} +23 -0
- package/dist/{BamAdapter/MismatchParser.js → MismatchParser/index.js} +116 -3
- package/dist/MismatchParser/index.js.map +1 -0
- package/dist/PileupRPC/base.d.ts +8 -0
- package/dist/PileupRPC/base.js +22 -0
- package/dist/PileupRPC/base.js.map +1 -0
- package/dist/PileupRPC/index.d.ts +3 -0
- package/dist/PileupRPC/index.js +9 -0
- package/dist/PileupRPC/index.js.map +1 -0
- package/dist/PileupRPC/methods/GetGlobalValueForTag.d.ts +14 -0
- package/dist/PileupRPC/methods/GetGlobalValueForTag.js +29 -0
- package/dist/PileupRPC/methods/GetGlobalValueForTag.js.map +1 -0
- package/dist/PileupRPC/methods/GetReducedFeatures.d.ts +25 -0
- package/dist/PileupRPC/methods/GetReducedFeatures.js +61 -0
- package/dist/PileupRPC/methods/GetReducedFeatures.js.map +1 -0
- package/dist/PileupRPC/methods/GetVisibleModifications.d.ts +14 -0
- package/dist/PileupRPC/methods/GetVisibleModifications.js +32 -0
- package/dist/PileupRPC/methods/GetVisibleModifications.js.map +1 -0
- package/dist/PileupRPC/rpcMethods.d.ts +4 -34
- package/dist/PileupRPC/rpcMethods.js +7 -77
- package/dist/PileupRPC/rpcMethods.js.map +1 -1
- package/dist/PileupRPC/util.d.ts +8 -0
- package/dist/PileupRPC/util.js +20 -0
- package/dist/PileupRPC/util.js.map +1 -0
- package/dist/PileupRenderer/PileupRenderer.d.ts +1 -1
- package/dist/PileupRenderer/PileupRenderer.js +5 -5
- package/dist/PileupRenderer/PileupRenderer.js.map +1 -1
- package/dist/PileupRenderer/index.js +1 -0
- package/dist/PileupRenderer/index.js.map +1 -1
- package/dist/PileupRenderer/sortUtil.d.ts +1 -1
- package/dist/PileupRenderer/sortUtil.js +2 -2
- package/dist/PileupRenderer/sortUtil.js.map +1 -1
- package/dist/SNPCoverageAdapter/generateCoverageBins.js +1 -1
- package/dist/SNPCoverageAdapter/generateCoverageBins.js.map +1 -1
- package/dist/SNPCoverageAdapter/index.js +1 -3
- package/dist/SNPCoverageAdapter/index.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +12 -58
- package/dist/index.js.map +1 -1
- package/dist/{LinearPileupDisplay/components → shared}/FilterByTag.d.ts +0 -0
- package/dist/{LinearPileupDisplay/components → shared}/FilterByTag.js +3 -9
- package/dist/shared/FilterByTag.js.map +1 -0
- package/dist/shared/color.d.ts +17 -0
- package/dist/shared/color.js +43 -0
- package/dist/shared/color.js.map +1 -0
- package/dist/shared/fetchChains.d.ts +27 -0
- package/dist/shared/fetchChains.js +30 -0
- package/dist/shared/fetchChains.js.map +1 -0
- package/dist/shared/index.d.ts +36 -0
- package/dist/{shared.js → shared/index.js} +12 -2
- package/dist/shared/index.js.map +1 -0
- package/esm/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js +1 -1
- package/esm/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js.map +1 -1
- package/esm/AlignmentsTrack/index.js +1 -0
- package/esm/AlignmentsTrack/index.js.map +1 -1
- package/esm/BamAdapter/BamSlightlyLazyFeature.d.ts +3 -4
- package/esm/BamAdapter/BamSlightlyLazyFeature.js +11 -18
- package/esm/BamAdapter/BamSlightlyLazyFeature.js.map +1 -1
- package/esm/BamAdapter/index.js +1 -0
- package/esm/BamAdapter/index.js.map +1 -1
- package/esm/CramAdapter/CramSlightlyLazyFeature.d.ts +5 -7
- package/esm/CramAdapter/CramSlightlyLazyFeature.js +6 -8
- package/esm/CramAdapter/CramSlightlyLazyFeature.js.map +1 -1
- package/esm/CramAdapter/index.js +1 -0
- package/esm/CramAdapter/index.js.map +1 -1
- package/esm/GuessAlignmentsTypes/index.d.ts +3 -0
- package/esm/GuessAlignmentsTypes/index.js +54 -0
- package/esm/GuessAlignmentsTypes/index.js.map +1 -0
- package/esm/HtsgetBamAdapter/index.js +11 -11
- package/esm/HtsgetBamAdapter/index.js.map +1 -1
- package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.js +10 -13
- package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.js.map +1 -1
- package/esm/LinearAlignmentsDisplay/index.js +1 -0
- package/esm/LinearAlignmentsDisplay/index.js.map +1 -1
- package/esm/LinearAlignmentsDisplay/models/configSchema.d.ts +6 -3
- package/esm/LinearAlignmentsDisplay/models/configSchema.js +2 -4
- package/esm/LinearAlignmentsDisplay/models/configSchema.js.map +1 -1
- package/esm/LinearAlignmentsDisplay/models/model.d.ts +22 -36
- package/esm/LinearAlignmentsDisplay/models/model.js +167 -152
- package/esm/LinearAlignmentsDisplay/models/model.js.map +1 -1
- package/esm/LinearPileupDisplay/components/SetFeatureHeight.d.ts +2 -2
- package/esm/LinearPileupDisplay/components/SetFeatureHeight.js +2 -4
- package/esm/LinearPileupDisplay/components/SetFeatureHeight.js.map +1 -1
- package/esm/LinearPileupDisplay/configSchema.d.ts +0 -3
- package/esm/LinearPileupDisplay/configSchema.js.map +1 -1
- package/esm/LinearPileupDisplay/index.js +2 -0
- package/esm/LinearPileupDisplay/index.js.map +1 -1
- package/esm/LinearPileupDisplay/model.d.ts +19 -16
- package/esm/LinearPileupDisplay/model.js +29 -14
- package/esm/LinearPileupDisplay/model.js.map +1 -1
- package/esm/LinearReadArcsDisplay/components/ReactComponent.d.ts +6 -0
- package/esm/LinearReadArcsDisplay/components/ReactComponent.js +44 -0
- package/esm/LinearReadArcsDisplay/components/ReactComponent.js.map +1 -0
- package/esm/LinearReadArcsDisplay/configSchema.d.ts +6 -0
- package/esm/LinearReadArcsDisplay/configSchema.js +50 -0
- package/esm/LinearReadArcsDisplay/configSchema.js.map +1 -0
- package/esm/LinearReadArcsDisplay/drawFeats.d.ts +14 -0
- package/esm/LinearReadArcsDisplay/drawFeats.js +157 -0
- package/esm/LinearReadArcsDisplay/drawFeats.js.map +1 -0
- package/esm/LinearReadArcsDisplay/index.d.ts +2 -0
- package/esm/LinearReadArcsDisplay/index.js +21 -0
- package/esm/LinearReadArcsDisplay/index.js.map +1 -0
- package/esm/LinearReadArcsDisplay/model.d.ts +342 -0
- package/esm/LinearReadArcsDisplay/model.js +299 -0
- package/esm/LinearReadArcsDisplay/model.js.map +1 -0
- package/esm/LinearReadCloudDisplay/components/ReactComponent.d.ts +6 -0
- package/esm/LinearReadCloudDisplay/components/ReactComponent.js +44 -0
- package/esm/LinearReadCloudDisplay/components/ReactComponent.js.map +1 -0
- package/esm/LinearReadCloudDisplay/configSchema.d.ts +6 -0
- package/esm/LinearReadCloudDisplay/configSchema.js +49 -0
- package/esm/LinearReadCloudDisplay/configSchema.js.map +1 -0
- package/esm/LinearReadCloudDisplay/drawFeats.d.ts +10 -0
- package/esm/LinearReadCloudDisplay/drawFeats.js +156 -0
- package/esm/LinearReadCloudDisplay/drawFeats.js.map +1 -0
- package/esm/LinearReadCloudDisplay/index.d.ts +2 -0
- package/esm/LinearReadCloudDisplay/index.js +21 -0
- package/esm/LinearReadCloudDisplay/index.js.map +1 -0
- package/esm/LinearReadCloudDisplay/model.d.ts +320 -0
- package/esm/LinearReadCloudDisplay/model.js +224 -0
- package/esm/LinearReadCloudDisplay/model.js.map +1 -0
- package/esm/LinearSNPCoverageDisplay/index.js +1 -0
- package/esm/LinearSNPCoverageDisplay/index.js.map +1 -1
- package/esm/LinearSNPCoverageDisplay/models/model.d.ts +19 -20
- package/esm/LinearSNPCoverageDisplay/models/model.js +2 -7
- package/esm/LinearSNPCoverageDisplay/models/model.js.map +1 -1
- package/esm/{BamAdapter/MismatchParser.d.ts → MismatchParser/index.d.ts} +23 -0
- package/esm/{BamAdapter/MismatchParser.js → MismatchParser/index.js} +107 -2
- package/esm/MismatchParser/index.js.map +1 -0
- package/esm/PileupRPC/base.d.ts +8 -0
- package/esm/PileupRPC/base.js +16 -0
- package/esm/PileupRPC/base.js.map +1 -0
- package/esm/PileupRPC/index.d.ts +3 -0
- package/esm/PileupRPC/index.js +7 -0
- package/esm/PileupRPC/index.js.map +1 -0
- package/esm/PileupRPC/methods/GetGlobalValueForTag.d.ts +14 -0
- package/esm/PileupRPC/methods/GetGlobalValueForTag.js +23 -0
- package/esm/PileupRPC/methods/GetGlobalValueForTag.js.map +1 -0
- package/esm/PileupRPC/methods/GetReducedFeatures.d.ts +25 -0
- package/esm/PileupRPC/methods/GetReducedFeatures.js +55 -0
- package/esm/PileupRPC/methods/GetReducedFeatures.js.map +1 -0
- package/esm/PileupRPC/methods/GetVisibleModifications.d.ts +14 -0
- package/esm/PileupRPC/methods/GetVisibleModifications.js +26 -0
- package/esm/PileupRPC/methods/GetVisibleModifications.js.map +1 -0
- package/esm/PileupRPC/rpcMethods.d.ts +4 -34
- package/esm/PileupRPC/rpcMethods.js +4 -74
- package/esm/PileupRPC/rpcMethods.js.map +1 -1
- package/esm/PileupRPC/util.d.ts +8 -0
- package/esm/PileupRPC/util.js +15 -0
- package/esm/PileupRPC/util.js.map +1 -0
- package/esm/PileupRenderer/PileupRenderer.d.ts +1 -1
- package/esm/PileupRenderer/PileupRenderer.js +5 -5
- package/esm/PileupRenderer/PileupRenderer.js.map +1 -1
- package/esm/PileupRenderer/index.js +1 -0
- package/esm/PileupRenderer/index.js.map +1 -1
- package/esm/PileupRenderer/sortUtil.d.ts +1 -1
- package/esm/PileupRenderer/sortUtil.js +1 -1
- package/esm/PileupRenderer/sortUtil.js.map +1 -1
- package/esm/SNPCoverageAdapter/generateCoverageBins.js +1 -1
- package/esm/SNPCoverageAdapter/generateCoverageBins.js.map +1 -1
- package/esm/SNPCoverageAdapter/index.js +1 -3
- package/esm/SNPCoverageAdapter/index.js.map +1 -1
- package/esm/index.d.ts +2 -2
- package/esm/index.js +10 -56
- package/esm/index.js.map +1 -1
- package/esm/{LinearPileupDisplay/components → shared}/FilterByTag.d.ts +0 -0
- package/esm/{LinearPileupDisplay/components → shared}/FilterByTag.js +3 -9
- package/esm/shared/FilterByTag.js.map +1 -0
- package/esm/shared/color.d.ts +17 -0
- package/esm/shared/color.js +37 -0
- package/esm/shared/color.js.map +1 -0
- package/esm/shared/fetchChains.d.ts +27 -0
- package/esm/shared/fetchChains.js +26 -0
- package/esm/shared/fetchChains.js.map +1 -0
- package/esm/shared/index.d.ts +36 -0
- package/esm/{shared.js → shared/index.js} +11 -1
- package/esm/shared/index.js.map +1 -0
- package/package.json +4 -4
- package/src/AlignmentsFeatureDetail/AlignmentsFeatureDetail.tsx +1 -1
- package/src/AlignmentsTrack/index.ts +1 -0
- package/src/BamAdapter/BamSlightlyLazyFeature.ts +13 -19
- package/src/BamAdapter/index.ts +1 -0
- package/src/CramAdapter/CramSlightlyLazyFeature.ts +13 -15
- package/src/CramAdapter/__snapshots__/CramAdapter.test.ts.snap +0 -10
- package/src/CramAdapter/index.ts +1 -0
- package/src/GuessAlignmentsTypes/index.ts +79 -0
- package/src/HtsgetBamAdapter/index.ts +11 -15
- package/src/LinearAlignmentsDisplay/components/AlignmentsDisplay.tsx +21 -29
- package/src/LinearAlignmentsDisplay/index.ts +1 -0
- package/src/LinearAlignmentsDisplay/models/configSchema.ts +2 -6
- package/src/LinearAlignmentsDisplay/models/model.tsx +238 -199
- package/src/LinearPileupDisplay/components/SetFeatureHeight.tsx +4 -6
- package/src/LinearPileupDisplay/configSchema.ts +1 -3
- package/src/LinearPileupDisplay/index.ts +2 -0
- package/src/LinearPileupDisplay/model.ts +36 -23
- package/src/LinearReadArcsDisplay/components/ReactComponent.tsx +86 -0
- package/src/LinearReadArcsDisplay/configSchema.ts +58 -0
- package/src/LinearReadArcsDisplay/declare.d.ts +1 -0
- package/src/LinearReadArcsDisplay/drawFeats.ts +199 -0
- package/src/LinearReadArcsDisplay/index.ts +23 -0
- package/src/LinearReadArcsDisplay/model.tsx +370 -0
- package/src/LinearReadCloudDisplay/components/ReactComponent.tsx +86 -0
- package/src/LinearReadCloudDisplay/configSchema.ts +57 -0
- package/src/LinearReadCloudDisplay/drawFeats.ts +201 -0
- package/src/LinearReadCloudDisplay/index.ts +23 -0
- package/src/LinearReadCloudDisplay/model.tsx +289 -0
- package/src/LinearSNPCoverageDisplay/index.ts +1 -0
- package/src/LinearSNPCoverageDisplay/models/model.ts +3 -13
- package/src/{BamAdapter/MismatchParser.test.ts → MismatchParser/index.test.ts} +1 -1
- package/src/{BamAdapter/MismatchParser.ts → MismatchParser/index.ts} +129 -2
- package/src/PileupRPC/base.ts +24 -0
- package/src/PileupRPC/index.ts +12 -0
- package/src/PileupRPC/methods/GetGlobalValueForTag.ts +41 -0
- package/src/PileupRPC/methods/GetReducedFeatures.ts +76 -0
- package/src/PileupRPC/methods/GetVisibleModifications.ts +45 -0
- package/src/PileupRPC/rpcMethods.ts +8 -113
- package/src/PileupRPC/util.ts +19 -0
- package/src/PileupRenderer/PileupRenderer.ts +5 -8
- package/src/PileupRenderer/index.ts +1 -0
- package/src/PileupRenderer/sortUtil.ts +2 -3
- package/src/SNPCoverageAdapter/generateCoverageBins.ts +1 -1
- package/src/SNPCoverageAdapter/index.ts +1 -3
- package/src/index.ts +12 -93
- package/src/{LinearPileupDisplay/components → shared}/FilterByTag.tsx +3 -9
- package/src/shared/color.ts +47 -0
- package/src/shared/fetchChains.ts +63 -0
- package/src/{shared.ts → shared/index.ts} +17 -4
- package/dist/BamAdapter/MismatchParser.js.map +0 -1
- package/dist/LinearPileupDisplay/components/FilterByTag.js.map +0 -1
- package/dist/shared.d.ts +0 -25
- package/dist/shared.js.map +0 -1
- package/esm/BamAdapter/MismatchParser.js.map +0 -1
- package/esm/LinearPileupDisplay/components/FilterByTag.js.map +0 -1
- package/esm/shared.d.ts +0 -25
- package/esm/shared.js.map +0 -1
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { isAlive } from 'mobx-state-tree'
|
|
3
|
+
import { makeStyles } from 'tss-react/mui'
|
|
4
|
+
import { observer } from 'mobx-react'
|
|
5
|
+
import { getContainingView } from '@jbrowse/core/util'
|
|
6
|
+
import { LoadingEllipses } from '@jbrowse/core/ui'
|
|
7
|
+
import {
|
|
8
|
+
BlockMsg,
|
|
9
|
+
LinearGenomeViewModel,
|
|
10
|
+
} from '@jbrowse/plugin-linear-genome-view'
|
|
11
|
+
|
|
12
|
+
// local
|
|
13
|
+
import { LinearReadArcsDisplayModel } from '../model'
|
|
14
|
+
|
|
15
|
+
type LGV = LinearGenomeViewModel
|
|
16
|
+
|
|
17
|
+
const useStyles = makeStyles()(theme => ({
|
|
18
|
+
loading: {
|
|
19
|
+
paddingLeft: '0.6em',
|
|
20
|
+
backgroundColor: theme.palette.action.disabledBackground,
|
|
21
|
+
backgroundImage:
|
|
22
|
+
'repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(255,255,255,.5) 5px, rgba(255,255,255,.5) 10px)',
|
|
23
|
+
height: '100%',
|
|
24
|
+
width: '100%',
|
|
25
|
+
pointerEvents: 'none',
|
|
26
|
+
textAlign: 'center',
|
|
27
|
+
},
|
|
28
|
+
}))
|
|
29
|
+
|
|
30
|
+
const Arcs = observer(function ({
|
|
31
|
+
model,
|
|
32
|
+
}: {
|
|
33
|
+
model: LinearReadArcsDisplayModel
|
|
34
|
+
}) {
|
|
35
|
+
const view = getContainingView(model) as LGV
|
|
36
|
+
return (
|
|
37
|
+
<canvas
|
|
38
|
+
data-testid={`Arc-display-${model.drawn}`}
|
|
39
|
+
ref={ref => {
|
|
40
|
+
if (isAlive(model)) {
|
|
41
|
+
model.setRef(ref)
|
|
42
|
+
}
|
|
43
|
+
}}
|
|
44
|
+
style={{
|
|
45
|
+
position: 'absolute',
|
|
46
|
+
left: -view.offsetPx + model.lastDrawnOffsetPx,
|
|
47
|
+
width: view.dynamicBlocks.totalWidthPx,
|
|
48
|
+
height: model.height,
|
|
49
|
+
}}
|
|
50
|
+
width={view.dynamicBlocks.totalWidthPx * 2}
|
|
51
|
+
height={model.height * 2}
|
|
52
|
+
/>
|
|
53
|
+
)
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
export default observer(function ({
|
|
57
|
+
model,
|
|
58
|
+
}: {
|
|
59
|
+
model: LinearReadArcsDisplayModel
|
|
60
|
+
}) {
|
|
61
|
+
const view = getContainingView(model)
|
|
62
|
+
const { classes } = useStyles()
|
|
63
|
+
const err = model.error
|
|
64
|
+
return err ? (
|
|
65
|
+
<BlockMsg
|
|
66
|
+
message={`${err}`}
|
|
67
|
+
severity="error"
|
|
68
|
+
buttonText={'Reload'}
|
|
69
|
+
action={model.reload}
|
|
70
|
+
/>
|
|
71
|
+
) : model.loading ? (
|
|
72
|
+
<div
|
|
73
|
+
className={classes.loading}
|
|
74
|
+
style={{
|
|
75
|
+
width: view.dynamicBlocks.totalWidthPx,
|
|
76
|
+
height: 20,
|
|
77
|
+
position: 'absolute',
|
|
78
|
+
left: Math.max(0, -view.offsetPx),
|
|
79
|
+
}}
|
|
80
|
+
>
|
|
81
|
+
<LoadingEllipses message={model.message} />
|
|
82
|
+
</div>
|
|
83
|
+
) : (
|
|
84
|
+
<Arcs model={model} />
|
|
85
|
+
)
|
|
86
|
+
})
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import PluginManager from '@jbrowse/core/PluginManager'
|
|
2
|
+
import { ConfigurationSchema } from '@jbrowse/core/configuration'
|
|
3
|
+
import { linearBasicDisplayConfigSchemaFactory } from '@jbrowse/plugin-linear-genome-view'
|
|
4
|
+
import { types } from 'mobx-state-tree'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* #config LinearReadArcsDisplay
|
|
8
|
+
*/
|
|
9
|
+
function configSchemaF(pluginManager: PluginManager) {
|
|
10
|
+
return ConfigurationSchema(
|
|
11
|
+
'LinearReadArcsDisplay',
|
|
12
|
+
{
|
|
13
|
+
/**
|
|
14
|
+
* #slot
|
|
15
|
+
*/
|
|
16
|
+
maxFeatureScreenDensity: {
|
|
17
|
+
type: 'number',
|
|
18
|
+
description: 'maximum features per pixel that is displayed in the view',
|
|
19
|
+
defaultValue: 5,
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* #slot
|
|
24
|
+
*/
|
|
25
|
+
lineWidth: {
|
|
26
|
+
type: 'number',
|
|
27
|
+
description: 'set arc line width',
|
|
28
|
+
defaultValue: 1,
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* #slot
|
|
33
|
+
*/
|
|
34
|
+
colorScheme: {
|
|
35
|
+
type: 'stringEnum',
|
|
36
|
+
model: types.enumeration('colorScheme', [
|
|
37
|
+
'strand',
|
|
38
|
+
'normal',
|
|
39
|
+
'insertSize',
|
|
40
|
+
'insertSizeAndOrientation',
|
|
41
|
+
'mappingQuality',
|
|
42
|
+
'tag',
|
|
43
|
+
]),
|
|
44
|
+
description: 'color scheme to use',
|
|
45
|
+
defaultValue: 'normal',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
/**
|
|
50
|
+
* #baseConfiguration
|
|
51
|
+
*/
|
|
52
|
+
baseConfiguration: linearBasicDisplayConfigSchemaFactory(pluginManager),
|
|
53
|
+
explicitlyTyped: true,
|
|
54
|
+
},
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export default configSchemaF
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module 'canvas2svg'
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { getContainingView, getSession } from '@jbrowse/core/util'
|
|
2
|
+
import { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
|
|
3
|
+
|
|
4
|
+
// locals
|
|
5
|
+
import {
|
|
6
|
+
getOrientationColor,
|
|
7
|
+
getInsertSizeColor,
|
|
8
|
+
getInsertSizeAndOrientationColor,
|
|
9
|
+
} from '../shared/color'
|
|
10
|
+
import { ChainData } from '../shared/fetchChains'
|
|
11
|
+
import { featurizeSA } from '../MismatchParser'
|
|
12
|
+
|
|
13
|
+
export function hasPairedReads(features: ChainData) {
|
|
14
|
+
for (const f of features.chains.values()) {
|
|
15
|
+
if (f[0].flags & 1) {
|
|
16
|
+
return true
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return false
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
type LGV = LinearGenomeViewModel
|
|
23
|
+
|
|
24
|
+
export default async function drawFeats(
|
|
25
|
+
self: {
|
|
26
|
+
setLastDrawnOffsetPx: (n: number) => void
|
|
27
|
+
drawInter?: boolean
|
|
28
|
+
drawLongRange?: boolean
|
|
29
|
+
setError: (e: unknown) => void
|
|
30
|
+
colorBy?: { type: string }
|
|
31
|
+
height: number
|
|
32
|
+
chainData?: ChainData
|
|
33
|
+
lineWidthSetting: number
|
|
34
|
+
},
|
|
35
|
+
ctx: CanvasRenderingContext2D,
|
|
36
|
+
) {
|
|
37
|
+
const { chainData } = self
|
|
38
|
+
if (!chainData) {
|
|
39
|
+
return
|
|
40
|
+
}
|
|
41
|
+
const displayHeight = self.height
|
|
42
|
+
const view = getContainingView(self) as LGV
|
|
43
|
+
const { assemblyManager } = getSession(self)
|
|
44
|
+
self.setLastDrawnOffsetPx(view.offsetPx)
|
|
45
|
+
ctx.lineWidth = self.lineWidthSetting
|
|
46
|
+
const { chains, stats } = chainData
|
|
47
|
+
const hasPaired = hasPairedReads(chainData)
|
|
48
|
+
const assemblyName = view.assemblyNames[0]
|
|
49
|
+
const asm = assemblyManager.get(assemblyName)
|
|
50
|
+
const type = self.colorBy?.type || 'insertSizeAndOrientation'
|
|
51
|
+
|
|
52
|
+
function draw(
|
|
53
|
+
k1: {
|
|
54
|
+
strand: number
|
|
55
|
+
refName: string
|
|
56
|
+
start: number
|
|
57
|
+
end: number
|
|
58
|
+
tlen?: number
|
|
59
|
+
pair_orientation?: string
|
|
60
|
+
},
|
|
61
|
+
k2: { strand: number; refName: string; start: number; end: number },
|
|
62
|
+
longRange?: boolean,
|
|
63
|
+
) {
|
|
64
|
+
const s1 = k1.strand
|
|
65
|
+
const s2 = k2.strand
|
|
66
|
+
const f1 = s1 === -1
|
|
67
|
+
const f2 = s2 === -1
|
|
68
|
+
|
|
69
|
+
const p1 = f1 ? k1.start : k1.end
|
|
70
|
+
const p2 = hasPaired ? (f2 ? k2.start : k2.end) : f2 ? k2.end : k2.start
|
|
71
|
+
|
|
72
|
+
const r1 = view.bpToPx({ refName: k1.refName, coord: p1 })
|
|
73
|
+
const r2 = view.bpToPx({ refName: k2.refName, coord: p2 })
|
|
74
|
+
|
|
75
|
+
if (r1 && r2) {
|
|
76
|
+
const radius = (r2.offsetPx - r1.offsetPx) / 2
|
|
77
|
+
const absrad = Math.abs(radius)
|
|
78
|
+
const p = r1.offsetPx - view.offsetPx
|
|
79
|
+
|
|
80
|
+
// bezier (used for non-long-range arcs) requires moveTo before beginPath
|
|
81
|
+
// arc (used for long-range) requires moveTo after beginPath (or else a
|
|
82
|
+
// unwanted line at y=0 is rendered along with the arc)
|
|
83
|
+
if (longRange) {
|
|
84
|
+
ctx.moveTo(p, 0)
|
|
85
|
+
ctx.beginPath()
|
|
86
|
+
} else {
|
|
87
|
+
ctx.beginPath()
|
|
88
|
+
ctx.moveTo(p, 0)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (longRange) {
|
|
92
|
+
ctx.strokeStyle = 'red'
|
|
93
|
+
} else {
|
|
94
|
+
if (hasPaired) {
|
|
95
|
+
if (type === 'insertSizeAndOrientation') {
|
|
96
|
+
ctx.strokeStyle = getInsertSizeAndOrientationColor(k1, k2, stats)
|
|
97
|
+
} else if (type === 'orientation') {
|
|
98
|
+
ctx.strokeStyle = getOrientationColor(k1)
|
|
99
|
+
} else if (type === 'insertSize') {
|
|
100
|
+
ctx.strokeStyle = getInsertSizeColor(k1, k2, stats) || 'grey'
|
|
101
|
+
} else if (type === 'gradient') {
|
|
102
|
+
ctx.strokeStyle = `hsl(${
|
|
103
|
+
Math.log10(Math.abs(p1 - p2)) * 10
|
|
104
|
+
},50%,50%)`
|
|
105
|
+
}
|
|
106
|
+
} else {
|
|
107
|
+
if (type === 'orientation' || type === 'insertSizeAndOrientation') {
|
|
108
|
+
if (s1 === -1 && s2 === 1) {
|
|
109
|
+
ctx.strokeStyle = 'navy'
|
|
110
|
+
} else if (s1 === 1 && s2 === -1) {
|
|
111
|
+
ctx.strokeStyle = 'green'
|
|
112
|
+
} else {
|
|
113
|
+
ctx.strokeStyle = 'grey'
|
|
114
|
+
}
|
|
115
|
+
} else if (type === 'gradient') {
|
|
116
|
+
ctx.strokeStyle = `hsl(${
|
|
117
|
+
Math.log10(Math.abs(p1 - p2)) * 10
|
|
118
|
+
},50%,50%)`
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const destX = p + radius * 2
|
|
124
|
+
const destY = Math.min(displayHeight, absrad)
|
|
125
|
+
if (longRange) {
|
|
126
|
+
ctx.arc(p + radius, 0, absrad, 0, Math.PI)
|
|
127
|
+
} else {
|
|
128
|
+
ctx.bezierCurveTo(p, destY, destX, destY, destX, 0)
|
|
129
|
+
}
|
|
130
|
+
ctx.stroke()
|
|
131
|
+
} else if (r1 && self.drawInter) {
|
|
132
|
+
// draws a vertical line off to middle of nowhere if the second end not found
|
|
133
|
+
const p = r1.offsetPx - view.offsetPx
|
|
134
|
+
ctx.strokeStyle = 'purple'
|
|
135
|
+
ctx.beginPath()
|
|
136
|
+
ctx.moveTo(p, 0)
|
|
137
|
+
ctx.lineTo(p, displayHeight)
|
|
138
|
+
ctx.stroke()
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
for (let i = 0; i < chains.length; i++) {
|
|
143
|
+
let chain = chains[i]
|
|
144
|
+
|
|
145
|
+
if (chain.length === 1 && self.drawLongRange) {
|
|
146
|
+
// singleton feature
|
|
147
|
+
const f = chain[0]
|
|
148
|
+
|
|
149
|
+
// special case where we look at RPOS/RNEXT
|
|
150
|
+
if (hasPaired) {
|
|
151
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
152
|
+
const refName = asm?.getCanonicalRefName(f.next_ref!) || f.next_ref!
|
|
153
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
154
|
+
const coord = f.next_pos!
|
|
155
|
+
draw(
|
|
156
|
+
f,
|
|
157
|
+
{
|
|
158
|
+
refName,
|
|
159
|
+
start: coord,
|
|
160
|
+
end: coord,
|
|
161
|
+
strand: f.strand,
|
|
162
|
+
},
|
|
163
|
+
true,
|
|
164
|
+
)
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// special case where we look at SA
|
|
168
|
+
else {
|
|
169
|
+
const suppAlns = featurizeSA(f.SA, f.id, f.strand, f.name)
|
|
170
|
+
const features = [f, ...suppAlns].sort((a, b) => a.clipPos - b.clipPos)
|
|
171
|
+
for (let i = 0; i < features.length - 1; i++) {
|
|
172
|
+
const f = features[i]
|
|
173
|
+
const v1 = features[i + 1]
|
|
174
|
+
draw(
|
|
175
|
+
f,
|
|
176
|
+
{
|
|
177
|
+
refName: asm?.getCanonicalRefName(v1.refName) || v1.refName,
|
|
178
|
+
start: v1.start,
|
|
179
|
+
end: v1.end,
|
|
180
|
+
strand: v1.strand,
|
|
181
|
+
},
|
|
182
|
+
true,
|
|
183
|
+
)
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
} else {
|
|
187
|
+
if (!hasPaired) {
|
|
188
|
+
chain.sort((a, b) => a.clipPos - b.clipPos)
|
|
189
|
+
chain = chain.filter(f => !(f.flags & 256))
|
|
190
|
+
} else {
|
|
191
|
+
// ignore split/supplementary reads for hasPaired=true for now
|
|
192
|
+
chain = chain.filter(f => !(f.flags & 2048))
|
|
193
|
+
}
|
|
194
|
+
for (let i = 0; i < chain.length - 1; i++) {
|
|
195
|
+
draw(chain[i], chain[i + 1], false)
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import PluginManager from '@jbrowse/core/PluginManager'
|
|
2
|
+
import DisplayType from '@jbrowse/core/pluggableElementTypes/DisplayType'
|
|
3
|
+
|
|
4
|
+
// locals
|
|
5
|
+
import ReactComponent from './components/ReactComponent'
|
|
6
|
+
import configSchemaF from './configSchema'
|
|
7
|
+
import stateModelF from './model'
|
|
8
|
+
|
|
9
|
+
export default function register(pluginManager: PluginManager) {
|
|
10
|
+
pluginManager.addDisplayType(() => {
|
|
11
|
+
const configSchema = configSchemaF(pluginManager)
|
|
12
|
+
return new DisplayType({
|
|
13
|
+
name: 'LinearReadArcsDisplay',
|
|
14
|
+
displayName: 'Arc display',
|
|
15
|
+
configSchema,
|
|
16
|
+
stateModel: stateModelF(configSchema),
|
|
17
|
+
trackType: 'AlignmentsTrack',
|
|
18
|
+
viewType: 'LinearGenomeView',
|
|
19
|
+
subDisplay: { type: 'LinearAlignmentsDisplay', lowerPanel: true },
|
|
20
|
+
ReactComponent,
|
|
21
|
+
})
|
|
22
|
+
})
|
|
23
|
+
}
|