@jbrowse/plugin-alignments 2.4.1 → 2.5.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.d.ts +4 -5
- package/dist/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js +88 -126
- package/dist/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js.map +1 -1
- package/dist/AlignmentsFeatureDetail/AlignmentsFeatureFlags.d.ts +5 -0
- package/dist/AlignmentsFeatureDetail/AlignmentsFeatureFlags.js +44 -0
- package/dist/AlignmentsFeatureDetail/AlignmentsFeatureFlags.js.map +1 -0
- package/dist/AlignmentsFeatureDetail/AlignmentsFeatureSuppAligns.d.ts +5 -0
- package/dist/AlignmentsFeatureDetail/AlignmentsFeatureSuppAligns.js +37 -0
- package/dist/AlignmentsFeatureDetail/AlignmentsFeatureSuppAligns.js.map +1 -0
- package/dist/AlignmentsFeatureDetail/index.d.ts +5 -2
- package/dist/AlignmentsFeatureDetail/util.d.ts +8 -0
- package/dist/AlignmentsFeatureDetail/util.js +27 -0
- package/dist/AlignmentsFeatureDetail/util.js.map +1 -0
- package/dist/AlignmentsTrack/configSchemaF.d.ts +74 -0
- package/dist/AlignmentsTrack/configSchemaF.js +19 -0
- package/dist/AlignmentsTrack/configSchemaF.js.map +1 -0
- package/dist/AlignmentsTrack/index.js +2 -15
- package/dist/AlignmentsTrack/index.js.map +1 -1
- package/dist/BamAdapter/BamAdapter.d.ts +1 -1
- package/dist/BamAdapter/BamAdapter.js +2 -2
- package/dist/BamAdapter/BamAdapter.js.map +1 -1
- package/dist/BamAdapter/configSchema.d.ts +50 -1
- package/dist/CramAdapter/CramAdapter.d.ts +1 -1
- package/dist/CramAdapter/CramAdapter.js +1 -1
- package/dist/CramAdapter/CramAdapter.js.map +1 -1
- package/dist/CramAdapter/CramTestAdapters.js +2 -2
- package/dist/CramAdapter/CramTestAdapters.js.map +1 -1
- package/dist/CramAdapter/configSchema.d.ts +40 -1
- package/dist/HtsgetBamAdapter/configSchema.d.ts +26 -1
- package/dist/LinearAlignmentsDisplay/components/AlignmentsDisplay.d.ts +0 -1
- package/dist/LinearAlignmentsDisplay/components/AlignmentsDisplay.js +2 -2
- package/dist/LinearAlignmentsDisplay/components/AlignmentsDisplay.js.map +1 -1
- package/dist/LinearAlignmentsDisplay/models/configSchema.d.ts +39 -1
- package/dist/LinearAlignmentsDisplay/models/model.d.ts +8 -4
- package/dist/LinearAlignmentsDisplay/models/model.js +7 -3
- package/dist/LinearAlignmentsDisplay/models/model.js.map +1 -1
- package/dist/LinearPileupDisplay/components/ColorByModifications.d.ts +0 -1
- package/dist/LinearPileupDisplay/components/ColorByTag.d.ts +0 -1
- package/dist/LinearPileupDisplay/components/LinearPileupDisplayBlurb.d.ts +0 -1
- package/dist/LinearPileupDisplay/components/SetFeatureHeight.d.ts +0 -1
- package/dist/LinearPileupDisplay/components/SetMaxHeight.d.ts +0 -1
- package/dist/LinearPileupDisplay/components/SetMaxHeight.js +3 -5
- package/dist/LinearPileupDisplay/components/SetMaxHeight.js.map +1 -1
- package/dist/LinearPileupDisplay/components/SortByTag.d.ts +0 -1
- package/dist/LinearPileupDisplay/configSchema.d.ts +57 -1
- package/dist/LinearPileupDisplay/model.d.ts +109 -51
- package/dist/LinearPileupDisplay/model.js +21 -24
- package/dist/LinearPileupDisplay/model.js.map +1 -1
- package/dist/LinearReadArcsDisplay/components/ReactComponent.d.ts +0 -1
- package/dist/LinearReadArcsDisplay/configSchema.d.ts +62 -1
- package/dist/LinearReadArcsDisplay/drawFeats.js +2 -2
- package/dist/LinearReadArcsDisplay/drawFeats.js.map +1 -1
- package/dist/LinearReadArcsDisplay/model.d.ts +82 -33
- package/dist/LinearReadCloudDisplay/components/ReactComponent.d.ts +0 -1
- package/dist/LinearReadCloudDisplay/configSchema.d.ts +50 -1
- package/dist/LinearReadCloudDisplay/drawFeats.d.ts +2 -0
- package/dist/LinearReadCloudDisplay/drawFeats.js +4 -4
- package/dist/LinearReadCloudDisplay/drawFeats.js.map +1 -1
- package/dist/LinearReadCloudDisplay/model.d.ts +69 -30
- package/dist/LinearSNPCoverageDisplay/components/Tooltip.d.ts +0 -1
- package/dist/LinearSNPCoverageDisplay/models/configSchema.d.ts +79 -1
- package/dist/LinearSNPCoverageDisplay/models/model.d.ts +52 -27
- package/dist/LinearSNPCoverageDisplay/models/model.js +1 -1
- package/dist/LinearSNPCoverageDisplay/models/model.js.map +1 -1
- package/dist/MismatchParser/index.js +2 -2
- package/dist/MismatchParser/index.js.map +1 -1
- package/dist/PileupRenderer/PileupLayoutSession.d.ts +1 -1
- package/dist/PileupRenderer/PileupRenderer.d.ts +1 -1
- package/dist/PileupRenderer/PileupRenderer.js +10 -1
- package/dist/PileupRenderer/PileupRenderer.js.map +1 -1
- package/dist/PileupRenderer/configSchema.d.ts +87 -1
- package/dist/SNPCoverageAdapter/SNPCoverageAdapter.d.ts +1 -1
- package/dist/SNPCoverageAdapter/SNPCoverageAdapter.js +2 -2
- package/dist/SNPCoverageAdapter/SNPCoverageAdapter.js.map +1 -1
- package/dist/SNPCoverageAdapter/configSchema.d.ts +10 -1
- package/dist/SNPCoverageAdapter/generateCoverageBins.js +50 -46
- package/dist/SNPCoverageAdapter/generateCoverageBins.js.map +1 -1
- package/dist/SNPCoverageRenderer/SNPCoverageRenderer.js +1 -1
- package/dist/SNPCoverageRenderer/SNPCoverageRenderer.js.map +1 -1
- package/dist/SNPCoverageRenderer/configSchema.d.ts +42 -1
- package/dist/shared/FilterByTag.d.ts +0 -1
- package/esm/AlignmentsFeatureDetail/AlignmentsFeatureDetail.d.ts +4 -5
- package/esm/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js +88 -126
- package/esm/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js.map +1 -1
- package/esm/AlignmentsFeatureDetail/AlignmentsFeatureFlags.d.ts +5 -0
- package/esm/AlignmentsFeatureDetail/AlignmentsFeatureFlags.js +38 -0
- package/esm/AlignmentsFeatureDetail/AlignmentsFeatureFlags.js.map +1 -0
- package/esm/AlignmentsFeatureDetail/AlignmentsFeatureSuppAligns.d.ts +5 -0
- package/esm/AlignmentsFeatureDetail/AlignmentsFeatureSuppAligns.js +31 -0
- package/esm/AlignmentsFeatureDetail/AlignmentsFeatureSuppAligns.js.map +1 -0
- package/esm/AlignmentsFeatureDetail/index.d.ts +5 -2
- package/esm/AlignmentsFeatureDetail/util.d.ts +8 -0
- package/esm/AlignmentsFeatureDetail/util.js +22 -0
- package/esm/AlignmentsFeatureDetail/util.js.map +1 -0
- package/esm/AlignmentsTrack/configSchemaF.d.ts +74 -0
- package/esm/AlignmentsTrack/configSchemaF.js +16 -0
- package/esm/AlignmentsTrack/configSchemaF.js.map +1 -0
- package/esm/AlignmentsTrack/index.js +3 -16
- package/esm/AlignmentsTrack/index.js.map +1 -1
- package/esm/BamAdapter/BamAdapter.d.ts +1 -1
- package/esm/BamAdapter/BamAdapter.js +2 -2
- package/esm/BamAdapter/BamAdapter.js.map +1 -1
- package/esm/BamAdapter/configSchema.d.ts +50 -1
- package/esm/CramAdapter/CramAdapter.d.ts +1 -1
- package/esm/CramAdapter/CramAdapter.js +1 -1
- package/esm/CramAdapter/CramAdapter.js.map +1 -1
- package/esm/CramAdapter/CramTestAdapters.js +1 -1
- package/esm/CramAdapter/CramTestAdapters.js.map +1 -1
- package/esm/CramAdapter/configSchema.d.ts +40 -1
- package/esm/HtsgetBamAdapter/configSchema.d.ts +26 -1
- package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.d.ts +0 -1
- package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.js +2 -2
- package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.js.map +1 -1
- package/esm/LinearAlignmentsDisplay/models/configSchema.d.ts +39 -1
- package/esm/LinearAlignmentsDisplay/models/model.d.ts +8 -4
- package/esm/LinearAlignmentsDisplay/models/model.js +7 -3
- package/esm/LinearAlignmentsDisplay/models/model.js.map +1 -1
- package/esm/LinearPileupDisplay/components/ColorByModifications.d.ts +0 -1
- package/esm/LinearPileupDisplay/components/ColorByTag.d.ts +0 -1
- package/esm/LinearPileupDisplay/components/LinearPileupDisplayBlurb.d.ts +0 -1
- package/esm/LinearPileupDisplay/components/SetFeatureHeight.d.ts +0 -1
- package/esm/LinearPileupDisplay/components/SetMaxHeight.d.ts +0 -1
- package/esm/LinearPileupDisplay/components/SetMaxHeight.js +3 -5
- package/esm/LinearPileupDisplay/components/SetMaxHeight.js.map +1 -1
- package/esm/LinearPileupDisplay/components/SortByTag.d.ts +0 -1
- package/esm/LinearPileupDisplay/configSchema.d.ts +57 -1
- package/esm/LinearPileupDisplay/model.d.ts +109 -51
- package/esm/LinearPileupDisplay/model.js +21 -24
- package/esm/LinearPileupDisplay/model.js.map +1 -1
- package/esm/LinearReadArcsDisplay/components/ReactComponent.d.ts +0 -1
- package/esm/LinearReadArcsDisplay/configSchema.d.ts +62 -1
- package/esm/LinearReadArcsDisplay/drawFeats.js +2 -2
- package/esm/LinearReadArcsDisplay/drawFeats.js.map +1 -1
- package/esm/LinearReadArcsDisplay/model.d.ts +82 -33
- package/esm/LinearReadCloudDisplay/components/ReactComponent.d.ts +0 -1
- package/esm/LinearReadCloudDisplay/configSchema.d.ts +50 -1
- package/esm/LinearReadCloudDisplay/drawFeats.d.ts +2 -0
- package/esm/LinearReadCloudDisplay/drawFeats.js +4 -4
- package/esm/LinearReadCloudDisplay/drawFeats.js.map +1 -1
- package/esm/LinearReadCloudDisplay/model.d.ts +69 -30
- package/esm/LinearSNPCoverageDisplay/components/Tooltip.d.ts +0 -1
- package/esm/LinearSNPCoverageDisplay/models/configSchema.d.ts +79 -1
- package/esm/LinearSNPCoverageDisplay/models/model.d.ts +52 -27
- package/esm/LinearSNPCoverageDisplay/models/model.js +1 -1
- package/esm/LinearSNPCoverageDisplay/models/model.js.map +1 -1
- package/esm/MismatchParser/index.js +2 -2
- package/esm/MismatchParser/index.js.map +1 -1
- package/esm/PileupRenderer/PileupLayoutSession.d.ts +1 -1
- package/esm/PileupRenderer/PileupRenderer.d.ts +1 -1
- package/esm/PileupRenderer/PileupRenderer.js +10 -1
- package/esm/PileupRenderer/PileupRenderer.js.map +1 -1
- package/esm/PileupRenderer/configSchema.d.ts +87 -1
- package/esm/SNPCoverageAdapter/SNPCoverageAdapter.d.ts +1 -1
- package/esm/SNPCoverageAdapter/SNPCoverageAdapter.js +2 -2
- package/esm/SNPCoverageAdapter/SNPCoverageAdapter.js.map +1 -1
- package/esm/SNPCoverageAdapter/configSchema.d.ts +10 -1
- package/esm/SNPCoverageAdapter/generateCoverageBins.js +50 -46
- package/esm/SNPCoverageAdapter/generateCoverageBins.js.map +1 -1
- package/esm/SNPCoverageRenderer/SNPCoverageRenderer.js +1 -1
- package/esm/SNPCoverageRenderer/SNPCoverageRenderer.js.map +1 -1
- package/esm/SNPCoverageRenderer/configSchema.d.ts +42 -1
- package/esm/shared/FilterByTag.d.ts +0 -1
- package/package.json +2 -2
- package/src/AlignmentsFeatureDetail/AlignmentsFeatureDetail.tsx +109 -183
- package/src/AlignmentsFeatureDetail/AlignmentsFeatureFlags.tsx +62 -0
- package/src/AlignmentsFeatureDetail/AlignmentsFeatureSuppAligns.tsx +51 -0
- package/src/AlignmentsFeatureDetail/__snapshots__/index.test.tsx.snap +4 -4
- package/src/AlignmentsFeatureDetail/util.ts +27 -0
- package/src/AlignmentsTrack/configSchemaF.ts +22 -0
- package/src/AlignmentsTrack/index.ts +3 -24
- package/src/BamAdapter/BamAdapter.ts +5 -2
- package/src/CramAdapter/CramAdapter.ts +4 -1
- package/src/CramAdapter/CramTestAdapters.ts +1 -1
- package/src/LinearAlignmentsDisplay/components/AlignmentsDisplay.tsx +2 -2
- package/src/LinearAlignmentsDisplay/models/model.tsx +11 -3
- package/src/LinearPileupDisplay/components/SetMaxHeight.tsx +3 -5
- package/src/LinearPileupDisplay/model.ts +38 -36
- package/src/LinearReadArcsDisplay/drawFeats.ts +2 -2
- package/src/LinearReadCloudDisplay/drawFeats.ts +6 -5
- package/src/LinearSNPCoverageDisplay/models/model.ts +1 -1
- package/src/MismatchParser/index.ts +2 -2
- package/src/PileupRenderer/PileupLayoutSession.ts +1 -1
- package/src/PileupRenderer/PileupRenderer.ts +15 -6
- package/src/SNPCoverageAdapter/SNPCoverageAdapter.ts +5 -2
- package/src/SNPCoverageAdapter/generateCoverageBins.ts +58 -55
- package/src/SNPCoverageRenderer/SNPCoverageRenderer.ts +1 -1
- package/dist/NestedFrequencyTable.d.ts +0 -14
- package/dist/NestedFrequencyTable.js +0 -94
- package/dist/NestedFrequencyTable.js.map +0 -1
- package/esm/NestedFrequencyTable.d.ts +0 -14
- package/esm/NestedFrequencyTable.js +0 -91
- package/esm/NestedFrequencyTable.js.map +0 -1
- package/src/NestedFrequencyTable.ts +0 -113
|
@@ -1,196 +1,121 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
|
-
import {
|
|
3
|
-
Typography,
|
|
4
|
-
Link,
|
|
5
|
-
Paper,
|
|
6
|
-
Checkbox,
|
|
7
|
-
FormControlLabel,
|
|
8
|
-
FormGroup,
|
|
9
|
-
} from '@mui/material'
|
|
10
|
-
import { makeStyles } from 'tss-react/mui'
|
|
2
|
+
import { Link, Paper } from '@mui/material'
|
|
11
3
|
import { observer } from 'mobx-react'
|
|
12
|
-
import { getSession } from '@jbrowse/core/util'
|
|
13
4
|
import copy from 'copy-to-clipboard'
|
|
14
5
|
import clone from 'clone'
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
BaseCard,
|
|
18
|
-
SimpleValue,
|
|
19
|
-
} from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail'
|
|
20
|
-
import { parseCigar } from '../MismatchParser'
|
|
6
|
+
import { FeatureDetails } from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail'
|
|
7
|
+
import { IAnyStateTreeNode } from 'mobx-state-tree'
|
|
21
8
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
paddingBottom: 0,
|
|
27
|
-
},
|
|
28
|
-
})
|
|
9
|
+
// locals
|
|
10
|
+
import { getTag, navToLoc } from './util'
|
|
11
|
+
import SupplementaryAlignments from './AlignmentsFeatureSuppAligns'
|
|
12
|
+
import AlignmentFlags from './AlignmentsFeatureFlags'
|
|
29
13
|
|
|
30
14
|
const omit = ['clipPos', 'flags']
|
|
31
15
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
16
|
+
const tags = {
|
|
17
|
+
AM: 'The smallest template-independent mapping quality in the template',
|
|
18
|
+
AS: 'Alignment score generated by aligner',
|
|
19
|
+
BC: 'Barcode sequence identifying the sample',
|
|
20
|
+
BQ: 'Offset to base alignment quality (BAQ)',
|
|
21
|
+
BZ: 'Phred quality of the unique molecular barcode bases in the {OX} tag',
|
|
22
|
+
CB: 'Cell identifier',
|
|
23
|
+
CC: 'Reference name of the next hit',
|
|
24
|
+
CM: 'Edit distance between the color sequence and the color reference (see also {NM})',
|
|
25
|
+
CO: 'Free-text comments',
|
|
26
|
+
CP: 'Leftmost coordinate of the next hit',
|
|
27
|
+
CQ: 'Color read base qualities',
|
|
28
|
+
CR: 'Cellular barcode sequence bases (uncorrected)',
|
|
29
|
+
CS: 'Color read sequence',
|
|
30
|
+
CT: 'Complete read annotation tag, used for consensus annotation dummy features',
|
|
31
|
+
CY: 'Phred quality of the cellular barcode sequence in the {CR} tag',
|
|
32
|
+
E2: 'The 2nd most likely base calls',
|
|
33
|
+
FI: 'The index of segment in the template',
|
|
34
|
+
FS: 'Segment suffix',
|
|
35
|
+
FZ: 'Flow signal intensities',
|
|
36
|
+
GC: 'Reserved for backwards compatibility reasons',
|
|
37
|
+
GQ: 'Reserved for backwards compatibility reasons',
|
|
38
|
+
GS: 'Reserved for backwards compatibility reasons',
|
|
39
|
+
H0: 'Number of perfect hits',
|
|
40
|
+
H1: 'Number of 1-difference hits (see also {NM})',
|
|
41
|
+
H2: 'Number of 2-difference hits',
|
|
42
|
+
HI: 'Query hit index',
|
|
43
|
+
IH: 'Query hit total count',
|
|
44
|
+
LB: 'Library',
|
|
45
|
+
MC: 'CIGAR string for mate/next segment',
|
|
46
|
+
MD: 'String encoding mismatched and deleted reference bases',
|
|
47
|
+
MF: 'Reserved for backwards compatibility reasons',
|
|
48
|
+
MI: 'Molecular identifier; a string that uniquely identifies the molecule from which the record was derived',
|
|
49
|
+
ML: 'Base modification probabilities',
|
|
50
|
+
MM: 'Base modifications / methylation ',
|
|
51
|
+
MQ: 'Mapping quality of the mate/next segment',
|
|
52
|
+
NH: 'Number of reported alignments that contain the query in the current record',
|
|
53
|
+
NM: 'Edit distance to the reference',
|
|
54
|
+
OA: 'Original alignment',
|
|
55
|
+
OC: 'Original CIGAR (deprecated; use {OA} instead)',
|
|
56
|
+
OP: 'Original mapping position (deprecated; use {OA} instead)',
|
|
57
|
+
OQ: 'Original base quality',
|
|
58
|
+
OX: 'Original unique molecular barcode bases',
|
|
59
|
+
PG: 'Program',
|
|
60
|
+
PQ: 'Phred likelihood of the template',
|
|
61
|
+
PT: 'Read annotations for parts of the padded read sequence',
|
|
62
|
+
PU: 'Platform unit',
|
|
63
|
+
Q2: 'Phred quality of the mate/next segment sequence in the {R2} tag',
|
|
64
|
+
QT: 'Phred quality of the sample barcode sequence in the {BC} tag',
|
|
65
|
+
QX: 'Quality score of the unique molecular identifier in the {RX} tag',
|
|
66
|
+
R2: 'Sequence of the mate/next segment in the template',
|
|
67
|
+
RG: 'Read group',
|
|
68
|
+
RT: 'Reserved for backwards compatibility reasons',
|
|
69
|
+
RX: 'Sequence bases of the (possibly corrected) unique molecular identifier',
|
|
70
|
+
S2: 'Reserved for backwards compatibility reasons',
|
|
71
|
+
SA: 'Other canonical alignments in a chimeric alignment',
|
|
72
|
+
SM: 'Template-independent mapping quality',
|
|
73
|
+
SQ: 'Reserved for backwards compatibility reasons',
|
|
74
|
+
TC: 'The number of segments in the template',
|
|
75
|
+
TS: 'Transcript strand',
|
|
76
|
+
U2: 'Phred probability of the 2nd call being wrong conditional on the best being wrong',
|
|
77
|
+
UQ: 'Phred likelihood of the segment, conditional on the mapping being correct',
|
|
77
78
|
}
|
|
78
79
|
|
|
79
80
|
function Formatter({ value }: { value: unknown }) {
|
|
80
81
|
const [show, setShow] = useState(false)
|
|
81
82
|
const [copied, setCopied] = useState(false)
|
|
82
83
|
const display = String(value)
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
</>
|
|
103
|
-
)
|
|
104
|
-
}
|
|
105
|
-
return <div>{display}</div>
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
// utility function to get length of alignment from cigar
|
|
109
|
-
function getLengthOnRef(cigar: string) {
|
|
110
|
-
const cigarOps = parseCigar(cigar)
|
|
111
|
-
let lengthOnRef = 0
|
|
112
|
-
for (let i = 0; i < cigarOps.length; i += 2) {
|
|
113
|
-
const len = +cigarOps[i]
|
|
114
|
-
const op = cigarOps[i + 1]
|
|
115
|
-
if (op !== 'H' && op !== 'S' && op !== 'I') {
|
|
116
|
-
lengthOnRef += len
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
return lengthOnRef
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
123
|
-
function SupplementaryAlignments(props: { tag: string; model: any }) {
|
|
124
|
-
const { tag, model } = props
|
|
125
|
-
const session = getSession(model)
|
|
126
|
-
return (
|
|
127
|
-
<BaseCard {...props} title="Supplementary alignments">
|
|
128
|
-
<Typography>List of supplementary alignment locations</Typography>
|
|
129
|
-
<ul>
|
|
130
|
-
{tag
|
|
131
|
-
.split(';')
|
|
132
|
-
.filter(SA => !!SA)
|
|
133
|
-
.map((SA, index) => {
|
|
134
|
-
const [saRef, saStart, saStrand, saCigar] = SA.split(',')
|
|
135
|
-
const saLength = getLengthOnRef(saCigar)
|
|
136
|
-
const extra = Math.floor(saLength / 5)
|
|
137
|
-
const start = +saStart
|
|
138
|
-
const end = +saStart + saLength
|
|
139
|
-
const locString = `${saRef}:${Math.max(1, start - extra)}-${
|
|
140
|
-
end + extra
|
|
141
|
-
}`
|
|
142
|
-
const displayStart = start.toLocaleString('en-US')
|
|
143
|
-
const displayEnd = end.toLocaleString('en-US')
|
|
144
|
-
const displayString = `${saRef}:${displayStart}-${displayEnd} (${saStrand})`
|
|
145
|
-
return (
|
|
146
|
-
<li key={`${locString}-${index}`}>
|
|
147
|
-
<Link
|
|
148
|
-
onClick={async event => {
|
|
149
|
-
event.preventDefault()
|
|
150
|
-
const { view } = model
|
|
151
|
-
try {
|
|
152
|
-
if (view) {
|
|
153
|
-
await view.navToLocString(locString)
|
|
154
|
-
} else {
|
|
155
|
-
throw new Error(
|
|
156
|
-
'No view associated with this view anymore',
|
|
157
|
-
)
|
|
158
|
-
}
|
|
159
|
-
} catch (e) {
|
|
160
|
-
console.error(e)
|
|
161
|
-
session.notify(`${e}`)
|
|
162
|
-
}
|
|
163
|
-
}}
|
|
164
|
-
href="#"
|
|
165
|
-
>
|
|
166
|
-
{displayString}
|
|
167
|
-
</Link>
|
|
168
|
-
</li>
|
|
169
|
-
)
|
|
170
|
-
})}
|
|
171
|
-
</ul>
|
|
172
|
-
</BaseCard>
|
|
84
|
+
return display.length > 100 ? (
|
|
85
|
+
<>
|
|
86
|
+
<button
|
|
87
|
+
type="button"
|
|
88
|
+
onClick={() => {
|
|
89
|
+
copy(display)
|
|
90
|
+
setCopied(true)
|
|
91
|
+
setTimeout(() => setCopied(false), 700)
|
|
92
|
+
}}
|
|
93
|
+
>
|
|
94
|
+
{copied ? 'Copied to clipboard' : 'Copy'}
|
|
95
|
+
</button>
|
|
96
|
+
<button type="button" onClick={() => setShow(val => !val)}>
|
|
97
|
+
{show ? 'Show less' : 'Show more'}
|
|
98
|
+
</button>
|
|
99
|
+
<div>{show ? display : `${display.slice(0, 100)}...`}</div>
|
|
100
|
+
</>
|
|
101
|
+
) : (
|
|
102
|
+
<div>{display}</div>
|
|
173
103
|
)
|
|
174
104
|
}
|
|
175
105
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
106
|
+
function PairLink({
|
|
107
|
+
locString,
|
|
108
|
+
model,
|
|
109
|
+
}: {
|
|
110
|
+
locString: string
|
|
111
|
+
model: IAnyStateTreeNode
|
|
112
|
+
}) {
|
|
179
113
|
return (
|
|
180
114
|
<Link
|
|
181
|
-
onClick={
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
'No view associated with this feature detail panel anymore',
|
|
186
|
-
)
|
|
187
|
-
}
|
|
188
|
-
try {
|
|
189
|
-
await view.navToLocString(locString)
|
|
190
|
-
} catch (e) {
|
|
191
|
-
console.error(e)
|
|
192
|
-
session.notify(`${e}`)
|
|
193
|
-
}
|
|
115
|
+
onClick={event => {
|
|
116
|
+
event.preventDefault()
|
|
117
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
118
|
+
navToLoc(locString, model)
|
|
194
119
|
}}
|
|
195
120
|
href="#"
|
|
196
121
|
>
|
|
@@ -199,24 +124,27 @@ function PairLink({ locString, model }: { locString: string; model: any }) {
|
|
|
199
124
|
)
|
|
200
125
|
}
|
|
201
126
|
|
|
202
|
-
|
|
203
|
-
|
|
127
|
+
export default observer(function AlignmentFeatureDetails(props: {
|
|
128
|
+
model: IAnyStateTreeNode
|
|
129
|
+
}) {
|
|
204
130
|
const { model } = props
|
|
205
131
|
const feat = clone(model.featureData)
|
|
206
|
-
const SA = (
|
|
132
|
+
const SA = getTag('SA', feat) as string
|
|
207
133
|
return (
|
|
208
134
|
<Paper data-testid="alignment-side-drawer">
|
|
209
135
|
<FeatureDetails
|
|
210
136
|
{...props}
|
|
211
137
|
omit={omit}
|
|
138
|
+
// @ts-expect-error
|
|
139
|
+
descriptions={{ ...tags, tags }}
|
|
212
140
|
feature={feat}
|
|
213
|
-
formatter={(value, key) =>
|
|
214
|
-
|
|
141
|
+
formatter={(value, key) =>
|
|
142
|
+
key === 'next_segment_position' ? (
|
|
215
143
|
<PairLink model={model} locString={value as string} />
|
|
216
144
|
) : (
|
|
217
145
|
<Formatter value={value} />
|
|
218
146
|
)
|
|
219
|
-
}
|
|
147
|
+
}
|
|
220
148
|
/>
|
|
221
149
|
{SA ? <SupplementaryAlignments model={model} tag={SA} /> : null}
|
|
222
150
|
{feat.flags !== undefined ? (
|
|
@@ -224,6 +152,4 @@ function AlignmentFeatureDetails(props: { model: any }) {
|
|
|
224
152
|
) : null}
|
|
225
153
|
</Paper>
|
|
226
154
|
)
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
export default observer(AlignmentFeatureDetails)
|
|
155
|
+
})
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Checkbox, FormControlLabel, FormGroup } from '@mui/material'
|
|
3
|
+
import { makeStyles } from 'tss-react/mui'
|
|
4
|
+
import {
|
|
5
|
+
BaseCard,
|
|
6
|
+
SimpleValue,
|
|
7
|
+
} from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail'
|
|
8
|
+
|
|
9
|
+
const useStyles = makeStyles()({
|
|
10
|
+
compact: {
|
|
11
|
+
paddingRight: 0,
|
|
12
|
+
paddingTop: 0,
|
|
13
|
+
paddingBottom: 0,
|
|
14
|
+
},
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
const flagNames = [
|
|
18
|
+
'read paired',
|
|
19
|
+
'read mapped in proper pair',
|
|
20
|
+
'read unmapped',
|
|
21
|
+
'mate unmapped',
|
|
22
|
+
'read reverse strand',
|
|
23
|
+
'mate reverse strand',
|
|
24
|
+
'first in pair',
|
|
25
|
+
'second in pair',
|
|
26
|
+
'not primary alignment',
|
|
27
|
+
'read fails platform/vendor quality checks',
|
|
28
|
+
'read is PCR or optical duplicate',
|
|
29
|
+
'supplementary alignment',
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
export default function AlignmentFlags(props: { feature: { flags: number } }) {
|
|
33
|
+
const { classes } = useStyles()
|
|
34
|
+
const { feature } = props
|
|
35
|
+
const { flags } = feature
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<BaseCard {...props} title="Flags">
|
|
39
|
+
<SimpleValue name="Flag" value={flags} />
|
|
40
|
+
<FormGroup>
|
|
41
|
+
{flagNames.map((name, idx) => {
|
|
42
|
+
const val = flags & (1 << idx)
|
|
43
|
+
const key = `${name}_${val}`
|
|
44
|
+
return (
|
|
45
|
+
<FormControlLabel
|
|
46
|
+
key={key}
|
|
47
|
+
control={
|
|
48
|
+
<Checkbox
|
|
49
|
+
className={classes.compact}
|
|
50
|
+
checked={Boolean(val)}
|
|
51
|
+
name={name}
|
|
52
|
+
readOnly
|
|
53
|
+
/>
|
|
54
|
+
}
|
|
55
|
+
label={name}
|
|
56
|
+
/>
|
|
57
|
+
)
|
|
58
|
+
})}
|
|
59
|
+
</FormGroup>
|
|
60
|
+
</BaseCard>
|
|
61
|
+
)
|
|
62
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Typography, Link } from '@mui/material'
|
|
3
|
+
import { BaseCard } from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail'
|
|
4
|
+
import { getLengthOnRef } from '../MismatchParser'
|
|
5
|
+
import { IAnyStateTreeNode } from 'mobx-state-tree'
|
|
6
|
+
import { navToLoc } from './util'
|
|
7
|
+
|
|
8
|
+
export default function SupplementaryAlignments(props: {
|
|
9
|
+
tag: string
|
|
10
|
+
model: IAnyStateTreeNode
|
|
11
|
+
}) {
|
|
12
|
+
const { tag, model } = props
|
|
13
|
+
return (
|
|
14
|
+
<BaseCard {...props} title="Supplementary alignments">
|
|
15
|
+
<Typography>List of supplementary alignment locations</Typography>
|
|
16
|
+
<ul>
|
|
17
|
+
{tag
|
|
18
|
+
.split(';')
|
|
19
|
+
.filter(SA => !!SA)
|
|
20
|
+
.map((SA, index) => {
|
|
21
|
+
const [saRef, saStart, saStrand, saCigar] = SA.split(',')
|
|
22
|
+
const saLength = getLengthOnRef(saCigar)
|
|
23
|
+
const extra = Math.floor(saLength / 5)
|
|
24
|
+
const start = +saStart
|
|
25
|
+
const end = +saStart + saLength
|
|
26
|
+
const locString = `${saRef}:${Math.max(1, start - extra)}-${
|
|
27
|
+
end + extra
|
|
28
|
+
}`
|
|
29
|
+
const displayStart = start.toLocaleString('en-US')
|
|
30
|
+
const displayEnd = end.toLocaleString('en-US')
|
|
31
|
+
const displayString = `${saRef}:${displayStart}-${displayEnd} (${saStrand}) [${saLength}bp]`
|
|
32
|
+
return (
|
|
33
|
+
<li key={`${locString}-${index}`}>
|
|
34
|
+
<Link
|
|
35
|
+
onClick={async event => {
|
|
36
|
+
event.preventDefault()
|
|
37
|
+
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
39
|
+
navToLoc(locString, model)
|
|
40
|
+
}}
|
|
41
|
+
href="#"
|
|
42
|
+
>
|
|
43
|
+
{displayString}
|
|
44
|
+
</Link>
|
|
45
|
+
</li>
|
|
46
|
+
)
|
|
47
|
+
})}
|
|
48
|
+
</ul>
|
|
49
|
+
</BaseCard>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
@@ -197,8 +197,9 @@ exports[`open up a widget 1`] = `
|
|
|
197
197
|
class="css-1m8nxnb-field"
|
|
198
198
|
>
|
|
199
199
|
<div
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
aria-label="Mapping quality of the mate/next segment"
|
|
201
|
+
class="css-18vnxxj-fieldDescription-fieldName"
|
|
202
|
+
data-mui-internal-clone-element="true"
|
|
202
203
|
>
|
|
203
204
|
MQ
|
|
204
205
|
</div>
|
|
@@ -279,7 +280,7 @@ exports[`open up a widget 1`] = `
|
|
|
279
280
|
</div>
|
|
280
281
|
</div>
|
|
281
282
|
<div
|
|
282
|
-
class="css-
|
|
283
|
+
class="css-1lttu3w-container"
|
|
283
284
|
>
|
|
284
285
|
<button
|
|
285
286
|
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium css-sghohy-MuiButtonBase-root-MuiButton-root"
|
|
@@ -315,7 +316,6 @@ exports[`open up a widget 1`] = `
|
|
|
315
316
|
/>
|
|
316
317
|
</button>
|
|
317
318
|
</div>
|
|
318
|
-
<br />
|
|
319
319
|
</div>
|
|
320
320
|
</div>
|
|
321
321
|
</div>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { getSession } from '@jbrowse/core/util'
|
|
2
|
+
import { IAnyStateTreeNode } from 'mobx-state-tree'
|
|
3
|
+
|
|
4
|
+
export function getTag(
|
|
5
|
+
tag: string,
|
|
6
|
+
feat: {
|
|
7
|
+
tags?: { [key: string]: unknown }
|
|
8
|
+
[key: string]: unknown
|
|
9
|
+
},
|
|
10
|
+
) {
|
|
11
|
+
return feat.tags?.[tag] || feat[tag]
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export async function navToLoc(locString: string, model: IAnyStateTreeNode) {
|
|
15
|
+
const session = getSession(model)
|
|
16
|
+
const { view } = model
|
|
17
|
+
try {
|
|
18
|
+
if (view) {
|
|
19
|
+
await view.navToLocString(locString)
|
|
20
|
+
} else {
|
|
21
|
+
throw new Error('No view associated with this view anymore')
|
|
22
|
+
}
|
|
23
|
+
} catch (e) {
|
|
24
|
+
console.error(e)
|
|
25
|
+
session.notify(`${e}`)
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ConfigurationSchema } from '@jbrowse/core/configuration'
|
|
2
|
+
import { createBaseTrackConfig } from '@jbrowse/core/pluggableElementTypes'
|
|
3
|
+
import PluginManager from '@jbrowse/core/PluginManager'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* #config AlignmentsTrack
|
|
7
|
+
* has very little config; most config and state logic is on the display
|
|
8
|
+
*/
|
|
9
|
+
function x() {} // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
10
|
+
|
|
11
|
+
export default function configSchemaFactory(pluginManager: PluginManager) {
|
|
12
|
+
return ConfigurationSchema(
|
|
13
|
+
'AlignmentsTrack',
|
|
14
|
+
{},
|
|
15
|
+
{
|
|
16
|
+
/**
|
|
17
|
+
* #baseConfiguration
|
|
18
|
+
*/
|
|
19
|
+
baseConfiguration: createBaseTrackConfig(pluginManager),
|
|
20
|
+
},
|
|
21
|
+
)
|
|
22
|
+
}
|
|
@@ -1,32 +1,11 @@
|
|
|
1
1
|
import PluginManager from '@jbrowse/core/PluginManager'
|
|
2
2
|
import TrackType from '@jbrowse/core/pluggableElementTypes/TrackType'
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
createBaseTrackConfig,
|
|
6
|
-
createBaseTrackModel,
|
|
7
|
-
} from '@jbrowse/core/pluggableElementTypes/models'
|
|
3
|
+
import { createBaseTrackModel } from '@jbrowse/core/pluggableElementTypes/models'
|
|
4
|
+
import configSchemaF from './configSchemaF'
|
|
8
5
|
|
|
9
|
-
/**
|
|
10
|
-
* #config AlignmentsTrack
|
|
11
|
-
* has very little config; most config and state logic is on the display
|
|
12
|
-
*/
|
|
13
|
-
function x() {} // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
14
|
-
|
|
15
|
-
function configSchemaFactory(pluginManager: PluginManager) {
|
|
16
|
-
return ConfigurationSchema(
|
|
17
|
-
'AlignmentsTrack',
|
|
18
|
-
{},
|
|
19
|
-
{
|
|
20
|
-
/**
|
|
21
|
-
* #baseConfiguration
|
|
22
|
-
*/
|
|
23
|
-
baseConfiguration: createBaseTrackConfig(pluginManager),
|
|
24
|
-
},
|
|
25
|
-
)
|
|
26
|
-
}
|
|
27
6
|
export default function register(pm: PluginManager) {
|
|
28
7
|
pm.addTrackType(() => {
|
|
29
|
-
const configSchema =
|
|
8
|
+
const configSchema = configSchemaF(pm)
|
|
30
9
|
const track = new TrackType({
|
|
31
10
|
name: 'AlignmentsTrack',
|
|
32
11
|
displayName: 'Alignments track',
|
|
@@ -227,7 +227,10 @@ export default class BamAdapter extends BaseFeatureDataAdapter {
|
|
|
227
227
|
}, signal)
|
|
228
228
|
}
|
|
229
229
|
|
|
230
|
-
async
|
|
230
|
+
async getMultiRegionFeatureDensityStats(
|
|
231
|
+
regions: Region[],
|
|
232
|
+
opts?: BaseOptions,
|
|
233
|
+
) {
|
|
231
234
|
const { bam } = await this.configure()
|
|
232
235
|
// this is a method to avoid calling on htsget adapters
|
|
233
236
|
// @ts-expect-error
|
|
@@ -236,7 +239,7 @@ export default class BamAdapter extends BaseFeatureDataAdapter {
|
|
|
236
239
|
const fetchSizeLimit = this.getConf('fetchSizeLimit')
|
|
237
240
|
return { bytes, fetchSizeLimit }
|
|
238
241
|
} else {
|
|
239
|
-
return super.
|
|
242
|
+
return super.getMultiRegionFeatureDensityStats(regions, opts)
|
|
240
243
|
}
|
|
241
244
|
}
|
|
242
245
|
|
|
@@ -278,7 +278,10 @@ export default class CramAdapter extends BaseFeatureDataAdapter {
|
|
|
278
278
|
}
|
|
279
279
|
|
|
280
280
|
// we return the configured fetchSizeLimit, and the bytes for the region
|
|
281
|
-
async
|
|
281
|
+
async getMultiRegionFeatureDensityStats(
|
|
282
|
+
regions: Region[],
|
|
283
|
+
opts?: BaseOptions,
|
|
284
|
+
) {
|
|
282
285
|
const bytes = await this.bytesForRegions(regions, opts)
|
|
283
286
|
const fetchSizeLimit = this.getConf('fetchSizeLimit')
|
|
284
287
|
return {
|
|
@@ -2,7 +2,7 @@ import { GenericFilehandle } from 'generic-filehandle'
|
|
|
2
2
|
import { Observable } from 'rxjs'
|
|
3
3
|
import SimpleFeature from '@jbrowse/core/util/simpleFeature'
|
|
4
4
|
import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter'
|
|
5
|
-
import { ConfigurationSchema } from '@jbrowse/core/configuration
|
|
5
|
+
import { ConfigurationSchema } from '@jbrowse/core/configuration'
|
|
6
6
|
|
|
7
7
|
// setup for Cram Adapter Testing
|
|
8
8
|
export function parseSmallFasta(text: string) {
|
|
@@ -9,7 +9,7 @@ import { AlignmentsDisplayModel } from '../models/model'
|
|
|
9
9
|
|
|
10
10
|
const useStyles = makeStyles()({
|
|
11
11
|
resizeHandle: {
|
|
12
|
-
height:
|
|
12
|
+
height: 5,
|
|
13
13
|
position: 'absolute',
|
|
14
14
|
zIndex: 2,
|
|
15
15
|
},
|
|
@@ -33,7 +33,7 @@ function AlignmentsDisplay({ model }: { model: AlignmentsDisplayModel }) {
|
|
|
33
33
|
return delta
|
|
34
34
|
}}
|
|
35
35
|
className={classes.resizeHandle}
|
|
36
|
-
style={{ top }}
|
|
36
|
+
style={{ top: top - 4 }}
|
|
37
37
|
/>
|
|
38
38
|
|
|
39
39
|
<div
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
import { BaseDisplay } from '@jbrowse/core/pluggableElementTypes/models'
|
|
21
21
|
import PluginManager from '@jbrowse/core/PluginManager'
|
|
22
22
|
import { MenuItem } from '@jbrowse/core/ui'
|
|
23
|
+
import { FeatureDensityStats } from '@jbrowse/core/data_adapters/BaseAdapter'
|
|
23
24
|
|
|
24
25
|
const minDisplayHeight = 20
|
|
25
26
|
|
|
@@ -161,6 +162,13 @@ function stateModelFactory(
|
|
|
161
162
|
get height() {
|
|
162
163
|
return self.heightPreConfig ?? getConf(self, 'height')
|
|
163
164
|
},
|
|
165
|
+
|
|
166
|
+
get featureIdUnderMouse() {
|
|
167
|
+
return (
|
|
168
|
+
self.PileupDisplay.featureIdUnderMouse ||
|
|
169
|
+
self.SNPCoverageDisplay.featureIdUnderMouse
|
|
170
|
+
)
|
|
171
|
+
},
|
|
164
172
|
}))
|
|
165
173
|
.views(self => ({
|
|
166
174
|
/**
|
|
@@ -234,9 +242,9 @@ function stateModelFactory(
|
|
|
234
242
|
/**
|
|
235
243
|
* #action
|
|
236
244
|
*/
|
|
237
|
-
|
|
238
|
-
self.PileupDisplay.
|
|
239
|
-
self.SNPCoverageDisplay.
|
|
245
|
+
setFeatureDensityStatsLimit(stats?: FeatureDensityStats) {
|
|
246
|
+
self.PileupDisplay.setFeatureDensityStatsLimit(stats)
|
|
247
|
+
self.SNPCoverageDisplay.setFeatureDensityStatsLimit(stats)
|
|
240
248
|
},
|
|
241
249
|
|
|
242
250
|
/**
|