@jbrowse/plugin-alignments 1.5.8 → 1.6.2
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.d.ts +5 -0
- package/dist/BamAdapter/BamSlightlyLazyFeature.d.ts +1 -2
- package/dist/CramAdapter/CramAdapter.d.ts +16 -5
- package/dist/LinearAlignmentsDisplay/models/model.d.ts +2 -1
- package/dist/LinearPileupDisplay/model.d.ts +28 -6
- package/dist/LinearSNPCoverageDisplay/models/model.d.ts +3 -0
- package/dist/SNPCoverageAdapter/SNPCoverageAdapter.d.ts +1 -0
- package/dist/plugin-alignments.cjs.development.js +557 -346
- package/dist/plugin-alignments.cjs.development.js.map +1 -1
- package/dist/plugin-alignments.cjs.production.min.js +1 -1
- package/dist/plugin-alignments.cjs.production.min.js.map +1 -1
- package/dist/plugin-alignments.esm.js +557 -346
- package/dist/plugin-alignments.esm.js.map +1 -1
- package/package.json +3 -3
- package/src/BamAdapter/BamAdapter.ts +56 -35
- package/src/BamAdapter/BamSlightlyLazyFeature.ts +18 -25
- package/src/BamAdapter/configSchema.ts +2 -2
- package/src/CramAdapter/CramAdapter.ts +105 -91
- package/src/CramAdapter/configSchema.ts +5 -1
- package/src/LinearAlignmentsDisplay/models/model.tsx +4 -3
- package/src/LinearPileupDisplay/configSchema.ts +3 -3
- package/src/LinearPileupDisplay/model.ts +8 -7
- package/src/LinearSNPCoverageDisplay/models/configSchema.ts +1 -5
- package/src/LinearSNPCoverageDisplay/models/model.ts +3 -2
- package/src/PileupRenderer/PileupRenderer.tsx +5 -3
- package/src/SNPCoverageAdapter/SNPCoverageAdapter.ts +5 -0
- package/src/index.ts +22 -15
|
@@ -39,11 +39,7 @@ export default function SNPCoverageConfigFactory(pluginManager: PluginManager) {
|
|
|
39
39
|
description: 'draw upside down',
|
|
40
40
|
defaultValue: false,
|
|
41
41
|
},
|
|
42
|
-
|
|
43
|
-
type: 'number',
|
|
44
|
-
description: 'maximum bpPerPx that is displayed in the view',
|
|
45
|
-
defaultValue: 100,
|
|
46
|
-
},
|
|
42
|
+
|
|
47
43
|
headroom: {
|
|
48
44
|
type: 'number',
|
|
49
45
|
description:
|
|
@@ -131,9 +131,10 @@ const stateModelFactory = (
|
|
|
131
131
|
},
|
|
132
132
|
|
|
133
133
|
renderProps() {
|
|
134
|
+
const superProps = superRenderProps()
|
|
134
135
|
return {
|
|
135
|
-
...
|
|
136
|
-
notReady:
|
|
136
|
+
...superProps,
|
|
137
|
+
notReady: superProps.notReady || !this.modificationsReady,
|
|
137
138
|
filters: self.filters,
|
|
138
139
|
modificationTagMap: JSON.parse(
|
|
139
140
|
JSON.stringify(self.modificationTagMap),
|
|
@@ -682,11 +682,13 @@ export default class PileupRenderer extends BoxRendererType {
|
|
|
682
682
|
const baseColor = colorForBase.deletion
|
|
683
683
|
ctx.fillStyle = baseColor
|
|
684
684
|
ctx.fillRect(leftPx, topPx, widthPx, heightPx)
|
|
685
|
-
|
|
685
|
+
const txt = `${mismatch.length}`
|
|
686
|
+
const rect = ctx.measureText(txt)
|
|
687
|
+
if (widthPx >= rect.width && heightPx >= heightLim) {
|
|
686
688
|
ctx.fillStyle = theme.palette.getContrastText(baseColor)
|
|
687
689
|
ctx.fillText(
|
|
688
|
-
|
|
689
|
-
leftPx + (
|
|
690
|
+
txt,
|
|
691
|
+
leftPx + (rightPx - leftPx) / 2 - rect.width / 2,
|
|
690
692
|
topPx + heightPx,
|
|
691
693
|
)
|
|
692
694
|
}
|
|
@@ -125,6 +125,11 @@ export default class SNPCoverageAdapter extends BaseFeatureDataAdapter {
|
|
|
125
125
|
}, opts.signal)
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
+
async estimateRegionsStats(regions: Region[], opts?: BaseOptions) {
|
|
129
|
+
const { subadapter } = await this.configure()
|
|
130
|
+
return subadapter.estimateRegionsStats(regions, opts)
|
|
131
|
+
}
|
|
132
|
+
|
|
128
133
|
async getRefNames(opts: BaseOptions = {}) {
|
|
129
134
|
const { subadapter } = await this.configure()
|
|
130
135
|
return subadapter.getRefNames(opts)
|
package/src/index.ts
CHANGED
|
@@ -60,12 +60,15 @@ export default class AlignmentsPlugin extends Plugin {
|
|
|
60
60
|
const regexGuess = /\.cram$/i
|
|
61
61
|
const adapterName = 'CramAdapter'
|
|
62
62
|
const fileName = getFileName(file)
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
63
|
+
const obj = {
|
|
64
|
+
type: adapterName,
|
|
65
|
+
cramLocation: file,
|
|
66
|
+
craiLocation: index || makeIndex(file, '.crai'),
|
|
67
|
+
}
|
|
68
|
+
if (regexGuess.test(fileName) && !adapterHint) {
|
|
69
|
+
return obj
|
|
70
|
+
} else if (adapterHint === adapterName) {
|
|
71
|
+
return obj
|
|
69
72
|
}
|
|
70
73
|
return adapterGuesser(file, index, adapterHint)
|
|
71
74
|
}
|
|
@@ -84,15 +87,19 @@ export default class AlignmentsPlugin extends Plugin {
|
|
|
84
87
|
const adapterName = 'BamAdapter'
|
|
85
88
|
const fileName = getFileName(file)
|
|
86
89
|
const indexName = index && getFileName(index)
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
90
|
+
|
|
91
|
+
const obj = {
|
|
92
|
+
type: adapterName,
|
|
93
|
+
bamLocation: file,
|
|
94
|
+
index: {
|
|
95
|
+
location: index || makeIndex(file, '.bai'),
|
|
96
|
+
indexType: makeIndexType(indexName, 'CSI', 'BAI'),
|
|
97
|
+
},
|
|
98
|
+
}
|
|
99
|
+
if (regexGuess.test(fileName) && !adapterHint) {
|
|
100
|
+
return obj
|
|
101
|
+
} else if (adapterHint === adapterName) {
|
|
102
|
+
return obj
|
|
96
103
|
}
|
|
97
104
|
return adapterGuesser(file, index, adapterHint)
|
|
98
105
|
}
|