jbrowse-plugin-mafviewer 1.0.8 → 1.1.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/README.md +54 -20
- package/dist/{TaffyAdapter/TaffyAdapter.d.ts → BgzipTaffyAdapter/BgzipTaffyAdapter.d.ts} +11 -7
- package/dist/BgzipTaffyAdapter/BgzipTaffyAdapter.js +204 -0
- package/dist/BgzipTaffyAdapter/BgzipTaffyAdapter.js.map +1 -0
- package/dist/{TaffyAdapter → BgzipTaffyAdapter}/configSchema.d.ts +14 -1
- package/dist/{TaffyAdapter → BgzipTaffyAdapter}/configSchema.js +21 -6
- package/dist/BgzipTaffyAdapter/configSchema.js.map +1 -0
- package/dist/BgzipTaffyAdapter/index.d.ts +2 -0
- package/dist/BgzipTaffyAdapter/index.js +11 -0
- package/dist/BgzipTaffyAdapter/index.js.map +1 -0
- package/dist/BgzipTaffyAdapter/rowInstructions.d.ts +35 -0
- package/dist/BgzipTaffyAdapter/rowInstructions.js +55 -0
- package/dist/BgzipTaffyAdapter/rowInstructions.js.map +1 -0
- package/dist/BgzipTaffyAdapter/types.d.ts +13 -0
- package/dist/BgzipTaffyAdapter/types.js +2 -0
- package/dist/BgzipTaffyAdapter/types.js.map +1 -0
- package/dist/BgzipTaffyAdapter/virtualOffset.d.ts +8 -0
- package/dist/BgzipTaffyAdapter/virtualOffset.js +23 -0
- package/dist/BgzipTaffyAdapter/virtualOffset.js.map +1 -0
- package/dist/BigMafAdapter/BigMafAdapter.js +1 -1
- package/dist/BigMafAdapter/BigMafAdapter.js.map +1 -1
- package/dist/BigMafAdapter/configSchema.d.ts +11 -0
- package/dist/BigMafAdapter/configSchema.js +11 -0
- package/dist/BigMafAdapter/configSchema.js.map +1 -1
- package/dist/BigMafAdapter/index.js +1 -1
- package/dist/BigMafAdapter/index.js.map +1 -1
- package/dist/LinearMafDisplay/components/ColorLegend.js +10 -6
- package/dist/LinearMafDisplay/components/ColorLegend.js.map +1 -1
- package/dist/LinearMafDisplay/components/ReactComponent.js +39 -4
- package/dist/LinearMafDisplay/components/ReactComponent.js.map +1 -1
- package/dist/LinearMafDisplay/components/SetRowHeight.js +7 -7
- package/dist/LinearMafDisplay/components/SetRowHeight.js.map +1 -1
- package/dist/LinearMafDisplay/components/SvgWrapper.d.ts +8 -0
- package/dist/LinearMafDisplay/components/SvgWrapper.js +21 -0
- package/dist/LinearMafDisplay/components/SvgWrapper.js.map +1 -0
- package/dist/LinearMafDisplay/components/Tree.d.ts +5 -0
- package/dist/LinearMafDisplay/components/Tree.js +22 -0
- package/dist/LinearMafDisplay/components/Tree.js.map +1 -0
- package/dist/LinearMafDisplay/components/YScaleBars.d.ts +0 -1
- package/dist/LinearMafDisplay/components/YScaleBars.js +6 -27
- package/dist/LinearMafDisplay/components/YScaleBars.js.map +1 -1
- package/dist/LinearMafDisplay/components/util.d.ts +1 -0
- package/dist/LinearMafDisplay/components/util.js +8 -0
- package/dist/LinearMafDisplay/components/util.js.map +1 -0
- package/dist/LinearMafDisplay/index.js +1 -1
- package/dist/LinearMafDisplay/index.js.map +1 -1
- package/dist/LinearMafDisplay/renderSvg.js +1 -0
- package/dist/LinearMafDisplay/renderSvg.js.map +1 -1
- package/dist/LinearMafDisplay/stateModel.d.ts +76 -14
- package/dist/LinearMafDisplay/stateModel.js +118 -18
- package/dist/LinearMafDisplay/stateModel.js.map +1 -1
- package/dist/LinearMafDisplay/types.d.ts +17 -0
- package/dist/LinearMafDisplay/types.js +16 -0
- package/dist/LinearMafDisplay/types.js.map +1 -0
- package/dist/LinearMafRenderer/LinearMafRenderer.d.ts +3 -3
- package/dist/LinearMafRenderer/LinearMafRenderer.js +11 -9
- package/dist/LinearMafRenderer/LinearMafRenderer.js.map +1 -1
- package/dist/LinearMafRenderer/components/ReactComponent.js +1 -1
- package/dist/LinearMafRenderer/components/ReactComponent.js.map +1 -1
- package/dist/LinearMafRenderer/index.js +1 -1
- package/dist/LinearMafRenderer/index.js.map +1 -1
- package/dist/MafAddTrackWorkflow/AddTrackWorkflow.js +42 -25
- package/dist/MafAddTrackWorkflow/AddTrackWorkflow.js.map +1 -1
- package/dist/MafRPC/index.d.ts +16 -0
- package/dist/MafRPC/index.js +19 -0
- package/dist/MafRPC/index.js.map +1 -0
- package/dist/MafTabixAdapter/MafTabixAdapter.d.ts +8 -0
- package/dist/MafTabixAdapter/MafTabixAdapter.js +18 -19
- package/dist/MafTabixAdapter/MafTabixAdapter.js.map +1 -1
- package/dist/MafTabixAdapter/configSchema.d.ts +17 -0
- package/dist/MafTabixAdapter/configSchema.js +17 -1
- package/dist/MafTabixAdapter/configSchema.js.map +1 -1
- package/dist/MafTabixAdapter/index.js +1 -1
- package/dist/MafTabixAdapter/index.js.map +1 -1
- package/dist/MafTrack/index.js.map +1 -1
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/dist/jbrowse-plugin-mafviewer.umd.production.min.js +65 -4
- package/dist/jbrowse-plugin-mafviewer.umd.production.min.js.map +4 -4
- package/dist/parseNewick.d.ts +60 -0
- package/dist/parseNewick.js +95 -0
- package/dist/parseNewick.js.map +1 -0
- package/dist/util.d.ts +9 -0
- package/dist/util.js +9 -0
- package/dist/util.js.map +1 -0
- package/package.json +18 -5
- package/src/BgzipTaffyAdapter/BgzipTaffyAdapter.ts +235 -0
- package/src/{TaffyAdapter → BgzipTaffyAdapter}/configSchema.ts +21 -6
- package/src/{TaffyAdapter → BgzipTaffyAdapter}/index.ts +5 -4
- package/src/BgzipTaffyAdapter/rowInstructions.ts +91 -0
- package/src/BgzipTaffyAdapter/types.ts +16 -0
- package/src/BgzipTaffyAdapter/virtualOffset.ts +29 -0
- package/src/BigMafAdapter/BigMafAdapter.ts +11 -11
- package/src/BigMafAdapter/configSchema.ts +11 -0
- package/src/BigMafAdapter/index.ts +2 -1
- package/src/LinearMafDisplay/components/ColorLegend.tsx +36 -25
- package/src/LinearMafDisplay/components/ReactComponent.tsx +68 -3
- package/src/LinearMafDisplay/components/SetRowHeight.tsx +6 -5
- package/src/LinearMafDisplay/components/SvgWrapper.tsx +39 -0
- package/src/LinearMafDisplay/components/Tree.tsx +33 -0
- package/src/LinearMafDisplay/components/YScaleBars.tsx +8 -43
- package/src/LinearMafDisplay/components/util.ts +7 -0
- package/src/LinearMafDisplay/index.ts +2 -1
- package/src/LinearMafDisplay/renderSvg.tsx +2 -1
- package/src/LinearMafDisplay/stateModel.ts +139 -18
- package/src/LinearMafDisplay/types.ts +41 -0
- package/src/LinearMafRenderer/LinearMafRenderer.ts +13 -10
- package/src/LinearMafRenderer/components/ReactComponent.tsx +2 -1
- package/src/LinearMafRenderer/index.ts +2 -1
- package/src/MafAddTrackWorkflow/AddTrackWorkflow.tsx +109 -65
- package/src/MafRPC/index.ts +39 -0
- package/src/MafTabixAdapter/MafTabixAdapter.ts +31 -25
- package/src/MafTabixAdapter/configSchema.ts +17 -1
- package/src/MafTabixAdapter/index.ts +2 -1
- package/src/MafTrack/index.ts +1 -0
- package/src/index.ts +6 -4
- package/src/parseNewick.ts +94 -0
- package/src/util.ts +11 -0
- package/LICENSE +0 -201
- package/dist/TaffyAdapter/TaffyAdapter.js +0 -89
- package/dist/TaffyAdapter/TaffyAdapter.js.map +0 -1
- package/dist/TaffyAdapter/configSchema.js.map +0 -1
- package/dist/TaffyAdapter/index.d.ts +0 -2
- package/dist/TaffyAdapter/index.js +0 -11
- package/dist/TaffyAdapter/index.js.map +0 -1
- package/src/TaffyAdapter/TaffyAdapter.ts +0 -112
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter'
|
|
2
|
-
import { getSnapshot } from 'mobx-state-tree'
|
|
3
|
-
import { Feature, Region, SimpleFeature } from '@jbrowse/core/util'
|
|
4
|
-
import { ObservableCreate } from '@jbrowse/core/util/rxjs'
|
|
5
|
-
import { openLocation } from '@jbrowse/core/util/io'
|
|
6
|
-
|
|
7
|
-
interface OrganismRecord {
|
|
8
|
-
chr: string
|
|
9
|
-
start: number
|
|
10
|
-
srcSize: number
|
|
11
|
-
strand: number
|
|
12
|
-
unknown: number
|
|
13
|
-
data: string
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
interface ByteRange {
|
|
17
|
-
chrStart: number
|
|
18
|
-
fileOffst: number
|
|
19
|
-
}
|
|
20
|
-
type IndexData = Record<string, ByteRange[]>
|
|
21
|
-
|
|
22
|
-
export default class TaffyAdapter extends BaseFeatureDataAdapter {
|
|
23
|
-
public setupP?: Promise<IndexData>
|
|
24
|
-
|
|
25
|
-
async getRefNames() {
|
|
26
|
-
const data = await this.setup()
|
|
27
|
-
return Object.keys(data)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
setup() {
|
|
31
|
-
if (!this.setupP) {
|
|
32
|
-
this.setupP = this.readTaiFile().catch((e: unknown) => {
|
|
33
|
-
this.setupP = undefined
|
|
34
|
-
throw e
|
|
35
|
-
})
|
|
36
|
-
}
|
|
37
|
-
return this.setupP
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
async readTaiFile() {
|
|
41
|
-
const text = await openLocation(this.getConf('taiLocation')).readFile(
|
|
42
|
-
'utf8',
|
|
43
|
-
)
|
|
44
|
-
const entries = {} as IndexData
|
|
45
|
-
let lastChr = ''
|
|
46
|
-
for (const line of text.split('\n').filter(line => line.trim())) {
|
|
47
|
-
const [chr, chrStart, fileOffset] = line.split('\t')
|
|
48
|
-
const ref = chr === '*' ? lastChr : chr
|
|
49
|
-
const r2 = ref.split('.').at(-1)!
|
|
50
|
-
|
|
51
|
-
if (!entries[r2]) {
|
|
52
|
-
entries[r2] = []
|
|
53
|
-
}
|
|
54
|
-
entries[r2].push({
|
|
55
|
-
chrStart: +chrStart,
|
|
56
|
-
fileOffst: +fileOffset,
|
|
57
|
-
})
|
|
58
|
-
lastChr = ref
|
|
59
|
-
}
|
|
60
|
-
return entries
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
getFeatures(query: Region) {
|
|
64
|
-
return ObservableCreate<Feature>(async observer => {
|
|
65
|
-
try {
|
|
66
|
-
// const { tafLocation } = getSnapshot(this.config)
|
|
67
|
-
// const byteRanges = await this.setup()
|
|
68
|
-
//
|
|
69
|
-
// for (const range of byteRanges[query.refName] || []) {
|
|
70
|
-
// const response = await fetch(tafLocation, {
|
|
71
|
-
// headers: {
|
|
72
|
-
// Range: `bytes=${range.start}-${range.start + range.length - 1}`,
|
|
73
|
-
// },
|
|
74
|
-
// })
|
|
75
|
-
//
|
|
76
|
-
// const text = await response.text()
|
|
77
|
-
// const lines = text.split('\n').filter(line => line.trim())
|
|
78
|
-
//
|
|
79
|
-
// for (const line of lines) {
|
|
80
|
-
// const [chr, start, srcSize, strand, unknown, data] =
|
|
81
|
-
// line.split('\t')
|
|
82
|
-
//
|
|
83
|
-
// // Only emit features that overlap with query region
|
|
84
|
-
// const featureStart = parseInt(start, 10)
|
|
85
|
-
// const featureEnd = featureStart + parseInt(srcSize, 10)
|
|
86
|
-
//
|
|
87
|
-
// if (
|
|
88
|
-
// chr === query.refName &&
|
|
89
|
-
// featureEnd >= query.start &&
|
|
90
|
-
// featureStart <= query.end
|
|
91
|
-
// ) {
|
|
92
|
-
// observer.next(
|
|
93
|
-
// new SimpleFeature({
|
|
94
|
-
// uniqueId: `${chr}-${start}-${data}`,
|
|
95
|
-
// refName: chr,
|
|
96
|
-
// start: featureStart,
|
|
97
|
-
// end: featureEnd,
|
|
98
|
-
// strand: parseInt(strand, 10),
|
|
99
|
-
// data: data,
|
|
100
|
-
// }),
|
|
101
|
-
// )
|
|
102
|
-
// }
|
|
103
|
-
// }
|
|
104
|
-
// }
|
|
105
|
-
observer.complete()
|
|
106
|
-
} catch (e) {
|
|
107
|
-
observer.error(e)
|
|
108
|
-
}
|
|
109
|
-
})
|
|
110
|
-
}
|
|
111
|
-
freeResources(): void {}
|
|
112
|
-
}
|