@jbrowse/plugin-alignments 2.3.4 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BamAdapter/BamAdapter.js +2 -2
- package/dist/BamAdapter/BamAdapter.js.map +1 -1
- package/dist/BamAdapter/BamSlightlyLazyFeature.js +2 -2
- package/dist/BamAdapter/BamSlightlyLazyFeature.js.map +1 -1
- package/dist/CramAdapter/CramAdapter.js +2 -2
- package/dist/CramAdapter/CramAdapter.js.map +1 -1
- package/dist/CramAdapter/CramSlightlyLazyFeature.js +2 -2
- package/dist/CramAdapter/CramSlightlyLazyFeature.js.map +1 -1
- package/dist/CramAdapter/util.js +10 -10
- package/dist/CramAdapter/util.js.map +1 -1
- package/dist/LinearAlignmentsDisplay/components/AlignmentsDisplay.js +2 -2
- package/dist/LinearAlignmentsDisplay/components/AlignmentsDisplay.js.map +1 -1
- package/dist/LinearAlignmentsDisplay/models/configSchema.js +7 -0
- package/dist/LinearAlignmentsDisplay/models/configSchema.js.map +1 -1
- package/dist/LinearAlignmentsDisplay/models/model.d.ts +21 -5
- package/dist/LinearAlignmentsDisplay/models/model.js +22 -6
- package/dist/LinearAlignmentsDisplay/models/model.js.map +1 -1
- package/dist/LinearPileupDisplay/index.d.ts +2 -3
- package/dist/LinearPileupDisplay/index.js +4 -2
- package/dist/LinearPileupDisplay/index.js.map +1 -1
- package/dist/LinearPileupDisplay/model.d.ts +70 -9
- package/dist/LinearPileupDisplay/model.js +4 -4
- package/dist/LinearPileupDisplay/model.js.map +1 -1
- package/dist/LinearReadArcsDisplay/components/ReactComponent.js +14 -11
- package/dist/LinearReadArcsDisplay/components/ReactComponent.js.map +1 -1
- package/dist/LinearReadArcsDisplay/model.d.ts +77 -28
- package/dist/LinearReadArcsDisplay/model.js +16 -4
- package/dist/LinearReadArcsDisplay/model.js.map +1 -1
- package/dist/LinearReadCloudDisplay/model.d.ts +71 -19
- package/dist/LinearReadCloudDisplay/model.js +15 -3
- package/dist/LinearReadCloudDisplay/model.js.map +1 -1
- package/dist/LinearSNPCoverageDisplay/models/model.d.ts +8 -13
- package/dist/MismatchParser/index.js +4 -6
- package/dist/MismatchParser/index.js.map +1 -1
- package/dist/NestedFrequencyTable.js +3 -13
- package/dist/NestedFrequencyTable.js.map +1 -1
- package/dist/PileupRPC/rpcMethods.d.ts +3 -4
- package/dist/PileupRPC/rpcMethods.js +6 -6
- package/dist/PileupRPC/rpcMethods.js.map +1 -1
- package/dist/PileupRenderer/PileupRenderer.d.ts +6 -4
- package/dist/PileupRenderer/PileupRenderer.js +32 -38
- package/dist/PileupRenderer/PileupRenderer.js.map +1 -1
- package/dist/PileupRenderer/components/PileupRendering.js +2 -2
- package/dist/PileupRenderer/components/PileupRendering.js.map +1 -1
- package/dist/PileupRenderer/configSchema.js +1 -1
- package/dist/PileupRenderer/configSchema.js.map +1 -1
- package/dist/PileupRenderer/sortUtil.js +5 -4
- package/dist/PileupRenderer/sortUtil.js.map +1 -1
- package/dist/SNPCoverageRenderer/SNPCoverageRenderer.js +10 -7
- package/dist/SNPCoverageRenderer/SNPCoverageRenderer.js.map +1 -1
- package/dist/index.d.ts +3 -5
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/esm/BamAdapter/BamAdapter.js +2 -2
- package/esm/BamAdapter/BamAdapter.js.map +1 -1
- package/esm/BamAdapter/BamSlightlyLazyFeature.js +2 -2
- package/esm/BamAdapter/BamSlightlyLazyFeature.js.map +1 -1
- package/esm/CramAdapter/CramAdapter.js +2 -2
- package/esm/CramAdapter/CramAdapter.js.map +1 -1
- package/esm/CramAdapter/CramSlightlyLazyFeature.js +2 -2
- package/esm/CramAdapter/CramSlightlyLazyFeature.js.map +1 -1
- package/esm/CramAdapter/util.js +10 -10
- package/esm/CramAdapter/util.js.map +1 -1
- package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.js +2 -2
- package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.js.map +1 -1
- package/esm/LinearAlignmentsDisplay/models/configSchema.js +7 -0
- package/esm/LinearAlignmentsDisplay/models/configSchema.js.map +1 -1
- package/esm/LinearAlignmentsDisplay/models/model.d.ts +21 -5
- package/esm/LinearAlignmentsDisplay/models/model.js +22 -6
- package/esm/LinearAlignmentsDisplay/models/model.js.map +1 -1
- package/esm/LinearPileupDisplay/index.d.ts +2 -3
- package/esm/LinearPileupDisplay/index.js +2 -1
- package/esm/LinearPileupDisplay/index.js.map +1 -1
- package/esm/LinearPileupDisplay/model.d.ts +70 -9
- package/esm/LinearPileupDisplay/model.js +4 -4
- package/esm/LinearPileupDisplay/model.js.map +1 -1
- package/esm/LinearReadArcsDisplay/components/ReactComponent.js +14 -11
- package/esm/LinearReadArcsDisplay/components/ReactComponent.js.map +1 -1
- package/esm/LinearReadArcsDisplay/model.d.ts +77 -28
- package/esm/LinearReadArcsDisplay/model.js +16 -4
- package/esm/LinearReadArcsDisplay/model.js.map +1 -1
- package/esm/LinearReadCloudDisplay/model.d.ts +71 -19
- package/esm/LinearReadCloudDisplay/model.js +15 -3
- package/esm/LinearReadCloudDisplay/model.js.map +1 -1
- package/esm/LinearSNPCoverageDisplay/models/model.d.ts +8 -13
- package/esm/MismatchParser/index.js +4 -6
- package/esm/MismatchParser/index.js.map +1 -1
- package/esm/NestedFrequencyTable.js +3 -13
- package/esm/NestedFrequencyTable.js.map +1 -1
- package/esm/PileupRPC/rpcMethods.d.ts +3 -4
- package/esm/PileupRPC/rpcMethods.js +3 -4
- package/esm/PileupRPC/rpcMethods.js.map +1 -1
- package/esm/PileupRenderer/PileupRenderer.d.ts +6 -4
- package/esm/PileupRenderer/PileupRenderer.js +32 -38
- package/esm/PileupRenderer/PileupRenderer.js.map +1 -1
- package/esm/PileupRenderer/components/PileupRendering.js +2 -2
- package/esm/PileupRenderer/components/PileupRendering.js.map +1 -1
- package/esm/PileupRenderer/configSchema.js +1 -1
- package/esm/PileupRenderer/configSchema.js.map +1 -1
- package/esm/PileupRenderer/sortUtil.js +5 -4
- package/esm/PileupRenderer/sortUtil.js.map +1 -1
- package/esm/SNPCoverageRenderer/SNPCoverageRenderer.js +10 -7
- package/esm/SNPCoverageRenderer/SNPCoverageRenderer.js.map +1 -1
- package/esm/index.d.ts +3 -5
- package/esm/index.js +3 -3
- package/esm/index.js.map +1 -1
- package/package.json +2 -2
- package/src/AlignmentsFeatureDetail/__snapshots__/index.test.tsx.snap +13 -13
- package/src/AlignmentsFeatureDetail/index.test.tsx +1 -1
- package/src/BamAdapter/BamAdapter.ts +2 -2
- package/src/BamAdapter/BamSlightlyLazyFeature.ts +2 -2
- package/src/CramAdapter/CramAdapter.ts +2 -2
- package/src/CramAdapter/CramSlightlyLazyFeature.ts +2 -2
- package/src/CramAdapter/util.ts +10 -10
- package/src/LinearAlignmentsDisplay/components/AlignmentsDisplay.tsx +2 -2
- package/src/LinearAlignmentsDisplay/models/configSchema.test.ts +1 -1
- package/src/LinearAlignmentsDisplay/models/configSchema.ts +8 -0
- package/src/LinearAlignmentsDisplay/models/model.tsx +21 -6
- package/src/LinearPileupDisplay/index.ts +2 -4
- package/src/LinearPileupDisplay/model.ts +4 -4
- package/src/LinearReadArcsDisplay/components/ReactComponent.tsx +14 -12
- package/src/LinearReadArcsDisplay/model.tsx +23 -5
- package/src/LinearReadCloudDisplay/model.tsx +23 -7
- package/src/LinearSNPCoverageDisplay/models/configSchema.test.ts +1 -1
- package/src/MismatchParser/index.ts +6 -8
- package/src/NestedFrequencyTable.ts +3 -11
- package/src/PileupRPC/rpcMethods.ts +3 -9
- package/src/PileupRenderer/PileupRenderer.ts +49 -65
- package/src/PileupRenderer/components/PileupRendering.tsx +2 -2
- package/src/PileupRenderer/configSchema.ts +1 -1
- package/src/PileupRenderer/sortUtil.ts +5 -4
- package/src/SNPCoverageRenderer/SNPCoverageRenderer.ts +14 -13
- package/src/index.ts +5 -10
|
@@ -29,7 +29,7 @@ exports[`open up a widget 1`] = `
|
|
|
29
29
|
>
|
|
30
30
|
<svg
|
|
31
31
|
aria-hidden="true"
|
|
32
|
-
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-
|
|
32
|
+
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-ymsoo8-MuiSvgIcon-root-expandIcon"
|
|
33
33
|
data-testid="ExpandMoreIcon"
|
|
34
34
|
focusable="false"
|
|
35
35
|
viewBox="0 0 24 24"
|
|
@@ -66,7 +66,7 @@ exports[`open up a widget 1`] = `
|
|
|
66
66
|
class="css-1m8nxnb-field"
|
|
67
67
|
>
|
|
68
68
|
<div
|
|
69
|
-
class="css-
|
|
69
|
+
class="css-1q83rf3-fieldName"
|
|
70
70
|
>
|
|
71
71
|
Position
|
|
72
72
|
</div>
|
|
@@ -80,7 +80,7 @@ exports[`open up a widget 1`] = `
|
|
|
80
80
|
class="css-1m8nxnb-field"
|
|
81
81
|
>
|
|
82
82
|
<div
|
|
83
|
-
class="css-
|
|
83
|
+
class="css-1q83rf3-fieldName"
|
|
84
84
|
>
|
|
85
85
|
Name
|
|
86
86
|
</div>
|
|
@@ -96,7 +96,7 @@ exports[`open up a widget 1`] = `
|
|
|
96
96
|
class="css-1m8nxnb-field"
|
|
97
97
|
>
|
|
98
98
|
<div
|
|
99
|
-
class="css-
|
|
99
|
+
class="css-1q83rf3-fieldName"
|
|
100
100
|
>
|
|
101
101
|
Length
|
|
102
102
|
</div>
|
|
@@ -112,7 +112,7 @@ exports[`open up a widget 1`] = `
|
|
|
112
112
|
class="css-1m8nxnb-field"
|
|
113
113
|
>
|
|
114
114
|
<div
|
|
115
|
-
class="css-
|
|
115
|
+
class="css-1q83rf3-fieldName"
|
|
116
116
|
>
|
|
117
117
|
Type
|
|
118
118
|
</div>
|
|
@@ -136,7 +136,7 @@ exports[`open up a widget 1`] = `
|
|
|
136
136
|
class="css-1m8nxnb-field"
|
|
137
137
|
>
|
|
138
138
|
<div
|
|
139
|
-
class="css-
|
|
139
|
+
class="css-1q83rf3-fieldName"
|
|
140
140
|
style="width: 96px;"
|
|
141
141
|
>
|
|
142
142
|
seq
|
|
@@ -153,7 +153,7 @@ exports[`open up a widget 1`] = `
|
|
|
153
153
|
class="css-1m8nxnb-field"
|
|
154
154
|
>
|
|
155
155
|
<div
|
|
156
|
-
class="css-
|
|
156
|
+
class="css-1q83rf3-fieldName"
|
|
157
157
|
style="width: 96px;"
|
|
158
158
|
>
|
|
159
159
|
score
|
|
@@ -170,7 +170,7 @@ exports[`open up a widget 1`] = `
|
|
|
170
170
|
class="css-1m8nxnb-field"
|
|
171
171
|
>
|
|
172
172
|
<div
|
|
173
|
-
class="css-
|
|
173
|
+
class="css-1q83rf3-fieldName"
|
|
174
174
|
style="width: 96px;"
|
|
175
175
|
>
|
|
176
176
|
qual
|
|
@@ -197,7 +197,7 @@ exports[`open up a widget 1`] = `
|
|
|
197
197
|
class="css-1m8nxnb-field"
|
|
198
198
|
>
|
|
199
199
|
<div
|
|
200
|
-
class="css-
|
|
200
|
+
class="css-1q83rf3-fieldName"
|
|
201
201
|
style="width: 96px;"
|
|
202
202
|
>
|
|
203
203
|
MQ
|
|
@@ -214,7 +214,7 @@ exports[`open up a widget 1`] = `
|
|
|
214
214
|
class="css-1m8nxnb-field"
|
|
215
215
|
>
|
|
216
216
|
<div
|
|
217
|
-
class="css-
|
|
217
|
+
class="css-1q83rf3-fieldName"
|
|
218
218
|
style="width: 96px;"
|
|
219
219
|
>
|
|
220
220
|
CIGAR
|
|
@@ -231,7 +231,7 @@ exports[`open up a widget 1`] = `
|
|
|
231
231
|
class="css-1m8nxnb-field"
|
|
232
232
|
>
|
|
233
233
|
<div
|
|
234
|
-
class="css-
|
|
234
|
+
class="css-1q83rf3-fieldName"
|
|
235
235
|
style="width: 96px;"
|
|
236
236
|
>
|
|
237
237
|
length_on_ref
|
|
@@ -248,7 +248,7 @@ exports[`open up a widget 1`] = `
|
|
|
248
248
|
class="css-1m8nxnb-field"
|
|
249
249
|
>
|
|
250
250
|
<div
|
|
251
|
-
class="css-
|
|
251
|
+
class="css-1q83rf3-fieldName"
|
|
252
252
|
style="width: 96px;"
|
|
253
253
|
>
|
|
254
254
|
template_length
|
|
@@ -265,7 +265,7 @@ exports[`open up a widget 1`] = `
|
|
|
265
265
|
class="css-1m8nxnb-field"
|
|
266
266
|
>
|
|
267
267
|
<div
|
|
268
|
-
class="css-
|
|
268
|
+
class="css-1q83rf3-fieldName"
|
|
269
269
|
style="width: 96px;"
|
|
270
270
|
>
|
|
271
271
|
seq_length
|
|
@@ -151,7 +151,7 @@ export default class BamAdapter extends BaseFeatureDataAdapter {
|
|
|
151
151
|
const trimEnd = Math.min(end - chunkStart, chunkEnd - chunkStart)
|
|
152
152
|
const trimLength = trimEnd - trimStart
|
|
153
153
|
const chunkSeq = chunk.get('seq') || chunk.get('residues')
|
|
154
|
-
sequence += chunkSeq.
|
|
154
|
+
sequence += chunkSeq.slice(trimStart, trimStart + trimLength)
|
|
155
155
|
})
|
|
156
156
|
|
|
157
157
|
if (sequence.length !== end - start) {
|
|
@@ -230,7 +230,7 @@ export default class BamAdapter extends BaseFeatureDataAdapter {
|
|
|
230
230
|
async estimateRegionsStats(regions: Region[], opts?: BaseOptions) {
|
|
231
231
|
const { bam } = await this.configure()
|
|
232
232
|
// this is a method to avoid calling on htsget adapters
|
|
233
|
-
// @ts-
|
|
233
|
+
// @ts-expect-error
|
|
234
234
|
if (bam.index.filehandle !== '?') {
|
|
235
235
|
const bytes = await bytesForRegions(regions, bam)
|
|
236
236
|
const fetchSizeLimit = this.getConf('fetchSizeLimit')
|
|
@@ -97,9 +97,9 @@ export default class BamSlightlyLazyFeature implements Feature {
|
|
|
97
97
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
98
98
|
get(field: string): any {
|
|
99
99
|
const methodName = `_get_${field}`
|
|
100
|
-
// @ts-
|
|
100
|
+
// @ts-expect-error
|
|
101
101
|
if (this[methodName]) {
|
|
102
|
-
// @ts-
|
|
102
|
+
// @ts-expect-error
|
|
103
103
|
return this[methodName]()
|
|
104
104
|
}
|
|
105
105
|
return this.record.get(field)
|
|
@@ -124,7 +124,7 @@ export default class CramAdapter extends BaseFeatureDataAdapter {
|
|
|
124
124
|
const trimEnd = Math.min(end - chunkStart, chunkEnd - chunkStart)
|
|
125
125
|
const trimLength = trimEnd - trimStart
|
|
126
126
|
const chunkSeq = chunk.get('seq') || chunk.get('residues')
|
|
127
|
-
return chunkSeq.
|
|
127
|
+
return chunkSeq.slice(trimStart, trimStart + trimLength)
|
|
128
128
|
})
|
|
129
129
|
.join('')
|
|
130
130
|
|
|
@@ -253,7 +253,7 @@ export default class CramAdapter extends BaseFeatureDataAdapter {
|
|
|
253
253
|
|
|
254
254
|
if (tagFilter) {
|
|
255
255
|
filtered = filtered.filter(record => {
|
|
256
|
-
// @ts-
|
|
256
|
+
// @ts-expect-error
|
|
257
257
|
const val = record[tagFilter.tag]
|
|
258
258
|
return val === '*' ? val !== undefined : val === tagFilter.value
|
|
259
259
|
})
|
|
@@ -131,9 +131,9 @@ export default class CramSlightlyLazyFeature implements Feature {
|
|
|
131
131
|
|
|
132
132
|
get(field: string) {
|
|
133
133
|
const methodName = `_get_${field}`
|
|
134
|
-
// @ts-
|
|
134
|
+
// @ts-expect-error
|
|
135
135
|
if (this[methodName]) {
|
|
136
|
-
// @ts-
|
|
136
|
+
// @ts-expect-error
|
|
137
137
|
return this[methodName]()
|
|
138
138
|
}
|
|
139
139
|
return undefined
|
package/src/CramAdapter/util.ts
CHANGED
|
@@ -153,7 +153,7 @@ export function readFeaturesToCIGAR(
|
|
|
153
153
|
for (let i = 0; i < readFeatures.length; i++) {
|
|
154
154
|
const { code, refPos, sub, data } = readFeatures[i]
|
|
155
155
|
sublen = refPos - lastPos
|
|
156
|
-
seq += ref.
|
|
156
|
+
seq += ref.slice(lastPos - refStart, refPos - refStart)
|
|
157
157
|
lastPos = refPos
|
|
158
158
|
|
|
159
159
|
if (insLen > 0 && sublen) {
|
|
@@ -161,7 +161,7 @@ export function readFeaturesToCIGAR(
|
|
|
161
161
|
insLen = 0
|
|
162
162
|
}
|
|
163
163
|
if (oplen && op !== 'M') {
|
|
164
|
-
cigar += oplen
|
|
164
|
+
cigar += `${oplen}${op}`
|
|
165
165
|
oplen = 0
|
|
166
166
|
}
|
|
167
167
|
if (sublen) {
|
|
@@ -190,7 +190,7 @@ export function readFeaturesToCIGAR(
|
|
|
190
190
|
// Deletion or Ref Skip
|
|
191
191
|
lastPos += data
|
|
192
192
|
if (oplen) {
|
|
193
|
-
cigar += oplen
|
|
193
|
+
cigar += `${oplen}${op}`
|
|
194
194
|
}
|
|
195
195
|
cigar += data + code
|
|
196
196
|
oplen = 0
|
|
@@ -198,7 +198,7 @@ export function readFeaturesToCIGAR(
|
|
|
198
198
|
// Insertion or soft-clip
|
|
199
199
|
seq += data
|
|
200
200
|
if (oplen) {
|
|
201
|
-
cigar += oplen
|
|
201
|
+
cigar += `${oplen}${op}`
|
|
202
202
|
}
|
|
203
203
|
cigar += data.length + code
|
|
204
204
|
oplen = 0
|
|
@@ -206,7 +206,7 @@ export function readFeaturesToCIGAR(
|
|
|
206
206
|
// Single base insertion
|
|
207
207
|
// seq += data
|
|
208
208
|
if (oplen) {
|
|
209
|
-
cigar += oplen
|
|
209
|
+
cigar += `${oplen}${op}`
|
|
210
210
|
}
|
|
211
211
|
insLen++
|
|
212
212
|
seq += data
|
|
@@ -214,13 +214,13 @@ export function readFeaturesToCIGAR(
|
|
|
214
214
|
} else if (code === 'P') {
|
|
215
215
|
// Padding
|
|
216
216
|
if (oplen) {
|
|
217
|
-
cigar += oplen
|
|
217
|
+
cigar += `${oplen}${op}`
|
|
218
218
|
}
|
|
219
219
|
cigar += `${data}P`
|
|
220
220
|
} else if (code === 'H') {
|
|
221
221
|
// Hard clip
|
|
222
222
|
if (oplen) {
|
|
223
|
-
cigar += oplen
|
|
223
|
+
cigar += `${oplen}${op}`
|
|
224
224
|
}
|
|
225
225
|
cigar += `${data}H`
|
|
226
226
|
oplen = 0
|
|
@@ -231,10 +231,10 @@ export function readFeaturesToCIGAR(
|
|
|
231
231
|
}
|
|
232
232
|
if (seq.length !== readLen) {
|
|
233
233
|
sublen = readLen - seq.length
|
|
234
|
-
seq += ref.
|
|
234
|
+
seq += ref.slice(lastPos - refStart, lastPos - refStart + sublen)
|
|
235
235
|
|
|
236
236
|
if (oplen && op !== 'M') {
|
|
237
|
-
cigar += oplen
|
|
237
|
+
cigar += `${oplen}${op}`
|
|
238
238
|
oplen = 0
|
|
239
239
|
}
|
|
240
240
|
op = 'M'
|
|
@@ -244,7 +244,7 @@ export function readFeaturesToCIGAR(
|
|
|
244
244
|
cigar += `${insLen}I`
|
|
245
245
|
}
|
|
246
246
|
if (oplen) {
|
|
247
|
-
cigar += oplen
|
|
247
|
+
cigar += `${oplen}${op}`
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
return cigar
|
|
@@ -7,13 +7,13 @@ import { ResizeHandle } from '@jbrowse/core/ui'
|
|
|
7
7
|
// locals
|
|
8
8
|
import { AlignmentsDisplayModel } from '../models/model'
|
|
9
9
|
|
|
10
|
-
const useStyles = makeStyles()(
|
|
10
|
+
const useStyles = makeStyles()({
|
|
11
11
|
resizeHandle: {
|
|
12
12
|
height: 2,
|
|
13
13
|
position: 'absolute',
|
|
14
14
|
zIndex: 2,
|
|
15
15
|
},
|
|
16
|
-
})
|
|
16
|
+
})
|
|
17
17
|
|
|
18
18
|
function AlignmentsDisplay({ model }: { model: AlignmentsDisplayModel }) {
|
|
19
19
|
const { PileupDisplay, SNPCoverageDisplay } = model
|
|
@@ -21,6 +21,14 @@ export default function configModelFactory(pm: PluginManager) {
|
|
|
21
21
|
*/
|
|
22
22
|
snpCoverageDisplay: pm.getDisplayType('LinearSNPCoverageDisplay')
|
|
23
23
|
.configSchema,
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* #slot
|
|
27
|
+
*/
|
|
28
|
+
height: {
|
|
29
|
+
type: 'number',
|
|
30
|
+
defaultValue: 250,
|
|
31
|
+
},
|
|
24
32
|
},
|
|
25
33
|
{
|
|
26
34
|
/**
|
|
@@ -27,9 +27,9 @@ function getLowerPanelDisplays(pluginManager: PluginManager) {
|
|
|
27
27
|
return (
|
|
28
28
|
pluginManager
|
|
29
29
|
.getDisplayElements()
|
|
30
|
-
// @ts-
|
|
30
|
+
// @ts-expect-error
|
|
31
31
|
.filter(f => f.subDisplay?.type === 'LinearAlignmentsDisplay')
|
|
32
|
-
// @ts-
|
|
32
|
+
// @ts-expect-error
|
|
33
33
|
.filter(f => f.subDisplay?.lowerPanel)
|
|
34
34
|
)
|
|
35
35
|
}
|
|
@@ -87,7 +87,6 @@ function AlignmentsModel(
|
|
|
87
87
|
* #property
|
|
88
88
|
* refers to LinearPileupDisplay sub-display model
|
|
89
89
|
*/
|
|
90
|
-
// @ts-ignore
|
|
91
90
|
PileupDisplay: types.maybe(types.union(...lowerPanelDisplays)),
|
|
92
91
|
/**
|
|
93
92
|
* #property
|
|
@@ -111,7 +110,7 @@ function AlignmentsModel(
|
|
|
111
110
|
/**
|
|
112
111
|
* #property
|
|
113
112
|
*/
|
|
114
|
-
|
|
113
|
+
heightPreConfig: types.maybe(types.number),
|
|
115
114
|
/**
|
|
116
115
|
* #property
|
|
117
116
|
*/
|
|
@@ -155,6 +154,14 @@ function stateModelFactory(
|
|
|
155
154
|
self.snpCovHeight = n
|
|
156
155
|
},
|
|
157
156
|
}))
|
|
157
|
+
.views(self => ({
|
|
158
|
+
/**
|
|
159
|
+
* #getter
|
|
160
|
+
*/
|
|
161
|
+
get height() {
|
|
162
|
+
return self.heightPreConfig ?? getConf(self, 'height')
|
|
163
|
+
},
|
|
164
|
+
}))
|
|
158
165
|
.views(self => ({
|
|
159
166
|
/**
|
|
160
167
|
* #getter
|
|
@@ -245,8 +252,8 @@ function stateModelFactory(
|
|
|
245
252
|
* #action
|
|
246
253
|
*/
|
|
247
254
|
setHeight(n: number) {
|
|
248
|
-
self.
|
|
249
|
-
return self.
|
|
255
|
+
self.heightPreConfig = Math.max(n, minDisplayHeight)
|
|
256
|
+
return self.heightPreConfig
|
|
250
257
|
},
|
|
251
258
|
/**
|
|
252
259
|
* #action
|
|
@@ -369,6 +376,14 @@ function stateModelFactory(
|
|
|
369
376
|
},
|
|
370
377
|
}
|
|
371
378
|
})
|
|
379
|
+
.preProcessSnapshot(snap => {
|
|
380
|
+
if (!snap) {
|
|
381
|
+
return snap
|
|
382
|
+
}
|
|
383
|
+
// @ts-expect-error
|
|
384
|
+
const { height, ...rest } = snap
|
|
385
|
+
return { heightPreConfig: height, ...rest }
|
|
386
|
+
})
|
|
372
387
|
}
|
|
373
388
|
|
|
374
389
|
export default stateModelFactory
|
|
@@ -20,7 +20,5 @@ export default function register(pluginManager: PluginManager) {
|
|
|
20
20
|
})
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
export {
|
|
24
|
-
|
|
25
|
-
configSchemaFactory as linearPileupDisplayConfigSchemaFactory,
|
|
26
|
-
}
|
|
23
|
+
export { default as linearPileupDisplayStateModelFactory } from './model'
|
|
24
|
+
export { default as linearPileupDisplayConfigSchemaFactory } from './configSchema'
|
|
@@ -275,7 +275,7 @@ function stateModelFactory(configSchema: AnyConfigurationSchemaType) {
|
|
|
275
275
|
if (sortedBy) {
|
|
276
276
|
const { pos, refName, assemblyName } = sortedBy
|
|
277
277
|
// render just the sorted region first
|
|
278
|
-
// @ts-
|
|
278
|
+
// @ts-expect-error
|
|
279
279
|
await self.rendererType.renderInClient(rpcManager, {
|
|
280
280
|
assemblyName,
|
|
281
281
|
regions: [
|
|
@@ -337,9 +337,9 @@ function stateModelFactory(configSchema: AnyConfigurationSchemaType) {
|
|
|
337
337
|
// feature.id that was returned e.g. that the user hasn't
|
|
338
338
|
// moused over to a new position during the async operation
|
|
339
339
|
// above
|
|
340
|
-
// @ts-
|
|
340
|
+
// @ts-expect-error
|
|
341
341
|
if (self.featureIdUnderMouse === feature.uniqueId) {
|
|
342
|
-
// @ts-
|
|
342
|
+
// @ts-expect-error
|
|
343
343
|
self.setFeatureUnderMouse(new SimpleFeature(feature))
|
|
344
344
|
}
|
|
345
345
|
}
|
|
@@ -617,7 +617,7 @@ function stateModelFactory(configSchema: AnyConfigurationSchemaType) {
|
|
|
617
617
|
)) as { feature: unknown }
|
|
618
618
|
|
|
619
619
|
if (feature) {
|
|
620
|
-
// @ts-
|
|
620
|
+
// @ts-expect-error
|
|
621
621
|
self.selectFeature(new SimpleFeature(feature))
|
|
622
622
|
}
|
|
623
623
|
}
|
|
@@ -14,18 +14,20 @@ import { LinearReadArcsDisplayModel } from '../model'
|
|
|
14
14
|
|
|
15
15
|
type LGV = LinearGenomeViewModel
|
|
16
16
|
|
|
17
|
-
const useStyles = makeStyles()(theme =>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
17
|
+
const useStyles = makeStyles()(theme => {
|
|
18
|
+
const bg = theme.palette.action.disabledBackground
|
|
19
|
+
return {
|
|
20
|
+
loading: {
|
|
21
|
+
paddingLeft: '0.6em',
|
|
22
|
+
backgroundColor: theme.palette.background.default,
|
|
23
|
+
backgroundImage: `repeating-linear-gradient(45deg, transparent, transparent 5px, ${bg} 5px, ${bg} 10px)`,
|
|
24
|
+
height: '100%',
|
|
25
|
+
width: '100%',
|
|
26
|
+
pointerEvents: 'none',
|
|
27
|
+
textAlign: 'center',
|
|
28
|
+
},
|
|
29
|
+
}
|
|
30
|
+
})
|
|
29
31
|
|
|
30
32
|
const Arcs = observer(function ({
|
|
31
33
|
model,
|
|
@@ -22,11 +22,16 @@ import FilterListIcon from '@mui/icons-material/ClearAll'
|
|
|
22
22
|
import { FilterModel } from '../shared'
|
|
23
23
|
import drawFeats from './drawFeats'
|
|
24
24
|
import { fetchChains, ChainData } from '../shared/fetchChains'
|
|
25
|
-
import { ExportSvgOptions } from '@jbrowse/plugin-linear-genome-view/src/LinearGenomeView'
|
|
26
25
|
|
|
27
26
|
// async
|
|
28
27
|
const FilterByTagDlg = lazy(() => import('../shared/FilterByTag'))
|
|
29
28
|
|
|
29
|
+
// stabilize clipid under test for snapshot
|
|
30
|
+
function getId(id: string) {
|
|
31
|
+
const isJest = typeof jest === 'undefined'
|
|
32
|
+
return `arc-clip-${isJest ? id : 'jest'}`
|
|
33
|
+
}
|
|
34
|
+
|
|
30
35
|
interface Filter {
|
|
31
36
|
flagInclude: number
|
|
32
37
|
flagExclude: number
|
|
@@ -333,7 +338,7 @@ function stateModelFactory(configSchema: AnyConfigurationSchemaType) {
|
|
|
333
338
|
/**
|
|
334
339
|
* #method
|
|
335
340
|
*/
|
|
336
|
-
async renderSvg(opts:
|
|
341
|
+
async renderSvg(opts: { rasterizeLayers?: boolean }) {
|
|
337
342
|
const view = getContainingView(self) as LGV
|
|
338
343
|
const width = view.dynamicBlocks.totalWidthPx
|
|
339
344
|
const height = self.height
|
|
@@ -360,13 +365,26 @@ function stateModelFactory(configSchema: AnyConfigurationSchemaType) {
|
|
|
360
365
|
const C2S = await import('canvas2svg')
|
|
361
366
|
const ctx = new C2S.default(width, height)
|
|
362
367
|
await drawFeats(self, ctx)
|
|
368
|
+
const clipid = getId(self.id)
|
|
363
369
|
str = (
|
|
364
|
-
|
|
365
|
-
|
|
370
|
+
<>
|
|
371
|
+
<defs>
|
|
372
|
+
<clipPath id={clipid}>
|
|
373
|
+
<rect x={0} y={0} width={width} height={height} />
|
|
374
|
+
</clipPath>
|
|
375
|
+
</defs>
|
|
376
|
+
<g
|
|
377
|
+
/* eslint-disable-next-line react/no-danger */
|
|
378
|
+
dangerouslySetInnerHTML={{
|
|
379
|
+
__html: ctx.getSvg().innerHTML,
|
|
380
|
+
}}
|
|
381
|
+
clipPath={`url(#${clipid})`}
|
|
382
|
+
/>
|
|
383
|
+
</>
|
|
366
384
|
)
|
|
367
385
|
}
|
|
368
386
|
|
|
369
|
-
return
|
|
387
|
+
return <>{str}</>
|
|
370
388
|
},
|
|
371
389
|
}))
|
|
372
390
|
.actions(self => ({
|
|
@@ -17,10 +17,7 @@ import FilterListIcon from '@mui/icons-material/ClearAll'
|
|
|
17
17
|
import { FilterModel } from '../shared'
|
|
18
18
|
import { fetchChains, ChainData } from '../shared/fetchChains'
|
|
19
19
|
import drawFeats from './drawFeats'
|
|
20
|
-
import {
|
|
21
|
-
ExportSvgOptions,
|
|
22
|
-
LinearGenomeViewModel,
|
|
23
|
-
} from '@jbrowse/plugin-linear-genome-view/src/LinearGenomeView'
|
|
20
|
+
import { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
|
|
24
21
|
|
|
25
22
|
// async
|
|
26
23
|
const FilterByTagDlg = lazy(() => import('../shared/FilterByTag'))
|
|
@@ -32,6 +29,12 @@ interface Filter {
|
|
|
32
29
|
tagFilter?: { tag: string; value: string }
|
|
33
30
|
}
|
|
34
31
|
|
|
32
|
+
// stabilize clipid under test for snapshot
|
|
33
|
+
function getId(id: string) {
|
|
34
|
+
const isJest = typeof jest === 'undefined'
|
|
35
|
+
return `cloud-clip-${isJest ? id : 'jest'}`
|
|
36
|
+
}
|
|
37
|
+
|
|
35
38
|
/**
|
|
36
39
|
* #stateModel LinearReadCloudDisplay
|
|
37
40
|
* extends `BaseLinearDisplay`
|
|
@@ -205,7 +208,7 @@ function stateModelFactory(configSchema: AnyConfigurationSchemaType) {
|
|
|
205
208
|
/**
|
|
206
209
|
* #method
|
|
207
210
|
*/
|
|
208
|
-
async renderSvg(opts:
|
|
211
|
+
async renderSvg(opts: { rasterizeLayers?: boolean }) {
|
|
209
212
|
const view = getContainingView(self) as LinearGenomeViewModel
|
|
210
213
|
const width = view.dynamicBlocks.totalWidthPx
|
|
211
214
|
const height = self.height
|
|
@@ -232,9 +235,22 @@ function stateModelFactory(configSchema: AnyConfigurationSchemaType) {
|
|
|
232
235
|
const C2S = await import('canvas2svg')
|
|
233
236
|
const ctx = new C2S.default(width, height)
|
|
234
237
|
await drawFeats(self, ctx)
|
|
238
|
+
const clipid = getId(self.id)
|
|
235
239
|
str = (
|
|
236
|
-
|
|
237
|
-
|
|
240
|
+
<>
|
|
241
|
+
<defs>
|
|
242
|
+
<clipPath id={clipid}>
|
|
243
|
+
<rect x={0} y={0} width={width} height={height} />
|
|
244
|
+
</clipPath>
|
|
245
|
+
</defs>
|
|
246
|
+
<g
|
|
247
|
+
/* eslint-disable-next-line react/no-danger */
|
|
248
|
+
dangerouslySetInnerHTML={{
|
|
249
|
+
__html: ctx.getSvg().innerHTML,
|
|
250
|
+
}}
|
|
251
|
+
clipPath={`url(#${clipid})`}
|
|
252
|
+
/>
|
|
253
|
+
</>
|
|
238
254
|
)
|
|
239
255
|
}
|
|
240
256
|
|
|
@@ -25,7 +25,7 @@ export function cigarToMismatches(
|
|
|
25
25
|
seq?: string,
|
|
26
26
|
ref?: string,
|
|
27
27
|
qual?: Buffer,
|
|
28
|
-
)
|
|
28
|
+
) {
|
|
29
29
|
let roffset = 0 // reference offset
|
|
30
30
|
let soffset = 0 // seq offset
|
|
31
31
|
const mismatches: Mismatch[] = []
|
|
@@ -125,7 +125,7 @@ export function mdToMismatches(
|
|
|
125
125
|
cigarMismatches: Mismatch[],
|
|
126
126
|
seq: string,
|
|
127
127
|
qual?: Buffer,
|
|
128
|
-
)
|
|
128
|
+
) {
|
|
129
129
|
const mismatchRecords: Mismatch[] = []
|
|
130
130
|
let curr: Mismatch = { start: 0, base: '', length: 0, type: 'mismatch' }
|
|
131
131
|
const skips = cigarMismatches.filter(cigar => cigar.type === 'skip')
|
|
@@ -216,7 +216,7 @@ export function getMismatches(
|
|
|
216
216
|
seq?: string,
|
|
217
217
|
ref?: string,
|
|
218
218
|
qual?: Buffer,
|
|
219
|
-
)
|
|
219
|
+
) {
|
|
220
220
|
let mismatches: Mismatch[] = []
|
|
221
221
|
const ops = parseCigar(cigar)
|
|
222
222
|
|
|
@@ -330,20 +330,19 @@ export function getModificationTypes(mm: string) {
|
|
|
330
330
|
const mods = mm.split(';')
|
|
331
331
|
return mods
|
|
332
332
|
.filter(mod => !!mod)
|
|
333
|
-
.
|
|
333
|
+
.flatMap(mod => {
|
|
334
334
|
const [basemod] = mod.split(',')
|
|
335
335
|
|
|
336
336
|
const matches = basemod.match(modificationRegex)
|
|
337
337
|
if (!matches) {
|
|
338
338
|
throw new Error(`bad format for MM tag: ${mm}`)
|
|
339
339
|
}
|
|
340
|
-
const
|
|
340
|
+
const typestr = matches[3]
|
|
341
341
|
|
|
342
342
|
// can be a multi e.g. C+mh for both meth (m) and hydroxymeth (h) so
|
|
343
343
|
// split, and they can also be chemical codes (ChEBI) e.g. C+16061
|
|
344
344
|
return typestr.split(/(\d+|.)/).filter(f => !!f)
|
|
345
345
|
})
|
|
346
|
-
.flat()
|
|
347
346
|
}
|
|
348
347
|
|
|
349
348
|
export function getOrientedCigar(flip: boolean, cigar: string[]) {
|
|
@@ -357,8 +356,7 @@ export function getOrientedCigar(flip: boolean, cigar: string[]) {
|
|
|
357
356
|
} else if (op === 'I') {
|
|
358
357
|
op = 'D'
|
|
359
358
|
}
|
|
360
|
-
ret.push(len)
|
|
361
|
-
ret.push(op)
|
|
359
|
+
ret.push(len, op)
|
|
362
360
|
}
|
|
363
361
|
return ret
|
|
364
362
|
} else {
|
|
@@ -27,11 +27,7 @@ export default class NestedFrequencyTable {
|
|
|
27
27
|
amount = 1
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
slotName = 'default'
|
|
32
|
-
} else {
|
|
33
|
-
slotName = slotName.toString()
|
|
34
|
-
}
|
|
30
|
+
slotName = slotName ? slotName.toString() : 'default'
|
|
35
31
|
|
|
36
32
|
if (this.categories[slotName]) {
|
|
37
33
|
this.categories[slotName] = Math.max(
|
|
@@ -49,11 +45,7 @@ export default class NestedFrequencyTable {
|
|
|
49
45
|
amount = 1
|
|
50
46
|
}
|
|
51
47
|
|
|
52
|
-
|
|
53
|
-
slotName = 'default'
|
|
54
|
-
} else {
|
|
55
|
-
slotName = slotName.toString()
|
|
56
|
-
}
|
|
48
|
+
slotName = slotName ? slotName.toString() : 'default'
|
|
57
49
|
|
|
58
50
|
this.categories[slotName] = (this.categories[slotName] || 0) + amount
|
|
59
51
|
return this.categories[slotName]
|
|
@@ -71,7 +63,7 @@ export default class NestedFrequencyTable {
|
|
|
71
63
|
path = path.split('/')
|
|
72
64
|
}
|
|
73
65
|
|
|
74
|
-
if (
|
|
66
|
+
if (path.length === 0) {
|
|
75
67
|
return this
|
|
76
68
|
}
|
|
77
69
|
|