@jbrowse/plugin-variants 1.7.11 → 2.1.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/ChordVariantDisplay/index.d.ts +2 -1
- package/dist/ChordVariantDisplay/index.js +19 -31
- package/dist/ChordVariantDisplay/index.js.map +1 -0
- package/dist/ChordVariantDisplay/models/ChordVariantDisplay.d.ts +94 -2
- package/dist/ChordVariantDisplay/models/ChordVariantDisplay.js +39 -71
- package/dist/ChordVariantDisplay/models/ChordVariantDisplay.js.map +1 -0
- package/dist/LinearVariantDisplay/configSchema.js +9 -16
- package/dist/LinearVariantDisplay/configSchema.js.map +1 -0
- package/dist/LinearVariantDisplay/index.js +10 -22
- package/dist/LinearVariantDisplay/index.js.map +1 -0
- package/dist/LinearVariantDisplay/model.d.ts +17 -12
- package/dist/LinearVariantDisplay/model.js +83 -73
- package/dist/LinearVariantDisplay/model.js.map +1 -0
- package/dist/StructuralVariantChordRenderer/ReactComponent.js +193 -214
- package/dist/StructuralVariantChordRenderer/ReactComponent.js.map +1 -0
- package/dist/StructuralVariantChordRenderer/index.js +36 -46
- package/dist/StructuralVariantChordRenderer/index.js.map +1 -0
- package/dist/VariantFeatureWidget/BreakendOptionDialog.d.ts +1 -1
- package/dist/VariantFeatureWidget/BreakendOptionDialog.js +95 -119
- package/dist/VariantFeatureWidget/BreakendOptionDialog.js.map +1 -0
- package/dist/VariantFeatureWidget/VariantFeatureWidget.js +193 -240
- package/dist/VariantFeatureWidget/VariantFeatureWidget.js.map +1 -0
- package/dist/VariantFeatureWidget/index.d.ts +3 -3
- package/dist/VariantFeatureWidget/index.js +14 -22
- package/dist/VariantFeatureWidget/index.js.map +1 -0
- package/dist/VcfAdapter/VcfAdapter.js +232 -372
- package/dist/VcfAdapter/VcfAdapter.js.map +1 -0
- package/dist/VcfAdapter/configSchema.js +9 -21
- package/dist/VcfAdapter/configSchema.js.map +1 -0
- package/dist/VcfAdapter/index.js +8 -14
- package/dist/VcfAdapter/index.js.map +1 -0
- package/dist/VcfTabixAdapter/VcfFeature.js +203 -246
- package/dist/VcfTabixAdapter/VcfFeature.js.map +1 -0
- package/dist/VcfTabixAdapter/VcfTabixAdapter.js +232 -374
- package/dist/VcfTabixAdapter/VcfTabixAdapter.js.map +1 -0
- package/dist/VcfTabixAdapter/configSchema.js +23 -36
- package/dist/VcfTabixAdapter/configSchema.js.map +1 -0
- package/dist/VcfTabixAdapter/index.js +8 -14
- package/dist/VcfTabixAdapter/index.js.map +1 -0
- package/dist/index.js +160 -203
- package/dist/index.js.map +1 -0
- package/esm/ChordVariantDisplay/index.d.ts +4 -0
- package/esm/ChordVariantDisplay/index.js +16 -0
- package/esm/ChordVariantDisplay/index.js.map +1 -0
- package/esm/ChordVariantDisplay/models/ChordVariantDisplay.d.ts +97 -0
- package/esm/ChordVariantDisplay/models/ChordVariantDisplay.js +40 -0
- package/esm/ChordVariantDisplay/models/ChordVariantDisplay.js.map +1 -0
- package/esm/LinearVariantDisplay/configSchema.d.ts +5 -0
- package/esm/LinearVariantDisplay/configSchema.js +7 -0
- package/esm/LinearVariantDisplay/configSchema.js.map +1 -0
- package/esm/LinearVariantDisplay/index.d.ts +2 -0
- package/esm/LinearVariantDisplay/index.js +3 -0
- package/esm/LinearVariantDisplay/index.js.map +1 -0
- package/esm/LinearVariantDisplay/model.d.ts +212 -0
- package/esm/LinearVariantDisplay/model.js +34 -0
- package/esm/LinearVariantDisplay/model.js.map +1 -0
- package/esm/StructuralVariantChordRenderer/ReactComponent.d.ts +24 -0
- package/esm/StructuralVariantChordRenderer/ReactComponent.js +133 -0
- package/esm/StructuralVariantChordRenderer/ReactComponent.js.map +1 -0
- package/esm/StructuralVariantChordRenderer/index.d.ts +3 -0
- package/esm/StructuralVariantChordRenderer/index.js +33 -0
- package/esm/StructuralVariantChordRenderer/index.js.map +1 -0
- package/esm/VariantFeatureWidget/BreakendOptionDialog.d.ts +10 -0
- package/esm/VariantFeatureWidget/BreakendOptionDialog.js +58 -0
- package/esm/VariantFeatureWidget/BreakendOptionDialog.js.map +1 -0
- package/esm/VariantFeatureWidget/VariantFeatureWidget.d.ts +4 -0
- package/esm/VariantFeatureWidget/VariantFeatureWidget.js +129 -0
- package/esm/VariantFeatureWidget/VariantFeatureWidget.js.map +1 -0
- package/esm/VariantFeatureWidget/index.d.ts +37 -0
- package/esm/VariantFeatureWidget/index.js +12 -0
- package/esm/VariantFeatureWidget/index.js.map +1 -0
- package/esm/VcfAdapter/VcfAdapter.d.ts +24 -0
- package/esm/VcfAdapter/VcfAdapter.js +99 -0
- package/esm/VcfAdapter/VcfAdapter.js.map +1 -0
- package/esm/VcfAdapter/configSchema.d.ts +2 -0
- package/esm/VcfAdapter/configSchema.js +8 -0
- package/esm/VcfAdapter/configSchema.js.map +1 -0
- package/esm/VcfAdapter/index.d.ts +1 -0
- package/esm/VcfAdapter/index.js +2 -0
- package/esm/VcfAdapter/index.js.map +1 -0
- package/esm/VcfTabixAdapter/VcfFeature.d.ts +59 -0
- package/esm/VcfTabixAdapter/VcfFeature.js +184 -0
- package/esm/VcfTabixAdapter/VcfFeature.js.map +1 -0
- package/esm/VcfTabixAdapter/VcfTabixAdapter.d.ts +35 -0
- package/esm/VcfTabixAdapter/VcfTabixAdapter.js +106 -0
- package/esm/VcfTabixAdapter/VcfTabixAdapter.js.map +1 -0
- package/esm/VcfTabixAdapter/configSchema.d.ts +2 -0
- package/esm/VcfTabixAdapter/configSchema.js +23 -0
- package/esm/VcfTabixAdapter/configSchema.js.map +1 -0
- package/esm/VcfTabixAdapter/index.d.ts +1 -0
- package/esm/VcfTabixAdapter/index.js +2 -0
- package/esm/VcfTabixAdapter/index.js.map +1 -0
- package/esm/index.d.ts +7 -0
- package/esm/index.js +110 -0
- package/esm/index.js.map +1 -0
- package/package.json +25 -16
- package/src/ChordVariantDisplay/index.ts +4 -4
- package/src/ChordVariantDisplay/models/ChordVariantDisplay.js +7 -8
- package/src/VariantFeatureWidget/BreakendOptionDialog.tsx +8 -9
- package/src/VariantFeatureWidget/VariantFeatureWidget.tsx +2 -3
- package/src/VariantFeatureWidget/__snapshots__/VariantFeatureWidget.test.js.snap +52 -57
- package/src/VcfTabixAdapter/VcfFeature.ts +1 -1
- package/src/VcfTabixAdapter/VcfTabixAdapter.ts +1 -7
- package/dist/LinearVariantDisplay/configSchema.test.js +0 -92
- package/dist/VariantFeatureWidget/VariantFeatureWidget.test.js +0 -56
- package/dist/VcfAdapter/VcfAdapter.test.js +0 -55
- package/dist/VcfTabixAdapter/VcfFeature.test.js +0 -106
- package/dist/VcfTabixAdapter/VcfTabixAdapter.test.js +0 -99
- package/dist/index.test.js +0 -37
|
@@ -2,84 +2,76 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`VariantTrack widget renders with just the required model elements 1`] = `
|
|
4
4
|
<div
|
|
5
|
-
class="MuiPaper-root MuiPaper-elevation1 MuiPaper-
|
|
5
|
+
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation1 css-1ps6pg7-MuiPaper-root"
|
|
6
6
|
data-testid="variant-side-drawer"
|
|
7
7
|
>
|
|
8
8
|
<div
|
|
9
|
-
class="MuiPaper-root MuiAccordion-root MuiAccordion-expanded MuiAccordion-
|
|
9
|
+
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation1 MuiAccordion-root MuiAccordion-rounded Mui-expanded MuiAccordion-gutters css-1elwnq4-MuiPaper-root-MuiAccordion-root"
|
|
10
10
|
>
|
|
11
11
|
<div
|
|
12
|
-
aria-disabled="false"
|
|
13
12
|
aria-expanded="true"
|
|
14
|
-
class="MuiButtonBase-root MuiAccordionSummary-root MuiAccordionSummary-
|
|
13
|
+
class="MuiButtonBase-root MuiAccordionSummary-root Mui-expanded MuiAccordionSummary-gutters css-sh22l5-MuiButtonBase-root-MuiAccordionSummary-root"
|
|
15
14
|
role="button"
|
|
16
15
|
tabindex="0"
|
|
17
16
|
>
|
|
18
17
|
<div
|
|
19
|
-
class="MuiAccordionSummary-content MuiAccordionSummary-
|
|
18
|
+
class="MuiAccordionSummary-content Mui-expanded MuiAccordionSummary-contentGutters css-o4b71y-MuiAccordionSummary-content"
|
|
20
19
|
>
|
|
21
20
|
<span
|
|
22
|
-
class="MuiTypography-root MuiTypography-button"
|
|
21
|
+
class="MuiTypography-root MuiTypography-button css-1f0on15-MuiTypography-root"
|
|
23
22
|
>
|
|
24
23
|
|
|
25
24
|
rs123
|
|
26
25
|
</span>
|
|
27
26
|
</div>
|
|
28
27
|
<div
|
|
29
|
-
|
|
30
|
-
aria-hidden="true"
|
|
31
|
-
class="MuiButtonBase-root MuiIconButton-root MuiAccordionSummary-expandIcon MuiAccordionSummary-expanded MuiIconButton-edgeEnd"
|
|
28
|
+
class="MuiAccordionSummary-expandIconWrapper Mui-expanded css-yw020d-MuiAccordionSummary-expandIconWrapper"
|
|
32
29
|
>
|
|
33
|
-
<
|
|
34
|
-
|
|
30
|
+
<svg
|
|
31
|
+
aria-hidden="true"
|
|
32
|
+
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium tss-rb1zhf-expandIcon css-i4bv87-MuiSvgIcon-root"
|
|
33
|
+
data-testid="ExpandMoreIcon"
|
|
34
|
+
focusable="false"
|
|
35
|
+
viewBox="0 0 24 24"
|
|
35
36
|
>
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
viewBox="0 0 24 24"
|
|
41
|
-
>
|
|
42
|
-
<path
|
|
43
|
-
d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"
|
|
44
|
-
/>
|
|
45
|
-
</svg>
|
|
46
|
-
</span>
|
|
47
|
-
<span
|
|
48
|
-
class="MuiTouchRipple-root"
|
|
49
|
-
/>
|
|
37
|
+
<path
|
|
38
|
+
d="M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"
|
|
39
|
+
/>
|
|
40
|
+
</svg>
|
|
50
41
|
</div>
|
|
51
42
|
</div>
|
|
52
43
|
<div
|
|
53
|
-
class="MuiCollapse-root MuiCollapse-entered"
|
|
44
|
+
class="MuiCollapse-root MuiCollapse-vertical MuiCollapse-entered css-pwcg7p-MuiCollapse-root"
|
|
54
45
|
style="min-height: 0px;"
|
|
55
46
|
>
|
|
56
47
|
<div
|
|
57
|
-
class="MuiCollapse-wrapper"
|
|
48
|
+
class="MuiCollapse-wrapper MuiCollapse-vertical css-smkl36-MuiCollapse-wrapper"
|
|
58
49
|
>
|
|
59
50
|
<div
|
|
60
|
-
class="MuiCollapse-wrapperInner"
|
|
51
|
+
class="MuiCollapse-wrapperInner MuiCollapse-vertical css-9l5vo-MuiCollapse-wrapperInner"
|
|
61
52
|
>
|
|
62
53
|
<div
|
|
54
|
+
class="MuiAccordion-region"
|
|
63
55
|
role="region"
|
|
64
56
|
>
|
|
65
57
|
<div
|
|
66
|
-
class="MuiAccordionDetails-root
|
|
58
|
+
class="MuiAccordionDetails-root tss-1g973hk-expansionPanelDetails css-15v22id-MuiAccordionDetails-root"
|
|
67
59
|
>
|
|
68
60
|
<p
|
|
69
|
-
class="MuiTypography-root MuiTypography-body1"
|
|
61
|
+
class="MuiTypography-root MuiTypography-body1 css-ahj2mt-MuiTypography-root"
|
|
70
62
|
>
|
|
71
63
|
Core details
|
|
72
64
|
</p>
|
|
73
65
|
<div
|
|
74
|
-
class="
|
|
66
|
+
class="tss-1m8nxnb-field"
|
|
75
67
|
>
|
|
76
68
|
<div
|
|
77
|
-
class="
|
|
69
|
+
class="tss-1y9c7n2-fieldName"
|
|
78
70
|
>
|
|
79
71
|
Position
|
|
80
72
|
</div>
|
|
81
73
|
<div
|
|
82
|
-
class="
|
|
74
|
+
class="tss-1omt041-fieldValue"
|
|
83
75
|
>
|
|
84
76
|
<div>
|
|
85
77
|
ctgA:177..177
|
|
@@ -87,15 +79,15 @@ exports[`VariantTrack widget renders with just the required model elements 1`] =
|
|
|
87
79
|
</div>
|
|
88
80
|
</div>
|
|
89
81
|
<div
|
|
90
|
-
class="
|
|
82
|
+
class="tss-1m8nxnb-field"
|
|
91
83
|
>
|
|
92
84
|
<div
|
|
93
|
-
class="
|
|
85
|
+
class="tss-1y9c7n2-fieldName"
|
|
94
86
|
>
|
|
95
87
|
Name
|
|
96
88
|
</div>
|
|
97
89
|
<div
|
|
98
|
-
class="
|
|
90
|
+
class="tss-1omt041-fieldValue"
|
|
99
91
|
>
|
|
100
92
|
<div>
|
|
101
93
|
rs123
|
|
@@ -103,15 +95,15 @@ exports[`VariantTrack widget renders with just the required model elements 1`] =
|
|
|
103
95
|
</div>
|
|
104
96
|
</div>
|
|
105
97
|
<div
|
|
106
|
-
class="
|
|
98
|
+
class="tss-1m8nxnb-field"
|
|
107
99
|
>
|
|
108
100
|
<div
|
|
109
|
-
class="
|
|
101
|
+
class="tss-1y9c7n2-fieldName"
|
|
110
102
|
>
|
|
111
103
|
Length
|
|
112
104
|
</div>
|
|
113
105
|
<div
|
|
114
|
-
class="
|
|
106
|
+
class="tss-1omt041-fieldValue"
|
|
115
107
|
>
|
|
116
108
|
<div>
|
|
117
109
|
1
|
|
@@ -119,24 +111,25 @@ exports[`VariantTrack widget renders with just the required model elements 1`] =
|
|
|
119
111
|
</div>
|
|
120
112
|
</div>
|
|
121
113
|
<hr
|
|
122
|
-
class="MuiDivider-root"
|
|
114
|
+
class="MuiDivider-root MuiDivider-fullWidth css-9mgopn-MuiDivider-root"
|
|
123
115
|
/>
|
|
124
116
|
<p
|
|
125
|
-
class="MuiTypography-root MuiTypography-body1"
|
|
117
|
+
class="MuiTypography-root MuiTypography-body1 css-ahj2mt-MuiTypography-root"
|
|
126
118
|
>
|
|
127
119
|
Attributes
|
|
128
120
|
</p>
|
|
129
121
|
<div
|
|
130
|
-
class="
|
|
122
|
+
class="tss-1m8nxnb-field"
|
|
131
123
|
>
|
|
132
124
|
<div
|
|
133
|
-
|
|
134
|
-
|
|
125
|
+
aria-label="reference base(s): Each base must be one of A,C,G,T,N (case insensitive)."
|
|
126
|
+
class="tss-1qe2j6j-fieldDescription-fieldName"
|
|
127
|
+
data-mui-internal-clone-element="true"
|
|
135
128
|
>
|
|
136
129
|
REF
|
|
137
130
|
</div>
|
|
138
131
|
<div
|
|
139
|
-
class="
|
|
132
|
+
class="tss-1omt041-fieldValue"
|
|
140
133
|
>
|
|
141
134
|
<div>
|
|
142
135
|
A
|
|
@@ -144,16 +137,17 @@ exports[`VariantTrack widget renders with just the required model elements 1`] =
|
|
|
144
137
|
</div>
|
|
145
138
|
</div>
|
|
146
139
|
<div
|
|
147
|
-
class="
|
|
140
|
+
class="tss-1m8nxnb-field"
|
|
148
141
|
>
|
|
149
142
|
<div
|
|
150
|
-
|
|
151
|
-
|
|
143
|
+
aria-label="alternate base(s): Comma-separated list of alternate non-reference alleles"
|
|
144
|
+
class="tss-1qe2j6j-fieldDescription-fieldName"
|
|
145
|
+
data-mui-internal-clone-element="true"
|
|
152
146
|
>
|
|
153
147
|
ALT
|
|
154
148
|
</div>
|
|
155
149
|
<div
|
|
156
|
-
class="
|
|
150
|
+
class="tss-1omt041-fieldValue"
|
|
157
151
|
>
|
|
158
152
|
<div>
|
|
159
153
|
<TRA>
|
|
@@ -161,16 +155,17 @@ exports[`VariantTrack widget renders with just the required model elements 1`] =
|
|
|
161
155
|
</div>
|
|
162
156
|
</div>
|
|
163
157
|
<div
|
|
164
|
-
class="
|
|
158
|
+
class="tss-1m8nxnb-field"
|
|
165
159
|
>
|
|
166
160
|
<div
|
|
167
|
-
|
|
168
|
-
|
|
161
|
+
aria-label="quality: Phred-scaled quality score for the assertion made in ALT"
|
|
162
|
+
class="tss-1qe2j6j-fieldDescription-fieldName"
|
|
163
|
+
data-mui-internal-clone-element="true"
|
|
169
164
|
>
|
|
170
165
|
QUAL
|
|
171
166
|
</div>
|
|
172
167
|
<div
|
|
173
|
-
class="
|
|
168
|
+
class="tss-1omt041-fieldValue"
|
|
174
169
|
>
|
|
175
170
|
<div>
|
|
176
171
|
10.4
|
|
@@ -178,16 +173,16 @@ exports[`VariantTrack widget renders with just the required model elements 1`] =
|
|
|
178
173
|
</div>
|
|
179
174
|
</div>
|
|
180
175
|
<div
|
|
181
|
-
class="
|
|
176
|
+
class="tss-1m8nxnb-field"
|
|
182
177
|
>
|
|
183
178
|
<div
|
|
184
|
-
class="
|
|
179
|
+
class="tss-1y9c7n2-fieldName"
|
|
185
180
|
style="width: 62px;"
|
|
186
181
|
>
|
|
187
182
|
INFO.MQ
|
|
188
183
|
</div>
|
|
189
184
|
<div
|
|
190
|
-
class="
|
|
185
|
+
class="tss-1omt041-fieldValue"
|
|
191
186
|
>
|
|
192
187
|
<div>
|
|
193
188
|
5
|
|
@@ -201,7 +196,7 @@ exports[`VariantTrack widget renders with just the required model elements 1`] =
|
|
|
201
196
|
</div>
|
|
202
197
|
</div>
|
|
203
198
|
<hr
|
|
204
|
-
class="MuiDivider-root"
|
|
199
|
+
class="MuiDivider-root MuiDivider-fullWidth css-9mgopn-MuiDivider-root"
|
|
205
200
|
/>
|
|
206
201
|
</div>
|
|
207
202
|
`;
|
|
@@ -106,7 +106,7 @@ export default class VCFFeature implements Feature {
|
|
|
106
106
|
alt: string[],
|
|
107
107
|
): [string, string] | [undefined, undefined] {
|
|
108
108
|
// it's just a remark if there are no alternate alleles
|
|
109
|
-
if (!alt || alt ===
|
|
109
|
+
if (!alt || alt.length === 0) {
|
|
110
110
|
return ['remark', 'no alternative alleles']
|
|
111
111
|
}
|
|
112
112
|
|
|
@@ -118,9 +118,6 @@ export default class extends BaseFeatureDataAdapter {
|
|
|
118
118
|
regions: Region[],
|
|
119
119
|
opts: BaseOptions = {},
|
|
120
120
|
) {
|
|
121
|
-
// TODO: restore commented version below once TSDX supports Rollup v2
|
|
122
|
-
// xref: https://github.com/rollup/rollup/blob/master/CHANGELOG.md#bug-fixes-45
|
|
123
|
-
const superGetFeaturesInMultipleRegions = super.getFeaturesInMultipleRegions
|
|
124
121
|
return ObservableCreate<Feature>(async (observer: Observer<Feature>) => {
|
|
125
122
|
const { vcf } = await this.configure()
|
|
126
123
|
|
|
@@ -138,10 +135,7 @@ export default class extends BaseFeatureDataAdapter {
|
|
|
138
135
|
`getFeaturesInMultipleRegions fetching ${pct}% of VCF file, but whole-file streaming not yet implemented`,
|
|
139
136
|
)
|
|
140
137
|
}
|
|
141
|
-
|
|
142
|
-
.call(this, regions, opts)
|
|
143
|
-
.subscribe(observer)
|
|
144
|
-
// super.getFeaturesInMultipleRegions(regions, opts).subscribe(observer)
|
|
138
|
+
super.getFeaturesInMultipleRegions(regions, opts).subscribe(observer)
|
|
145
139
|
})
|
|
146
140
|
}
|
|
147
141
|
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
6
|
-
|
|
7
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
8
|
-
|
|
9
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
10
|
-
|
|
11
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
12
|
-
|
|
13
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
|
-
|
|
15
|
-
var _BoxRendererType = _interopRequireDefault(require("@jbrowse/core/pluggableElementTypes/renderers/BoxRendererType"));
|
|
16
|
-
|
|
17
|
-
var _Plugin3 = _interopRequireDefault(require("@jbrowse/core/Plugin"));
|
|
18
|
-
|
|
19
|
-
var _PluginManager = _interopRequireDefault(require("@jbrowse/core/PluginManager"));
|
|
20
|
-
|
|
21
|
-
var _PileupRenderer = _interopRequireDefault(require("@jbrowse/plugin-alignments/src/PileupRenderer"));
|
|
22
|
-
|
|
23
|
-
var _SvgFeatureRenderer = require("@jbrowse/plugin-svg/src/SvgFeatureRenderer");
|
|
24
|
-
|
|
25
|
-
var _configSchema = require("./configSchema");
|
|
26
|
-
|
|
27
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
28
|
-
|
|
29
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
30
|
-
|
|
31
|
-
// mock warnings to avoid unnecessary outputs
|
|
32
|
-
beforeEach(function () {
|
|
33
|
-
jest.spyOn(console, 'warn').mockImplementation(function () {});
|
|
34
|
-
});
|
|
35
|
-
afterEach(function () {
|
|
36
|
-
console.warn.mockRestore();
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
var PileupRendererPlugin = /*#__PURE__*/function (_Plugin) {
|
|
40
|
-
(0, _inherits2.default)(PileupRendererPlugin, _Plugin);
|
|
41
|
-
|
|
42
|
-
var _super = _createSuper(PileupRendererPlugin);
|
|
43
|
-
|
|
44
|
-
function PileupRendererPlugin() {
|
|
45
|
-
(0, _classCallCheck2.default)(this, PileupRendererPlugin);
|
|
46
|
-
return _super.apply(this, arguments);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
(0, _createClass2.default)(PileupRendererPlugin, [{
|
|
50
|
-
key: "install",
|
|
51
|
-
value: function install(pluginManager) {
|
|
52
|
-
(0, _PileupRenderer.default)(pluginManager);
|
|
53
|
-
}
|
|
54
|
-
}]);
|
|
55
|
-
return PileupRendererPlugin;
|
|
56
|
-
}(_Plugin3.default);
|
|
57
|
-
|
|
58
|
-
var SvgFeatureRendererPlugin = /*#__PURE__*/function (_Plugin2) {
|
|
59
|
-
(0, _inherits2.default)(SvgFeatureRendererPlugin, _Plugin2);
|
|
60
|
-
|
|
61
|
-
var _super2 = _createSuper(SvgFeatureRendererPlugin);
|
|
62
|
-
|
|
63
|
-
function SvgFeatureRendererPlugin() {
|
|
64
|
-
(0, _classCallCheck2.default)(this, SvgFeatureRendererPlugin);
|
|
65
|
-
return _super2.apply(this, arguments);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
(0, _createClass2.default)(SvgFeatureRendererPlugin, [{
|
|
69
|
-
key: "install",
|
|
70
|
-
value: function install(pluginManager) {
|
|
71
|
-
pluginManager.addRendererType(function () {
|
|
72
|
-
return new _BoxRendererType.default({
|
|
73
|
-
name: 'SvgFeatureRenderer',
|
|
74
|
-
ReactComponent: _SvgFeatureRenderer.ReactComponent,
|
|
75
|
-
configSchema: _SvgFeatureRenderer.configSchema,
|
|
76
|
-
pluginManager: pluginManager
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
}]);
|
|
81
|
-
return SvgFeatureRendererPlugin;
|
|
82
|
-
}(_Plugin3.default);
|
|
83
|
-
|
|
84
|
-
test('has a viewType attr', function () {
|
|
85
|
-
var configSchema = (0, _configSchema.LinearVariantDisplayConfigFactory)(new _PluginManager.default([new PileupRendererPlugin(), new SvgFeatureRendererPlugin()]).createPluggableElements().configure());
|
|
86
|
-
var config = configSchema.create({
|
|
87
|
-
type: 'LinearVariantDisplay',
|
|
88
|
-
displayId: 'diplayId0',
|
|
89
|
-
name: 'Zonker Display'
|
|
90
|
-
});
|
|
91
|
-
expect(config.type).toEqual('LinearVariantDisplay');
|
|
92
|
-
});
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _react = _interopRequireDefault(require("react"));
|
|
6
|
-
|
|
7
|
-
var _react2 = require("@testing-library/react");
|
|
8
|
-
|
|
9
|
-
var _mobxStateTree = require("mobx-state-tree");
|
|
10
|
-
|
|
11
|
-
var _configuration = require("@jbrowse/core/configuration");
|
|
12
|
-
|
|
13
|
-
var _PluginManager = _interopRequireDefault(require("@jbrowse/core/PluginManager"));
|
|
14
|
-
|
|
15
|
-
var _ = require(".");
|
|
16
|
-
|
|
17
|
-
var _VariantFeatureWidget = _interopRequireDefault(require("./VariantFeatureWidget"));
|
|
18
|
-
|
|
19
|
-
describe('VariantTrack widget', function () {
|
|
20
|
-
it('renders with just the required model elements', function () {
|
|
21
|
-
console.warn = jest.fn();
|
|
22
|
-
var pluginManager = new _PluginManager.default([]);
|
|
23
|
-
|
|
24
|
-
var Session = _mobxStateTree.types.model({
|
|
25
|
-
rpcManager: _mobxStateTree.types.optional(_mobxStateTree.types.frozen(), {}),
|
|
26
|
-
pluginManager: _mobxStateTree.types.optional(_mobxStateTree.types.frozen(), {}),
|
|
27
|
-
configuration: (0, _configuration.ConfigurationSchema)('test', {}),
|
|
28
|
-
widget: (0, _.stateModelFactory)(pluginManager)
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
var model = Session.create({
|
|
32
|
-
widget: {
|
|
33
|
-
type: 'VariantFeatureWidget'
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
model.widget.setFeatureData({
|
|
37
|
-
refName: 'ctgA',
|
|
38
|
-
start: 176,
|
|
39
|
-
end: 177,
|
|
40
|
-
name: 'rs123',
|
|
41
|
-
REF: 'A',
|
|
42
|
-
ALT: ['<TRA>'],
|
|
43
|
-
QUAL: 10.4,
|
|
44
|
-
INFO: {
|
|
45
|
-
MQ: 5
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
var _render = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_VariantFeatureWidget.default, {
|
|
50
|
-
model: model.widget
|
|
51
|
-
})),
|
|
52
|
-
container = _render.container;
|
|
53
|
-
|
|
54
|
-
expect(container.firstChild).toMatchSnapshot();
|
|
55
|
-
});
|
|
56
|
-
});
|
|
@@ -1,55 +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 _VcfAdapter = _interopRequireDefault(require("./VcfAdapter"));
|
|
12
|
-
|
|
13
|
-
var _configSchema = _interopRequireDefault(require("./configSchema"));
|
|
14
|
-
|
|
15
|
-
var _webEncoding = require("web-encoding");
|
|
16
|
-
|
|
17
|
-
window.TextDecoder = _webEncoding.TextDecoder;
|
|
18
|
-
test('adapter can fetch variants from volvox.vcf', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
19
|
-
var adapter, features, names, featuresArray;
|
|
20
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
21
|
-
while (1) {
|
|
22
|
-
switch (_context.prev = _context.next) {
|
|
23
|
-
case 0:
|
|
24
|
-
adapter = new _VcfAdapter.default(_configSchema.default.create({
|
|
25
|
-
vcfLocation: {
|
|
26
|
-
localPath: require.resolve('./test_data/volvox.filtered.vcf'),
|
|
27
|
-
locationType: 'LocalPathLocation'
|
|
28
|
-
}
|
|
29
|
-
}));
|
|
30
|
-
features = adapter.getFeatures({
|
|
31
|
-
assemblyName: 'volvox',
|
|
32
|
-
refName: 'ctgA',
|
|
33
|
-
start: 0,
|
|
34
|
-
end: 20000
|
|
35
|
-
});
|
|
36
|
-
_context.next = 4;
|
|
37
|
-
return adapter.getRefNames();
|
|
38
|
-
|
|
39
|
-
case 4:
|
|
40
|
-
names = _context.sent;
|
|
41
|
-
expect(names).toMatchSnapshot();
|
|
42
|
-
_context.next = 8;
|
|
43
|
-
return features.pipe((0, _operators.toArray)()).toPromise();
|
|
44
|
-
|
|
45
|
-
case 8:
|
|
46
|
-
featuresArray = _context.sent;
|
|
47
|
-
expect(featuresArray.slice(0, 5)).toMatchSnapshot();
|
|
48
|
-
|
|
49
|
-
case 10:
|
|
50
|
-
case "end":
|
|
51
|
-
return _context.stop();
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}, _callee);
|
|
55
|
-
})));
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _vcf = _interopRequireDefault(require("@gmod/vcf"));
|
|
6
|
-
|
|
7
|
-
var _VcfFeature = _interopRequireDefault(require("./VcfFeature"));
|
|
8
|
-
|
|
9
|
-
test('test usage of the VcfFeature', function () {
|
|
10
|
-
var parser = new _vcf.default({
|
|
11
|
-
header: "#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tBAMs/caudaus.sorted.sam"
|
|
12
|
-
});
|
|
13
|
-
var line = "lcl|Scaffald_1\t80465\trs118266897\tR\tA\t29\tPASS\tNS=3;0,14;AF=0.5;DB;112;PG2.1";
|
|
14
|
-
var variant = parser.parseLine(line);
|
|
15
|
-
var f = new _VcfFeature.default({
|
|
16
|
-
parser: parser,
|
|
17
|
-
variant: variant,
|
|
18
|
-
id: 'myuniqueid'
|
|
19
|
-
});
|
|
20
|
-
expect(f.id()).toEqual('myuniqueid');
|
|
21
|
-
expect(f.get('name')).toEqual('rs118266897');
|
|
22
|
-
});
|
|
23
|
-
test('try INS feature with END less than start', function () {
|
|
24
|
-
var parser = new _vcf.default({
|
|
25
|
-
header: "#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tBAMs/caudaus.sorted.sam"
|
|
26
|
-
});
|
|
27
|
-
var line = "chr1\t100\trs123\tR\tA\t29\tPASS\tEND=1;SVTYPE=INS";
|
|
28
|
-
var variant = parser.parseLine(line);
|
|
29
|
-
var f = new _VcfFeature.default({
|
|
30
|
-
parser: parser,
|
|
31
|
-
variant: variant,
|
|
32
|
-
id: 'myuniqueid'
|
|
33
|
-
});
|
|
34
|
-
expect(f.id()).toEqual('myuniqueid');
|
|
35
|
-
expect(f.get('start')).toEqual(99);
|
|
36
|
-
expect(f.get('end')).toEqual(100);
|
|
37
|
-
});
|
|
38
|
-
test('try DEL feature with END info field valid', function () {
|
|
39
|
-
var parser = new _vcf.default({
|
|
40
|
-
header: "#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tBAMs/caudaus.sorted.sam"
|
|
41
|
-
});
|
|
42
|
-
var line = "chr1\t100\trs123\tR\t<DEL>\t29\tPASS\tEND=1000;SVTYPE=DEL";
|
|
43
|
-
var variant = parser.parseLine(line);
|
|
44
|
-
var f = new _VcfFeature.default({
|
|
45
|
-
parser: parser,
|
|
46
|
-
variant: variant,
|
|
47
|
-
id: 'myuniqueid'
|
|
48
|
-
});
|
|
49
|
-
expect(f.id()).toEqual('myuniqueid');
|
|
50
|
-
expect(f.get('start')).toEqual(99);
|
|
51
|
-
expect(f.get('end')).toEqual(1000);
|
|
52
|
-
});
|
|
53
|
-
describe('test SV description', function () {
|
|
54
|
-
it('multiple SVs', function () {
|
|
55
|
-
var parser = new _vcf.default({
|
|
56
|
-
header: "#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tBAMs/caudaus.sorted.sam"
|
|
57
|
-
});
|
|
58
|
-
var line = "chr1\t100\trs123\tR\t<INVDUP>,<INV>\t29\tPASS\tEND=1000;SVTYPE=DEL";
|
|
59
|
-
var variant = parser.parseLine(line);
|
|
60
|
-
var f = new _VcfFeature.default({
|
|
61
|
-
parser: parser,
|
|
62
|
-
variant: variant,
|
|
63
|
-
id: 'myuniqueid'
|
|
64
|
-
});
|
|
65
|
-
expect(f.get('description')).toEqual('<INVDUP>,<INV>');
|
|
66
|
-
});
|
|
67
|
-
it('BND', function () {
|
|
68
|
-
var parser = new _vcf.default({
|
|
69
|
-
header: "#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tBAMs/caudaus.sorted.sam"
|
|
70
|
-
});
|
|
71
|
-
var line = "chr1\t100\trs123\tR\tG[ctgA:34200[\t29\tPASS\tEND=1000;SVTYPE=BND";
|
|
72
|
-
var variant = parser.parseLine(line);
|
|
73
|
-
var f = new _VcfFeature.default({
|
|
74
|
-
parser: parser,
|
|
75
|
-
variant: variant,
|
|
76
|
-
id: 'myuniqueid'
|
|
77
|
-
});
|
|
78
|
-
expect(f.get('description')).toEqual('G[ctgA:34200[');
|
|
79
|
-
});
|
|
80
|
-
it('multiple BND', function () {
|
|
81
|
-
var parser = new _vcf.default({
|
|
82
|
-
header: "#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tBAMs/caudaus.sorted.sam"
|
|
83
|
-
});
|
|
84
|
-
var line = "chr1\t100\trs123\tR\tG[ctgA:34200[,G[ctgA:44200[\t29\tPASS\tEND=1000;SVTYPE=BND";
|
|
85
|
-
var variant = parser.parseLine(line);
|
|
86
|
-
var f = new _VcfFeature.default({
|
|
87
|
-
parser: parser,
|
|
88
|
-
variant: variant,
|
|
89
|
-
id: 'myuniqueid'
|
|
90
|
-
});
|
|
91
|
-
expect(f.get('description')).toEqual('G[ctgA:34200[,G[ctgA:44200[');
|
|
92
|
-
});
|
|
93
|
-
it('multiple SNV', function () {
|
|
94
|
-
var parser = new _vcf.default({
|
|
95
|
-
header: "#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tBAMs/caudaus.sorted.sam"
|
|
96
|
-
});
|
|
97
|
-
var line = "chr1\t100\trs123\tG\tA,C\t29\tPASS\tHELLO=world";
|
|
98
|
-
var variant = parser.parseLine(line);
|
|
99
|
-
var f = new _VcfFeature.default({
|
|
100
|
-
parser: parser,
|
|
101
|
-
variant: variant,
|
|
102
|
-
id: 'myuniqueid'
|
|
103
|
-
});
|
|
104
|
-
expect(f.get('description')).toEqual('SNV G -> A,C');
|
|
105
|
-
});
|
|
106
|
-
});
|