@jbrowse/plugin-alignments 1.7.9 → 2.0.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 +192 -207
- package/dist/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js.map +1 -0
- package/dist/AlignmentsFeatureDetail/index.d.ts +28 -3
- package/dist/AlignmentsFeatureDetail/index.js +48 -55
- package/dist/AlignmentsFeatureDetail/index.js.map +1 -0
- package/dist/AlignmentsTrack/index.js +24 -32
- package/dist/AlignmentsTrack/index.js.map +1 -0
- package/dist/BamAdapter/BamAdapter.js +345 -585
- package/dist/BamAdapter/BamAdapter.js.map +1 -0
- package/dist/BamAdapter/BamSlightlyLazyFeature.js +143 -174
- package/dist/BamAdapter/BamSlightlyLazyFeature.js.map +1 -0
- package/dist/BamAdapter/MismatchParser.js +340 -416
- package/dist/BamAdapter/MismatchParser.js.map +1 -0
- package/dist/BamAdapter/configSchema.js +33 -46
- package/dist/BamAdapter/configSchema.js.map +1 -0
- package/dist/BamAdapter/index.js +36 -32
- package/dist/BamAdapter/index.js.map +1 -0
- package/dist/CramAdapter/CramAdapter.js +376 -644
- package/dist/CramAdapter/CramAdapter.js.map +1 -0
- package/dist/CramAdapter/CramSlightlyLazyFeature.js +374 -439
- package/dist/CramAdapter/CramSlightlyLazyFeature.js.map +1 -0
- package/dist/CramAdapter/CramTestAdapters.js +169 -227
- package/dist/CramAdapter/CramTestAdapters.js.map +1 -0
- package/dist/CramAdapter/configSchema.js +28 -38
- package/dist/CramAdapter/configSchema.js.map +1 -0
- package/dist/CramAdapter/index.js +37 -32
- package/dist/CramAdapter/index.js.map +1 -0
- package/dist/HtsgetBamAdapter/HtsgetBamAdapter.js +91 -93
- package/dist/HtsgetBamAdapter/HtsgetBamAdapter.js.map +1 -0
- package/dist/HtsgetBamAdapter/configSchema.js +19 -29
- package/dist/HtsgetBamAdapter/configSchema.js.map +1 -0
- package/dist/HtsgetBamAdapter/index.js +44 -38
- package/dist/HtsgetBamAdapter/index.js.map +1 -0
- package/dist/LinearAlignmentsDisplay/components/AlignmentsDisplay.js +36 -65
- package/dist/LinearAlignmentsDisplay/components/AlignmentsDisplay.js.map +1 -0
- package/dist/LinearAlignmentsDisplay/index.js +22 -28
- package/dist/LinearAlignmentsDisplay/index.js.map +1 -0
- package/dist/LinearAlignmentsDisplay/models/configSchema.js +12 -23
- package/dist/LinearAlignmentsDisplay/models/configSchema.js.map +1 -0
- package/dist/LinearAlignmentsDisplay/models/model.d.ts +10 -10
- package/dist/LinearAlignmentsDisplay/models/model.js +257 -245
- package/dist/LinearAlignmentsDisplay/models/model.js.map +1 -0
- package/dist/LinearPileupDisplay/components/ColorByModifications.js +98 -116
- package/dist/LinearPileupDisplay/components/ColorByModifications.js.map +1 -0
- package/dist/LinearPileupDisplay/components/ColorByTag.js +82 -91
- package/dist/LinearPileupDisplay/components/ColorByTag.js.map +1 -0
- package/dist/LinearPileupDisplay/components/FilterByTag.js +156 -192
- package/dist/LinearPileupDisplay/components/FilterByTag.js.map +1 -0
- package/dist/LinearPileupDisplay/components/LinearPileupDisplayBlurb.js +15 -29
- package/dist/LinearPileupDisplay/components/LinearPileupDisplayBlurb.js.map +1 -0
- package/dist/LinearPileupDisplay/components/SetFeatureHeight.js +79 -93
- package/dist/LinearPileupDisplay/components/SetFeatureHeight.js.map +1 -0
- package/dist/LinearPileupDisplay/components/SetMaxHeight.js +78 -81
- package/dist/LinearPileupDisplay/components/SetMaxHeight.js.map +1 -0
- package/dist/LinearPileupDisplay/components/SortByTag.js +80 -88
- package/dist/LinearPileupDisplay/components/SortByTag.js.map +1 -0
- package/dist/LinearPileupDisplay/configSchema.js +40 -42
- package/dist/LinearPileupDisplay/configSchema.js.map +1 -0
- package/dist/LinearPileupDisplay/index.js +21 -27
- package/dist/LinearPileupDisplay/index.js.map +1 -0
- package/dist/LinearPileupDisplay/model.d.ts +33 -20
- package/dist/LinearPileupDisplay/model.js +702 -716
- package/dist/LinearPileupDisplay/model.js.map +1 -0
- package/dist/LinearSNPCoverageDisplay/components/Tooltip.d.ts +1 -1
- package/dist/LinearSNPCoverageDisplay/components/Tooltip.js +105 -57
- package/dist/LinearSNPCoverageDisplay/components/Tooltip.js.map +1 -0
- package/dist/LinearSNPCoverageDisplay/index.js +21 -27
- package/dist/LinearSNPCoverageDisplay/index.js.map +1 -0
- package/dist/LinearSNPCoverageDisplay/models/configSchema.js +45 -55
- package/dist/LinearSNPCoverageDisplay/models/configSchema.js.map +1 -0
- package/dist/LinearSNPCoverageDisplay/models/model.d.ts +14 -12
- package/dist/LinearSNPCoverageDisplay/models/model.js +257 -230
- package/dist/LinearSNPCoverageDisplay/models/model.js.map +1 -0
- package/dist/NestedFrequencyTable.js +104 -139
- package/dist/NestedFrequencyTable.js.map +1 -0
- package/dist/PileupRPC/rpcMethods.js +199 -278
- package/dist/PileupRPC/rpcMethods.js.map +1 -0
- package/dist/PileupRenderer/PileupLayoutSession.js +56 -76
- package/dist/PileupRenderer/PileupLayoutSession.js.map +1 -0
- package/dist/PileupRenderer/PileupRenderer.d.ts +56 -11
- package/dist/PileupRenderer/PileupRenderer.js +942 -1134
- package/dist/PileupRenderer/PileupRenderer.js.map +1 -0
- package/dist/PileupRenderer/components/PileupRendering.d.ts +1 -1
- package/dist/PileupRenderer/components/PileupRendering.js +173 -253
- package/dist/PileupRenderer/components/PileupRendering.js.map +1 -0
- package/dist/PileupRenderer/configSchema.js +65 -71
- package/dist/PileupRenderer/configSchema.js.map +1 -0
- package/dist/PileupRenderer/index.js +17 -22
- package/dist/PileupRenderer/index.js.map +1 -0
- package/dist/PileupRenderer/sortUtil.js +83 -107
- package/dist/PileupRenderer/sortUtil.js.map +1 -0
- package/dist/SNPCoverageAdapter/SNPCoverageAdapter.d.ts +2 -0
- package/dist/SNPCoverageAdapter/SNPCoverageAdapter.js +436 -586
- package/dist/SNPCoverageAdapter/SNPCoverageAdapter.js.map +1 -0
- package/dist/SNPCoverageAdapter/configSchema.js +10 -20
- package/dist/SNPCoverageAdapter/configSchema.js.map +1 -0
- package/dist/SNPCoverageAdapter/index.js +46 -41
- package/dist/SNPCoverageAdapter/index.js.map +1 -0
- package/dist/SNPCoverageRenderer/SNPCoverageRenderer.d.ts +1 -1
- package/dist/SNPCoverageRenderer/SNPCoverageRenderer.js +265 -290
- package/dist/SNPCoverageRenderer/SNPCoverageRenderer.js.map +1 -0
- package/dist/SNPCoverageRenderer/configSchema.js +30 -39
- package/dist/SNPCoverageRenderer/configSchema.js.map +1 -0
- package/dist/SNPCoverageRenderer/index.js +19 -30
- package/dist/SNPCoverageRenderer/index.js.map +1 -0
- package/dist/index.js +135 -152
- package/dist/index.js.map +1 -0
- package/dist/shared.js +84 -92
- package/dist/shared.js.map +1 -0
- package/dist/util.js +130 -121
- package/dist/util.js.map +1 -0
- package/esm/AlignmentsFeatureDetail/AlignmentsFeatureDetail.d.ts +6 -0
- package/esm/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js +145 -0
- package/esm/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js.map +1 -0
- package/esm/AlignmentsFeatureDetail/index.d.ts +38 -0
- package/esm/AlignmentsFeatureDetail/index.js +23 -0
- package/esm/AlignmentsFeatureDetail/index.js.map +1 -0
- package/esm/AlignmentsTrack/index.d.ts +2 -0
- package/esm/AlignmentsTrack/index.js +23 -0
- package/esm/AlignmentsTrack/index.js.map +1 -0
- package/esm/BamAdapter/BamAdapter.d.ts +40 -0
- package/esm/BamAdapter/BamAdapter.js +173 -0
- package/esm/BamAdapter/BamAdapter.js.map +1 -0
- package/esm/BamAdapter/BamSlightlyLazyFeature.d.ts +33 -0
- package/esm/BamAdapter/BamSlightlyLazyFeature.js +107 -0
- package/esm/BamAdapter/BamSlightlyLazyFeature.js.map +1 -0
- package/esm/BamAdapter/MismatchParser.d.ts +25 -0
- package/esm/BamAdapter/MismatchParser.js +294 -0
- package/esm/BamAdapter/MismatchParser.js.map +1 -0
- package/esm/BamAdapter/configSchema.d.ts +2 -0
- package/esm/BamAdapter/configSchema.js +31 -0
- package/esm/BamAdapter/configSchema.js.map +1 -0
- package/esm/BamAdapter/index.d.ts +3 -0
- package/esm/BamAdapter/index.js +10 -0
- package/esm/BamAdapter/index.js.map +1 -0
- package/esm/CramAdapter/CramAdapter.d.ts +53 -0
- package/esm/CramAdapter/CramAdapter.js +228 -0
- package/esm/CramAdapter/CramAdapter.js.map +1 -0
- package/esm/CramAdapter/CramSlightlyLazyFeature.d.ts +49 -0
- package/esm/CramAdapter/CramSlightlyLazyFeature.js +349 -0
- package/esm/CramAdapter/CramSlightlyLazyFeature.js.map +1 -0
- package/esm/CramAdapter/CramTestAdapters.d.ts +29 -0
- package/esm/CramAdapter/CramTestAdapters.js +70 -0
- package/esm/CramAdapter/CramTestAdapters.js.map +1 -0
- package/esm/CramAdapter/configSchema.d.ts +3 -0
- package/esm/CramAdapter/configSchema.js +26 -0
- package/esm/CramAdapter/configSchema.js.map +1 -0
- package/esm/CramAdapter/index.d.ts +3 -0
- package/esm/CramAdapter/index.js +11 -0
- package/esm/CramAdapter/index.js.map +1 -0
- package/esm/HtsgetBamAdapter/HtsgetBamAdapter.d.ts +9 -0
- package/esm/HtsgetBamAdapter/HtsgetBamAdapter.js +27 -0
- package/esm/HtsgetBamAdapter/HtsgetBamAdapter.js.map +1 -0
- package/esm/HtsgetBamAdapter/configSchema.d.ts +2 -0
- package/esm/HtsgetBamAdapter/configSchema.js +17 -0
- package/esm/HtsgetBamAdapter/configSchema.js.map +1 -0
- package/esm/HtsgetBamAdapter/index.d.ts +3 -0
- package/esm/HtsgetBamAdapter/index.js +16 -0
- package/esm/HtsgetBamAdapter/index.js.map +1 -0
- package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.d.ts +7 -0
- package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.js +34 -0
- package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.js.map +1 -0
- package/esm/LinearAlignmentsDisplay/index.d.ts +2 -0
- package/esm/LinearAlignmentsDisplay/index.js +19 -0
- package/esm/LinearAlignmentsDisplay/index.js.map +1 -0
- package/esm/LinearAlignmentsDisplay/models/configSchema.d.ts +4 -0
- package/esm/LinearAlignmentsDisplay/models/configSchema.js +12 -0
- package/esm/LinearAlignmentsDisplay/models/configSchema.js.map +1 -0
- package/esm/LinearAlignmentsDisplay/models/model.d.ts +105 -0
- package/esm/LinearAlignmentsDisplay/models/model.js +181 -0
- package/esm/LinearAlignmentsDisplay/models/model.js.map +1 -0
- package/esm/LinearPileupDisplay/components/ColorByModifications.d.ts +14 -0
- package/esm/LinearPileupDisplay/components/ColorByModifications.js +71 -0
- package/esm/LinearPileupDisplay/components/ColorByModifications.js.map +1 -0
- package/esm/LinearPileupDisplay/components/ColorByTag.d.ts +9 -0
- package/esm/LinearPileupDisplay/components/ColorByTag.js +45 -0
- package/esm/LinearPileupDisplay/components/ColorByTag.js.map +1 -0
- package/esm/LinearPileupDisplay/components/FilterByTag.d.ts +18 -0
- package/esm/LinearPileupDisplay/components/FilterByTag.js +123 -0
- package/esm/LinearPileupDisplay/components/FilterByTag.js.map +1 -0
- package/esm/LinearPileupDisplay/components/LinearPileupDisplayBlurb.d.ts +13 -0
- package/esm/LinearPileupDisplay/components/LinearPileupDisplayBlurb.js +13 -0
- package/esm/LinearPileupDisplay/components/LinearPileupDisplayBlurb.js.map +1 -0
- package/esm/LinearPileupDisplay/components/SetFeatureHeight.d.ts +16 -0
- package/esm/LinearPileupDisplay/components/SetFeatureHeight.js +41 -0
- package/esm/LinearPileupDisplay/components/SetFeatureHeight.js.map +1 -0
- package/esm/LinearPileupDisplay/components/SetMaxHeight.d.ts +10 -0
- package/esm/LinearPileupDisplay/components/SetMaxHeight.js +43 -0
- package/esm/LinearPileupDisplay/components/SetMaxHeight.js.map +1 -0
- package/esm/LinearPileupDisplay/components/SortByTag.d.ts +9 -0
- package/esm/LinearPileupDisplay/components/SortByTag.js +43 -0
- package/esm/LinearPileupDisplay/components/SortByTag.js.map +1 -0
- package/esm/LinearPileupDisplay/configSchema.d.ts +6 -0
- package/esm/LinearPileupDisplay/configSchema.js +41 -0
- package/esm/LinearPileupDisplay/configSchema.js.map +1 -0
- package/esm/LinearPileupDisplay/index.d.ts +2 -0
- package/esm/LinearPileupDisplay/index.js +18 -0
- package/esm/LinearPileupDisplay/index.js.map +1 -0
- package/esm/LinearPileupDisplay/model.d.ts +332 -0
- package/esm/LinearPileupDisplay/model.js +576 -0
- package/esm/LinearPileupDisplay/model.js.map +1 -0
- package/esm/LinearSNPCoverageDisplay/components/Tooltip.d.ts +10 -0
- package/esm/LinearSNPCoverageDisplay/components/Tooltip.js +57 -0
- package/esm/LinearSNPCoverageDisplay/components/Tooltip.js.map +1 -0
- package/esm/LinearSNPCoverageDisplay/index.d.ts +2 -0
- package/esm/LinearSNPCoverageDisplay/index.js +18 -0
- package/esm/LinearSNPCoverageDisplay/index.js.map +1 -0
- package/esm/LinearSNPCoverageDisplay/models/configSchema.d.ts +2 -0
- package/esm/LinearSNPCoverageDisplay/models/configSchema.js +44 -0
- package/esm/LinearSNPCoverageDisplay/models/configSchema.js.map +1 -0
- package/esm/LinearSNPCoverageDisplay/models/model.d.ts +348 -0
- package/esm/LinearSNPCoverageDisplay/models/model.js +185 -0
- package/esm/LinearSNPCoverageDisplay/models/model.js.map +1 -0
- package/esm/NestedFrequencyTable.d.ts +14 -0
- package/esm/NestedFrequencyTable.js +101 -0
- package/esm/NestedFrequencyTable.js.map +1 -0
- package/esm/PileupRPC/rpcMethods.d.ts +34 -0
- package/esm/PileupRPC/rpcMethods.js +70 -0
- package/esm/PileupRPC/rpcMethods.js.map +1 -0
- package/esm/PileupRenderer/PileupLayoutSession.d.ts +32 -0
- package/esm/PileupRenderer/PileupLayoutSession.js +32 -0
- package/esm/PileupRenderer/PileupLayoutSession.js.map +1 -0
- package/esm/PileupRenderer/PileupRenderer.d.ts +182 -0
- package/esm/PileupRenderer/PileupRenderer.js +830 -0
- package/esm/PileupRenderer/PileupRenderer.js.map +1 -0
- package/esm/PileupRenderer/components/PileupRendering.d.ts +23 -0
- package/esm/PileupRenderer/components/PileupRendering.js +138 -0
- package/esm/PileupRenderer/components/PileupRendering.js.map +1 -0
- package/esm/PileupRenderer/configSchema.d.ts +2 -0
- package/esm/PileupRenderer/configSchema.js +64 -0
- package/esm/PileupRenderer/configSchema.js.map +1 -0
- package/esm/PileupRenderer/index.d.ts +2 -0
- package/esm/PileupRenderer/index.js +12 -0
- package/esm/PileupRenderer/index.js.map +1 -0
- package/esm/PileupRenderer/sortUtil.d.ts +8 -0
- package/esm/PileupRenderer/sortUtil.js +80 -0
- package/esm/PileupRenderer/sortUtil.js.map +1 -0
- package/esm/SNPCoverageAdapter/SNPCoverageAdapter.d.ts +67 -0
- package/esm/SNPCoverageAdapter/SNPCoverageAdapter.js +259 -0
- package/esm/SNPCoverageAdapter/SNPCoverageAdapter.js.map +1 -0
- package/esm/SNPCoverageAdapter/configSchema.d.ts +3 -0
- package/esm/SNPCoverageAdapter/configSchema.js +6 -0
- package/esm/SNPCoverageAdapter/configSchema.js.map +1 -0
- package/esm/SNPCoverageAdapter/index.d.ts +3 -0
- package/esm/SNPCoverageAdapter/index.js +18 -0
- package/esm/SNPCoverageAdapter/index.js.map +1 -0
- package/esm/SNPCoverageRenderer/SNPCoverageRenderer.d.ts +20 -0
- package/esm/SNPCoverageRenderer/SNPCoverageRenderer.js +185 -0
- package/esm/SNPCoverageRenderer/SNPCoverageRenderer.js.map +1 -0
- package/esm/SNPCoverageRenderer/configSchema.d.ts +2 -0
- package/esm/SNPCoverageRenderer/configSchema.js +29 -0
- package/esm/SNPCoverageRenderer/configSchema.js.map +1 -0
- package/esm/SNPCoverageRenderer/index.d.ts +3 -0
- package/esm/SNPCoverageRenderer/index.js +14 -0
- package/esm/SNPCoverageRenderer/index.js.map +1 -0
- package/esm/index.d.ts +10 -0
- package/esm/index.js +91 -0
- package/esm/index.js.map +1 -0
- package/esm/shared.d.ts +25 -0
- package/esm/shared.js +28 -0
- package/esm/shared.js.map +1 -0
- package/esm/util.d.ts +19 -0
- package/esm/util.js +83 -0
- package/esm/util.js.map +1 -0
- package/package.json +19 -11
- package/src/AlignmentsFeatureDetail/AlignmentsFeatureDetail.tsx +16 -6
- package/src/AlignmentsFeatureDetail/__snapshots__/index.test.js.snap +321 -397
- package/src/AlignmentsFeatureDetail/index.ts +7 -17
- package/src/BamAdapter/MismatchParser.ts +1 -0
- package/src/LinearAlignmentsDisplay/components/AlignmentsDisplay.tsx +3 -3
- package/src/LinearPileupDisplay/components/ColorByModifications.tsx +7 -7
- package/src/LinearPileupDisplay/components/ColorByTag.tsx +5 -5
- package/src/LinearPileupDisplay/components/FilterByTag.tsx +5 -5
- package/src/LinearPileupDisplay/components/LinearPileupDisplayBlurb.tsx +1 -1
- package/src/LinearPileupDisplay/components/SetFeatureHeight.tsx +9 -9
- package/src/LinearPileupDisplay/components/SetMaxHeight.tsx +5 -5
- package/src/LinearPileupDisplay/components/SortByTag.tsx +5 -5
- package/src/LinearPileupDisplay/model.ts +90 -32
- package/src/LinearSNPCoverageDisplay/components/Tooltip.tsx +44 -30
- package/src/LinearSNPCoverageDisplay/models/model.ts +25 -25
- package/src/PileupRenderer/PileupRenderer.tsx +399 -198
- package/src/PileupRenderer/components/PileupRendering.tsx +11 -11
- package/src/SNPCoverageAdapter/SNPCoverageAdapter.ts +5 -0
- package/src/SNPCoverageRenderer/SNPCoverageRenderer.ts +7 -5
- package/dist/AlignmentsFeatureDetail/index.test.js +0 -60
- package/dist/BamAdapter/BamAdapter.test.js +0 -177
- package/dist/BamAdapter/MismatchParser.test.js +0 -251
- package/dist/CramAdapter/CramAdapter.test.js +0 -138
- package/dist/LinearAlignmentsDisplay/models/configSchema.test.js +0 -83
- package/dist/LinearPileupDisplay/configSchema.test.js +0 -92
- package/dist/LinearSNPCoverageDisplay/models/configSchema.test.js +0 -62
- package/dist/PileupRenderer/components/PileupRendering.test.js +0 -36
- package/dist/declare.d.js +0 -1
- package/dist/index.test.js +0 -26
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import React, { useRef, useState, useEffect } from 'react'
|
|
1
2
|
import { Region } from '@jbrowse/core/util/types'
|
|
2
3
|
import { PrerenderedCanvas } from '@jbrowse/core/ui'
|
|
3
4
|
import { bpSpanPx } from '@jbrowse/core/util'
|
|
4
5
|
import { observer } from 'mobx-react'
|
|
5
|
-
import React, { MouseEvent, useRef, useState, useEffect } from 'react'
|
|
6
6
|
import type { BaseLinearDisplayModel } from '@jbrowse/plugin-linear-genome-view'
|
|
7
7
|
|
|
8
8
|
// used so that user can click-away-from-feature below the laid out features
|
|
@@ -91,46 +91,46 @@ function PileupRendering(props: {
|
|
|
91
91
|
contextMenuFeature,
|
|
92
92
|
])
|
|
93
93
|
|
|
94
|
-
function onMouseDown(event: MouseEvent) {
|
|
94
|
+
function onMouseDown(event: React.MouseEvent) {
|
|
95
95
|
setMouseIsDown(true)
|
|
96
96
|
setMovedDuringLastMouseDown(false)
|
|
97
97
|
callMouseHandler('MouseDown', event)
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
function onMouseEnter(event: MouseEvent) {
|
|
100
|
+
function onMouseEnter(event: React.MouseEvent) {
|
|
101
101
|
callMouseHandler('MouseEnter', event)
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
function onMouseOut(event: MouseEvent) {
|
|
104
|
+
function onMouseOut(event: React.MouseEvent) {
|
|
105
105
|
callMouseHandler('MouseOut', event)
|
|
106
106
|
callMouseHandler('MouseLeave', event)
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
function onMouseOver(event: MouseEvent) {
|
|
109
|
+
function onMouseOver(event: React.MouseEvent) {
|
|
110
110
|
callMouseHandler('MouseOver', event)
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
function onMouseUp(event: MouseEvent) {
|
|
113
|
+
function onMouseUp(event: React.MouseEvent) {
|
|
114
114
|
setMouseIsDown(false)
|
|
115
115
|
callMouseHandler('MouseUp', event)
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
function onClick(event: MouseEvent) {
|
|
118
|
+
function onClick(event: React.MouseEvent) {
|
|
119
119
|
if (!movedDuringLastMouseDown) {
|
|
120
120
|
callMouseHandler('Click', event)
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
function onMouseLeave(event: MouseEvent) {
|
|
124
|
+
function onMouseLeave(event: React.MouseEvent) {
|
|
125
125
|
callMouseHandler('MouseOut', event)
|
|
126
126
|
callMouseHandler('MouseLeave', event)
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
function onContextMenu(event: MouseEvent) {
|
|
129
|
+
function onContextMenu(event: React.MouseEvent) {
|
|
130
130
|
callMouseHandler('ContextMenu', event)
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
function mouseMove(event: MouseEvent) {
|
|
133
|
+
function mouseMove(event: React.MouseEvent) {
|
|
134
134
|
if (mouseIsDown) {
|
|
135
135
|
setMovedDuringLastMouseDown(true)
|
|
136
136
|
}
|
|
@@ -158,7 +158,7 @@ function PileupRendering(props: {
|
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
function callMouseHandler(handlerName: string, event: MouseEvent) {
|
|
161
|
+
function callMouseHandler(handlerName: string, event: React.MouseEvent) {
|
|
162
162
|
// @ts-ignore
|
|
163
163
|
// eslint-disable-next-line react/destructuring-assignment
|
|
164
164
|
const featureHandler = props[`onFeature${handlerName}`]
|
|
@@ -166,7 +166,9 @@ export default class SNPCoverageAdapter extends BaseFeatureDataAdapter {
|
|
|
166
166
|
: undefined
|
|
167
167
|
|
|
168
168
|
const bins = [] as {
|
|
169
|
+
refbase?: string
|
|
169
170
|
total: number
|
|
171
|
+
all: number
|
|
170
172
|
ref: number
|
|
171
173
|
'-1': 0
|
|
172
174
|
'0': 0
|
|
@@ -189,6 +191,7 @@ export default class SNPCoverageAdapter extends BaseFeatureDataAdapter {
|
|
|
189
191
|
if (bins[i] === undefined) {
|
|
190
192
|
bins[i] = {
|
|
191
193
|
total: 0,
|
|
194
|
+
all: 0,
|
|
192
195
|
ref: 0,
|
|
193
196
|
'-1': 0,
|
|
194
197
|
'0': 0,
|
|
@@ -201,6 +204,7 @@ export default class SNPCoverageAdapter extends BaseFeatureDataAdapter {
|
|
|
201
204
|
}
|
|
202
205
|
if (j !== fend) {
|
|
203
206
|
bins[i].total++
|
|
207
|
+
bins[i].all++
|
|
204
208
|
bins[i].ref++
|
|
205
209
|
bins[i][fstrand]++
|
|
206
210
|
}
|
|
@@ -318,6 +322,7 @@ export default class SNPCoverageAdapter extends BaseFeatureDataAdapter {
|
|
|
318
322
|
bin.total--
|
|
319
323
|
} else if (!interbase && colorSNPs) {
|
|
320
324
|
inc(bin, fstrand, 'cov', base)
|
|
325
|
+
bin.refbase = mismatch.altbase
|
|
321
326
|
}
|
|
322
327
|
}
|
|
323
328
|
}
|
|
@@ -39,7 +39,7 @@ interface SNPInfo {
|
|
|
39
39
|
export default class SNPCoverageRenderer extends WiggleBaseRenderer {
|
|
40
40
|
// note: the snps are drawn on linear scale even if the data is drawn in log
|
|
41
41
|
// scape hence the two different scales being used
|
|
42
|
-
draw(
|
|
42
|
+
async draw(
|
|
43
43
|
ctx: CanvasRenderingContext2D,
|
|
44
44
|
props: RenderArgsDeserializedWithFeatures,
|
|
45
45
|
) {
|
|
@@ -94,11 +94,13 @@ export default class SNPCoverageRenderer extends WiggleBaseRenderer {
|
|
|
94
94
|
const indicatorToHeight = (n: number) =>
|
|
95
95
|
indicatorToY(getOrigin('linear')) - indicatorToY(n)
|
|
96
96
|
|
|
97
|
+
// @ts-ignore
|
|
98
|
+
const { bases } = theme.palette
|
|
97
99
|
const colorForBase: { [key: string]: string } = {
|
|
98
|
-
A:
|
|
99
|
-
C:
|
|
100
|
-
G:
|
|
101
|
-
T:
|
|
100
|
+
A: bases.A.main,
|
|
101
|
+
C: bases.C.main,
|
|
102
|
+
G: bases.G.main,
|
|
103
|
+
T: bases.T.main,
|
|
102
104
|
total: 'lightgrey',
|
|
103
105
|
insertion: 'purple',
|
|
104
106
|
softclip: 'blue',
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _react = require("@testing-library/react");
|
|
6
|
-
|
|
7
|
-
var _mobxStateTree = require("mobx-state-tree");
|
|
8
|
-
|
|
9
|
-
var _react2 = _interopRequireDefault(require("react"));
|
|
10
|
-
|
|
11
|
-
var _PluginManager = _interopRequireDefault(require("@jbrowse/core/PluginManager"));
|
|
12
|
-
|
|
13
|
-
var _configuration = require("@jbrowse/core/configuration");
|
|
14
|
-
|
|
15
|
-
var _ = require(".");
|
|
16
|
-
|
|
17
|
-
var _AlignmentsFeatureDetail = _interopRequireDefault(require("./AlignmentsFeatureDetail"));
|
|
18
|
-
|
|
19
|
-
test('open up a widget', function () {
|
|
20
|
-
console.warn = jest.fn();
|
|
21
|
-
var pluginManager = new _PluginManager.default([]);
|
|
22
|
-
|
|
23
|
-
var Session = _mobxStateTree.types.model({
|
|
24
|
-
pluginManager: _mobxStateTree.types.optional(_mobxStateTree.types.frozen(), {}),
|
|
25
|
-
rpcManager: _mobxStateTree.types.optional(_mobxStateTree.types.frozen(), {}),
|
|
26
|
-
configuration: (0, _configuration.ConfigurationSchema)('test', {}),
|
|
27
|
-
widget: (0, _.stateModelFactory)(pluginManager)
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
var session = Session.create({
|
|
31
|
-
widget: {
|
|
32
|
-
type: 'AlignmentsFeatureWidget'
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
session.widget.setFeatureData({
|
|
36
|
-
seq: 'TTGTTGCGGAGTTGAACAACGGCATTAGGAACACTTCCGTCTCTCACTTTTATACGATTATGATTGGTTCTTTAGCCTTGGTTTAGATTGGTAGTAGTAG',
|
|
37
|
-
start: 2,
|
|
38
|
-
end: 102,
|
|
39
|
-
strand: 1,
|
|
40
|
-
score: 37,
|
|
41
|
-
qual: '17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17',
|
|
42
|
-
MQ: 37,
|
|
43
|
-
CIGAR: '100M',
|
|
44
|
-
length_on_ref: 100,
|
|
45
|
-
template_length: 0,
|
|
46
|
-
seq_length: 100,
|
|
47
|
-
name: 'ctgA_3_555_0:0:0_2:0:0_102d',
|
|
48
|
-
refName: 'ctgA',
|
|
49
|
-
type: 'match'
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
var _render = (0, _react.render)( /*#__PURE__*/_react2.default.createElement(_AlignmentsFeatureDetail.default, {
|
|
53
|
-
model: session.widget
|
|
54
|
-
})),
|
|
55
|
-
container = _render.container,
|
|
56
|
-
getByText = _render.getByText;
|
|
57
|
-
|
|
58
|
-
expect(container.firstChild).toMatchSnapshot();
|
|
59
|
-
expect(getByText('ctgA:3..102 (+)')).toBeTruthy();
|
|
60
|
-
});
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
6
|
-
|
|
7
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
8
|
-
|
|
9
|
-
var _operators = require("rxjs/operators");
|
|
10
|
-
|
|
11
|
-
var _BamAdapter = _interopRequireDefault(require("./BamAdapter"));
|
|
12
|
-
|
|
13
|
-
var _configSchema = _interopRequireDefault(require("./configSchema"));
|
|
14
|
-
|
|
15
|
-
test('adapter can fetch features from volvox.bam', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
16
|
-
var adapter, features, featuresArray, featuresJsonArray, adapterCSI, featuresCSI, featuresArrayCSI, featuresJsonArrayCSI;
|
|
17
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
18
|
-
while (1) {
|
|
19
|
-
switch (_context.prev = _context.next) {
|
|
20
|
-
case 0:
|
|
21
|
-
adapter = new _BamAdapter.default(_configSchema.default.create({
|
|
22
|
-
bamLocation: {
|
|
23
|
-
localPath: require.resolve('../../test_data/volvox-sorted.bam'),
|
|
24
|
-
locationType: 'LocalPathLocation'
|
|
25
|
-
},
|
|
26
|
-
index: {
|
|
27
|
-
location: {
|
|
28
|
-
localPath: require.resolve('../../test_data/volvox-sorted.bam.bai'),
|
|
29
|
-
locationType: 'LocalPathLocation'
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}));
|
|
33
|
-
features = adapter.getFeatures({
|
|
34
|
-
assemblyName: 'volvox',
|
|
35
|
-
refName: 'ctgA',
|
|
36
|
-
start: 0,
|
|
37
|
-
end: 20000
|
|
38
|
-
});
|
|
39
|
-
_context.next = 4;
|
|
40
|
-
return features.pipe((0, _operators.toArray)()).toPromise();
|
|
41
|
-
|
|
42
|
-
case 4:
|
|
43
|
-
featuresArray = _context.sent;
|
|
44
|
-
expect(featuresArray[0].get('refName')).toBe('ctgA');
|
|
45
|
-
featuresJsonArray = featuresArray.map(function (f) {
|
|
46
|
-
return f.toJSON();
|
|
47
|
-
});
|
|
48
|
-
expect(featuresJsonArray.length).toEqual(3809);
|
|
49
|
-
expect(featuresJsonArray.slice(1000, 1010)).toMatchSnapshot();
|
|
50
|
-
expect(adapter.refIdToName(0)).toBe('ctgA');
|
|
51
|
-
expect(adapter.refIdToName(1)).toBe(undefined);
|
|
52
|
-
_context.t0 = expect;
|
|
53
|
-
_context.next = 14;
|
|
54
|
-
return adapter.hasDataForRefName('ctgA');
|
|
55
|
-
|
|
56
|
-
case 14:
|
|
57
|
-
_context.t1 = _context.sent;
|
|
58
|
-
(0, _context.t0)(_context.t1).toBe(true);
|
|
59
|
-
adapterCSI = new _BamAdapter.default(_configSchema.default.create({
|
|
60
|
-
bamLocation: {
|
|
61
|
-
localPath: require.resolve('../../test_data/volvox-sorted.bam'),
|
|
62
|
-
locationType: 'LocalPathLocation'
|
|
63
|
-
},
|
|
64
|
-
index: {
|
|
65
|
-
indexType: 'CSI',
|
|
66
|
-
location: {
|
|
67
|
-
localPath: require.resolve('../../test_data/volvox-sorted.bam.csi'),
|
|
68
|
-
locationType: 'LocalPathLocation'
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}));
|
|
72
|
-
featuresCSI = adapterCSI.getFeatures({
|
|
73
|
-
assemblyName: 'volvox',
|
|
74
|
-
refName: 'ctgA',
|
|
75
|
-
start: 0,
|
|
76
|
-
end: 20000
|
|
77
|
-
});
|
|
78
|
-
_context.next = 20;
|
|
79
|
-
return featuresCSI.pipe((0, _operators.toArray)()).toPromise();
|
|
80
|
-
|
|
81
|
-
case 20:
|
|
82
|
-
featuresArrayCSI = _context.sent;
|
|
83
|
-
featuresJsonArrayCSI = featuresArrayCSI.map(function (f) {
|
|
84
|
-
return f.toJSON();
|
|
85
|
-
});
|
|
86
|
-
expect(featuresJsonArrayCSI).toEqual(featuresJsonArray);
|
|
87
|
-
|
|
88
|
-
case 23:
|
|
89
|
-
case "end":
|
|
90
|
-
return _context.stop();
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}, _callee);
|
|
94
|
-
})));
|
|
95
|
-
test('test usage of BamSlightlyLazyFeature toJSON (used in the widget)', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
96
|
-
var adapter, features, featuresArray, f;
|
|
97
|
-
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
98
|
-
while (1) {
|
|
99
|
-
switch (_context2.prev = _context2.next) {
|
|
100
|
-
case 0:
|
|
101
|
-
adapter = new _BamAdapter.default(_configSchema.default.create({
|
|
102
|
-
bamLocation: {
|
|
103
|
-
localPath: require.resolve('../../test_data/volvox-sorted.bam'),
|
|
104
|
-
locationType: 'LocalPathLocation'
|
|
105
|
-
},
|
|
106
|
-
index: {
|
|
107
|
-
location: {
|
|
108
|
-
localPath: require.resolve('../../test_data/volvox-sorted.bam.bai'),
|
|
109
|
-
locationType: 'LocalPathLocation'
|
|
110
|
-
},
|
|
111
|
-
indexType: 'BAI'
|
|
112
|
-
}
|
|
113
|
-
}));
|
|
114
|
-
features = adapter.getFeatures({
|
|
115
|
-
assemblyName: 'volvox',
|
|
116
|
-
refName: 'ctgA',
|
|
117
|
-
start: 0,
|
|
118
|
-
end: 100
|
|
119
|
-
});
|
|
120
|
-
_context2.next = 4;
|
|
121
|
-
return features.pipe((0, _operators.toArray)()).toPromise();
|
|
122
|
-
|
|
123
|
-
case 4:
|
|
124
|
-
featuresArray = _context2.sent;
|
|
125
|
-
f = featuresArray[0].toJSON();
|
|
126
|
-
expect(f.refName).toBe('ctgA');
|
|
127
|
-
expect(f.start).toBe(2);
|
|
128
|
-
expect(f.end).toBe(102);
|
|
129
|
-
expect(f.mismatches).not.toBeTruthy();
|
|
130
|
-
|
|
131
|
-
case 10:
|
|
132
|
-
case "end":
|
|
133
|
-
return _context2.stop();
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}, _callee2);
|
|
137
|
-
})));
|
|
138
|
-
test('test usage of BamSlightlyLazyFeature for extended CIGAR', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
139
|
-
var adapter, features, featuresArray, f;
|
|
140
|
-
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
141
|
-
while (1) {
|
|
142
|
-
switch (_context3.prev = _context3.next) {
|
|
143
|
-
case 0:
|
|
144
|
-
adapter = new _BamAdapter.default(_configSchema.default.create({
|
|
145
|
-
bamLocation: {
|
|
146
|
-
localPath: require.resolve('../../test_data/extended_cigar.bam'),
|
|
147
|
-
locationType: 'LocalPathLocation'
|
|
148
|
-
},
|
|
149
|
-
index: {
|
|
150
|
-
location: {
|
|
151
|
-
localPath: require.resolve('../../test_data/extended_cigar.bam.bai'),
|
|
152
|
-
locationType: 'LocalPathLocation'
|
|
153
|
-
},
|
|
154
|
-
indexType: 'BAI'
|
|
155
|
-
}
|
|
156
|
-
}));
|
|
157
|
-
features = adapter.getFeatures({
|
|
158
|
-
assemblyName: 'hg19',
|
|
159
|
-
refName: '1',
|
|
160
|
-
start: 13260,
|
|
161
|
-
end: 13340
|
|
162
|
-
});
|
|
163
|
-
_context3.next = 4;
|
|
164
|
-
return features.pipe((0, _operators.toArray)()).toPromise();
|
|
165
|
-
|
|
166
|
-
case 4:
|
|
167
|
-
featuresArray = _context3.sent;
|
|
168
|
-
f = featuresArray[0];
|
|
169
|
-
expect(f.get('mismatches')).toMatchSnapshot();
|
|
170
|
-
|
|
171
|
-
case 7:
|
|
172
|
-
case "end":
|
|
173
|
-
return _context3.stop();
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}, _callee3);
|
|
177
|
-
})));
|
|
@@ -1,251 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
6
|
-
|
|
7
|
-
var _MismatchParser = require("./MismatchParser");
|
|
8
|
-
|
|
9
|
-
var seq = 'AAAAAAAAAACAAAAAAAAAAAAAACCCCCCCCCCCCCCCCCCCCCCCCCGGGGGGGGGGGGGGGGGGGGGGGGGTTTTTTTTTTTTTTTTTTTTTTTTT'; // examples come from https://github.com/vsbuffalo/devnotes/wiki/The-MD-Tag-in-BAM-Files
|
|
10
|
-
// and http://seqanswers.com/forums/showthread.php?t=8978
|
|
11
|
-
|
|
12
|
-
test('cigar to mismatches', function () {
|
|
13
|
-
expect((0, _MismatchParser.cigarToMismatches)((0, _MismatchParser.parseCigar)('56M1D45M'), seq)).toEqual([{
|
|
14
|
-
start: 56,
|
|
15
|
-
type: 'deletion',
|
|
16
|
-
base: '*',
|
|
17
|
-
length: 1
|
|
18
|
-
}]);
|
|
19
|
-
});
|
|
20
|
-
test('md to mismatches', function () {
|
|
21
|
-
var cigarMismatches = (0, _MismatchParser.cigarToMismatches)((0, _MismatchParser.parseCigar)('56M1D45M'), seq);
|
|
22
|
-
expect((0, _MismatchParser.mdToMismatches)('10A80', (0, _MismatchParser.parseCigar)('56M1D45M'), cigarMismatches, seq)).toEqual([{
|
|
23
|
-
start: 10,
|
|
24
|
-
type: 'mismatch',
|
|
25
|
-
base: 'C',
|
|
26
|
-
altbase: 'A',
|
|
27
|
-
length: 1
|
|
28
|
-
}]);
|
|
29
|
-
});
|
|
30
|
-
describe('get mismatches', function () {
|
|
31
|
-
it('simple deletion', function () {
|
|
32
|
-
// simple deletion
|
|
33
|
-
expect((0, _MismatchParser.getMismatches)('56M1D45M', '56^A45', seq)).toEqual([{
|
|
34
|
-
start: 56,
|
|
35
|
-
type: 'deletion',
|
|
36
|
-
base: '*',
|
|
37
|
-
length: 1
|
|
38
|
-
}]);
|
|
39
|
-
});
|
|
40
|
-
it('simple insertion', function () {
|
|
41
|
-
// simple insertion
|
|
42
|
-
expect((0, _MismatchParser.getMismatches)('89M1I11M', '100', 'AAAAAAAAAACAAAAAAAAAAAAAACCCCCCCCCCCCCCCCCCCCCCCCCGGGGGGGGGGGGGGGGGGGGGGGGGTTTTTTTTTTTTTTTTTTTTTTTTTA')).toEqual([{
|
|
43
|
-
start: 89,
|
|
44
|
-
type: 'insertion',
|
|
45
|
-
base: '1',
|
|
46
|
-
length: 0
|
|
47
|
-
}]);
|
|
48
|
-
});
|
|
49
|
-
it('deletion and a SNP', function () {
|
|
50
|
-
// contains a deletion and a SNP
|
|
51
|
-
// read GGGGG--ATTTTTT
|
|
52
|
-
// ||||| ||||||
|
|
53
|
-
// GGGGGACCTTTTTT
|
|
54
|
-
expect((0, _MismatchParser.getMismatches)('5M2D6M', '5^AC0C5', 'GGGGGATTTTTT')).toEqual([{
|
|
55
|
-
start: 5,
|
|
56
|
-
type: 'deletion',
|
|
57
|
-
base: '*',
|
|
58
|
-
length: 2
|
|
59
|
-
}, {
|
|
60
|
-
start: 7,
|
|
61
|
-
type: 'mismatch',
|
|
62
|
-
base: 'A',
|
|
63
|
-
altbase: 'C',
|
|
64
|
-
length: 1
|
|
65
|
-
}]);
|
|
66
|
-
});
|
|
67
|
-
it('0-length MD entries', function () {
|
|
68
|
-
// 0-length MD entries, which indicates two SNPs right next to each other
|
|
69
|
-
// "They generally occur between SNPs, or between a deletion then a SNP."
|
|
70
|
-
// http://seqanswers.com/forums/showthread.php?t=8978
|
|
71
|
-
//
|
|
72
|
-
// read GGGGGCATTTTT
|
|
73
|
-
// ||||| |||||
|
|
74
|
-
// ref GGGGGACTTTTT
|
|
75
|
-
expect((0, _MismatchParser.getMismatches)('12M', '5A0C5', 'GGGGGCATTTTT')).toEqual([{
|
|
76
|
-
altbase: 'A',
|
|
77
|
-
base: 'C',
|
|
78
|
-
length: 1,
|
|
79
|
-
start: 5,
|
|
80
|
-
type: 'mismatch'
|
|
81
|
-
}, {
|
|
82
|
-
altbase: 'C',
|
|
83
|
-
base: 'A',
|
|
84
|
-
length: 1,
|
|
85
|
-
start: 6,
|
|
86
|
-
type: 'mismatch'
|
|
87
|
-
}]);
|
|
88
|
-
});
|
|
89
|
-
it('non-0-length-MD string', function () {
|
|
90
|
-
// same as above but with the non-0-length MD string
|
|
91
|
-
// not sure if it is entirely legal, but may appear in the wild
|
|
92
|
-
expect((0, _MismatchParser.getMismatches)('12M', '5AC5', 'GGGGGCATTTTT')).toEqual([{
|
|
93
|
-
altbase: 'A',
|
|
94
|
-
base: 'C',
|
|
95
|
-
length: 1,
|
|
96
|
-
start: 5,
|
|
97
|
-
type: 'mismatch'
|
|
98
|
-
}, {
|
|
99
|
-
altbase: 'C',
|
|
100
|
-
base: 'A',
|
|
101
|
-
length: 1,
|
|
102
|
-
start: 6,
|
|
103
|
-
type: 'mismatch'
|
|
104
|
-
}]);
|
|
105
|
-
});
|
|
106
|
-
});
|
|
107
|
-
test('basic skip', function () {
|
|
108
|
-
expect((0, _MismatchParser.getMismatches)('6M200N6M', '5AC5', 'GGGGGCATTTTT')).toEqual([{
|
|
109
|
-
base: 'N',
|
|
110
|
-
length: 200,
|
|
111
|
-
start: 6,
|
|
112
|
-
type: 'skip'
|
|
113
|
-
}, {
|
|
114
|
-
altbase: 'A',
|
|
115
|
-
base: 'C',
|
|
116
|
-
length: 1,
|
|
117
|
-
start: 5,
|
|
118
|
-
type: 'mismatch'
|
|
119
|
-
}, {
|
|
120
|
-
altbase: 'C',
|
|
121
|
-
base: 'A',
|
|
122
|
-
length: 1,
|
|
123
|
-
start: 206,
|
|
124
|
-
type: 'mismatch'
|
|
125
|
-
}]);
|
|
126
|
-
});
|
|
127
|
-
test('vsbuffalo', function () {
|
|
128
|
-
// https://github.com/vsbuffalo/devnotes/wiki/The-MD-Tag-in-BAM-Files
|
|
129
|
-
// example 1
|
|
130
|
-
expect((0, _MismatchParser.getMismatches)('89M1I11M', '100', 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA')).toEqual([{
|
|
131
|
-
base: '1',
|
|
132
|
-
length: 0,
|
|
133
|
-
start: 89,
|
|
134
|
-
type: 'insertion'
|
|
135
|
-
}]); // https://github.com/vsbuffalo/devnotes/wiki/The-MD-Tag-in-BAM-Files
|
|
136
|
-
// example 2
|
|
137
|
-
|
|
138
|
-
expect((0, _MismatchParser.getMismatches)('9M1I91M', '48T42G8', 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA')).toEqual([{
|
|
139
|
-
base: '1',
|
|
140
|
-
length: 0,
|
|
141
|
-
start: 9,
|
|
142
|
-
type: 'insertion'
|
|
143
|
-
}, {
|
|
144
|
-
altbase: 'T',
|
|
145
|
-
base: 'A',
|
|
146
|
-
length: 1,
|
|
147
|
-
start: 48,
|
|
148
|
-
type: 'mismatch'
|
|
149
|
-
}, {
|
|
150
|
-
altbase: 'G',
|
|
151
|
-
base: 'A',
|
|
152
|
-
length: 1,
|
|
153
|
-
start: 91,
|
|
154
|
-
type: 'mismatch'
|
|
155
|
-
}]);
|
|
156
|
-
});
|
|
157
|
-
test('more skip', function () {
|
|
158
|
-
expect((0, _MismatchParser.getMismatches)('3M200N3M200N3M', '8A', 'GGGGGCATTTTT')).toEqual([{
|
|
159
|
-
base: 'N',
|
|
160
|
-
length: 200,
|
|
161
|
-
start: 3,
|
|
162
|
-
type: 'skip'
|
|
163
|
-
}, {
|
|
164
|
-
base: 'N',
|
|
165
|
-
length: 200,
|
|
166
|
-
start: 206,
|
|
167
|
-
type: 'skip'
|
|
168
|
-
}, {
|
|
169
|
-
altbase: 'A',
|
|
170
|
-
base: 'T',
|
|
171
|
-
length: 1,
|
|
172
|
-
start: 408,
|
|
173
|
-
type: 'mismatch'
|
|
174
|
-
}]);
|
|
175
|
-
expect((0, _MismatchParser.getMismatches)('31M1I17M1D37M', '6G4C20G1A5C5A1^C3A15G1G15', seq).sort(function (a, b) {
|
|
176
|
-
return a.start - b.start;
|
|
177
|
-
})).toMatchInlineSnapshot("\n Array [\n Object {\n \"altbase\": \"G\",\n \"base\": \"A\",\n \"length\": 1,\n \"start\": 6,\n \"type\": \"mismatch\",\n },\n Object {\n \"altbase\": \"C\",\n \"base\": \"A\",\n \"length\": 1,\n \"start\": 11,\n \"type\": \"mismatch\",\n },\n Object {\n \"base\": \"1\",\n \"length\": 0,\n \"start\": 31,\n \"type\": \"insertion\",\n },\n Object {\n \"altbase\": \"G\",\n \"base\": \"C\",\n \"length\": 1,\n \"start\": 32,\n \"type\": \"mismatch\",\n },\n Object {\n \"altbase\": \"A\",\n \"base\": \"C\",\n \"length\": 1,\n \"start\": 34,\n \"type\": \"mismatch\",\n },\n Object {\n \"altbase\": \"C\",\n \"base\": \"C\",\n \"length\": 1,\n \"start\": 40,\n \"type\": \"mismatch\",\n },\n Object {\n \"altbase\": \"A\",\n \"base\": \"C\",\n \"length\": 1,\n \"start\": 46,\n \"type\": \"mismatch\",\n },\n Object {\n \"base\": \"*\",\n \"length\": 1,\n \"start\": 48,\n \"type\": \"deletion\",\n },\n Object {\n \"altbase\": \"A\",\n \"base\": \"G\",\n \"length\": 1,\n \"start\": 52,\n \"type\": \"mismatch\",\n },\n Object {\n \"altbase\": \"G\",\n \"base\": \"G\",\n \"length\": 1,\n \"start\": 68,\n \"type\": \"mismatch\",\n },\n Object {\n \"altbase\": \"G\",\n \"base\": \"G\",\n \"length\": 1,\n \"start\": 70,\n \"type\": \"mismatch\",\n },\n ]\n ");
|
|
178
|
-
});
|
|
179
|
-
test('clipping', function () {
|
|
180
|
-
expect((0, _MismatchParser.getMismatches)('200H10M200H', '9A', 'AAAAAAAAAC')).toEqual([{
|
|
181
|
-
cliplen: 200,
|
|
182
|
-
base: 'H200',
|
|
183
|
-
length: 1,
|
|
184
|
-
start: 0,
|
|
185
|
-
type: 'hardclip'
|
|
186
|
-
}, {
|
|
187
|
-
cliplen: 200,
|
|
188
|
-
base: 'H200',
|
|
189
|
-
length: 1,
|
|
190
|
-
start: 10,
|
|
191
|
-
type: 'hardclip'
|
|
192
|
-
}, {
|
|
193
|
-
altbase: 'A',
|
|
194
|
-
base: 'C',
|
|
195
|
-
length: 1,
|
|
196
|
-
start: 9,
|
|
197
|
-
type: 'mismatch'
|
|
198
|
-
}]);
|
|
199
|
-
expect((0, _MismatchParser.getMismatches)('10S10M10S', '9A', 'AAAAAAAAAAGGGGGGGGGC')).toEqual([{
|
|
200
|
-
cliplen: 10,
|
|
201
|
-
base: 'S10',
|
|
202
|
-
length: 1,
|
|
203
|
-
start: 0,
|
|
204
|
-
type: 'softclip'
|
|
205
|
-
}, {
|
|
206
|
-
cliplen: 10,
|
|
207
|
-
base: 'S10',
|
|
208
|
-
length: 1,
|
|
209
|
-
start: 10,
|
|
210
|
-
type: 'softclip'
|
|
211
|
-
}, {
|
|
212
|
-
altbase: 'A',
|
|
213
|
-
base: 'C',
|
|
214
|
-
length: 1,
|
|
215
|
-
start: 9,
|
|
216
|
-
type: 'mismatch'
|
|
217
|
-
}]);
|
|
218
|
-
});
|
|
219
|
-
test('getNextRefPos test 1', function () {
|
|
220
|
-
var cigar = (0, _MismatchParser.parseCigar)('10S10M1I4M1D15M');
|
|
221
|
-
var iter = (0, _MismatchParser.getNextRefPos)(cigar, [5, 10, 15, 20, 25, 30, 35]);
|
|
222
|
-
expect((0, _toConsumableArray2.default)(iter)).toEqual([0, 5, 15, 20, 25]);
|
|
223
|
-
});
|
|
224
|
-
test('getNextRefPos test 2', function () {
|
|
225
|
-
var cigar = (0, _MismatchParser.parseCigar)('10S15M');
|
|
226
|
-
var iter = (0, _MismatchParser.getNextRefPos)(cigar, [5, 10, 15]);
|
|
227
|
-
expect((0, _toConsumableArray2.default)(iter)).toEqual([0, 5]);
|
|
228
|
-
});
|
|
229
|
-
test('getModificationPositions', function () {
|
|
230
|
-
var positions = (0, _MismatchParser.getModificationPositions)('C+m,2,2,1,4,1', 'AGCTCTCCAGAGTCGNACGCCATYCGCGCGCCACCA', 1);
|
|
231
|
-
expect(positions[0]).toEqual({
|
|
232
|
-
type: 'm',
|
|
233
|
-
positions: [6, 17, 20, 31, 34]
|
|
234
|
-
});
|
|
235
|
-
}); // ? means "modification status of the skipped bases provided."
|
|
236
|
-
|
|
237
|
-
test('getModificationPositions with unknown (?)', function () {
|
|
238
|
-
var positions = (0, _MismatchParser.getModificationPositions)('C+m?,2,2,1,4,1', 'AGCTCTCCAGAGTCGNACGCCATYCGCGCGCCACCA', 1);
|
|
239
|
-
expect(positions[0]).toEqual({
|
|
240
|
-
type: 'm',
|
|
241
|
-
positions: [6, 17, 20, 31, 34]
|
|
242
|
-
});
|
|
243
|
-
}); // . means "modification status of the skipped bases is low probability"
|
|
244
|
-
|
|
245
|
-
test('getModificationPositions with unknown (.)', function () {
|
|
246
|
-
var positions = (0, _MismatchParser.getModificationPositions)('C+m.,2,2,1,4,1', 'AGCTCTCCAGAGTCGNACGCCATYCGCGCGCCACCA', 1);
|
|
247
|
-
expect(positions[0]).toEqual({
|
|
248
|
-
type: 'm',
|
|
249
|
-
positions: [6, 17, 20, 31, 34]
|
|
250
|
-
});
|
|
251
|
-
});
|