jbrowse-plugin-mafviewer 1.4.2 → 1.4.5
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 +1 -1
- package/dist/LinearMafDisplay/components/InsertionSequenceDialog/InsertionSequenceDialog.d.ts +14 -0
- package/dist/LinearMafDisplay/components/InsertionSequenceDialog/InsertionSequenceDialog.js +69 -0
- package/dist/LinearMafDisplay/components/InsertionSequenceDialog/InsertionSequenceDialog.js.map +1 -0
- package/dist/LinearMafDisplay/components/LinearMafDisplayComponent.js +4 -4
- package/dist/LinearMafDisplay/components/LinearMafDisplayComponent.js.map +1 -1
- package/dist/LinearMafDisplay/components/Sidebar/ColorLegend.js +2 -2
- package/dist/LinearMafDisplay/components/Sidebar/ColorLegend.js.map +1 -1
- package/dist/LinearMafDisplay/components/Sidebar/RectBg.d.ts +1 -1
- package/dist/LinearMafDisplay/components/Sidebar/RectBg.js +2 -3
- package/dist/LinearMafDisplay/components/Sidebar/RectBg.js.map +1 -1
- package/dist/LinearMafDisplay/components/Sidebar/SvgWrapper.js +81 -11
- package/dist/LinearMafDisplay/components/Sidebar/SvgWrapper.js.map +1 -1
- package/dist/LinearMafDisplay/components/Sidebar/Tree.js +30 -9
- package/dist/LinearMafDisplay/components/Sidebar/Tree.js.map +1 -1
- package/dist/LinearMafDisplay/components/Sidebar/YScaleBars.d.ts +0 -1
- package/dist/LinearMafDisplay/components/Sidebar/YScaleBars.js.map +1 -1
- package/dist/LinearMafDisplay/renderSvg.js +1 -1
- package/dist/LinearMafDisplay/renderSvg.js.map +1 -1
- package/dist/LinearMafDisplay/stateModel.d.ts +69 -3
- package/dist/LinearMafDisplay/stateModel.js +96 -1
- package/dist/LinearMafDisplay/stateModel.js.map +1 -1
- package/dist/LinearMafDisplay/util.d.ts +1 -0
- package/dist/LinearMafDisplay/util.js +3 -2
- package/dist/LinearMafDisplay/util.js.map +1 -1
- package/dist/LinearMafRenderer/LinearMafRenderer.d.ts +4 -7
- package/dist/LinearMafRenderer/LinearMafRenderer.js.map +1 -1
- package/dist/LinearMafRenderer/components/LinearMafRendering.d.ts +1 -1
- package/dist/LinearMafRenderer/components/LinearMafRendering.js +27 -9
- package/dist/LinearMafRenderer/components/LinearMafRendering.js.map +1 -1
- package/dist/LinearMafRenderer/makeImageData.js +13 -9
- package/dist/LinearMafRenderer/makeImageData.js.map +1 -1
- package/dist/LinearMafRenderer/rendering/features.d.ts +0 -1
- package/dist/LinearMafRenderer/rendering/features.js +1 -14
- package/dist/LinearMafRenderer/rendering/features.js.map +1 -1
- package/dist/LinearMafRenderer/rendering/insertions.js +8 -6
- package/dist/LinearMafRenderer/rendering/insertions.js.map +1 -1
- package/dist/LinearMafRenderer/rendering/matches.d.ts +1 -1
- package/dist/LinearMafRenderer/rendering/matches.js +3 -15
- package/dist/LinearMafRenderer/rendering/matches.js.map +1 -1
- package/dist/LinearMafRenderer/rendering/spatialIndex.js +8 -2
- package/dist/LinearMafRenderer/rendering/spatialIndex.js.map +1 -1
- package/dist/LinearMafRenderer/rendering/text.js +1 -3
- package/dist/LinearMafRenderer/rendering/text.js.map +1 -1
- package/dist/LinearMafRenderer/rendering/types.d.ts +5 -4
- package/dist/jbrowse-plugin-mafviewer.umd.production.min.js +7 -7
- package/dist/jbrowse-plugin-mafviewer.umd.production.min.js.map +4 -4
- package/dist/util/fastaUtils.js +23 -50
- package/dist/util/fastaUtils.js.map +1 -1
- package/package.json +9 -9
- package/src/LinearMafDisplay/components/InsertionSequenceDialog/InsertionSequenceDialog.tsx +105 -0
- package/src/LinearMafDisplay/components/LinearMafDisplayComponent.tsx +4 -4
- package/src/LinearMafDisplay/components/Sidebar/ColorLegend.tsx +2 -6
- package/src/LinearMafDisplay/components/Sidebar/RectBg.tsx +8 -3
- package/src/LinearMafDisplay/components/Sidebar/SvgWrapper.tsx +117 -15
- package/src/LinearMafDisplay/components/Sidebar/Tree.tsx +53 -8
- package/src/LinearMafDisplay/components/Sidebar/YScaleBars.tsx +0 -1
- package/src/LinearMafDisplay/renderSvg.tsx +1 -1
- package/src/LinearMafDisplay/stateModel.ts +109 -1
- package/src/LinearMafDisplay/util.ts +4 -2
- package/src/LinearMafRenderer/LinearMafRenderer.ts +2 -4
- package/src/LinearMafRenderer/components/LinearMafRendering.tsx +51 -30
- package/src/LinearMafRenderer/makeImageData.ts +21 -27
- package/src/LinearMafRenderer/rendering/features.ts +2 -36
- package/src/LinearMafRenderer/rendering/insertions.ts +11 -6
- package/src/LinearMafRenderer/rendering/matches.ts +2 -27
- package/src/LinearMafRenderer/rendering/spatialIndex.ts +9 -2
- package/src/LinearMafRenderer/rendering/text.ts +1 -2
- package/src/LinearMafRenderer/rendering/types.ts +7 -4
- package/src/util/fastaUtils.ts +28 -54
- package/dist/BgzipTaffyAdapter/BgzipTaffyAdapter.d.ts +0 -30
- package/dist/BgzipTaffyAdapter/BgzipTaffyAdapter.js +0 -253
- package/dist/BgzipTaffyAdapter/BgzipTaffyAdapter.js.map +0 -1
- package/dist/BgzipTaffyAdapter/configSchema.d.ts +0 -44
- package/dist/BgzipTaffyAdapter/configSchema.js +0 -53
- package/dist/BgzipTaffyAdapter/configSchema.js.map +0 -1
- package/dist/BgzipTaffyAdapter/index.d.ts +0 -2
- package/dist/BgzipTaffyAdapter/index.js +0 -11
- package/dist/BgzipTaffyAdapter/index.js.map +0 -1
- package/dist/BgzipTaffyAdapter/rowInstructions.d.ts +0 -35
- package/dist/BgzipTaffyAdapter/rowInstructions.js +0 -55
- package/dist/BgzipTaffyAdapter/rowInstructions.js.map +0 -1
- package/dist/BgzipTaffyAdapter/types.d.ts +0 -13
- package/dist/BgzipTaffyAdapter/types.js +0 -2
- package/dist/BgzipTaffyAdapter/types.js.map +0 -1
- package/dist/BgzipTaffyAdapter/util.d.ts +0 -1
- package/dist/BgzipTaffyAdapter/util.js +0 -22
- package/dist/BgzipTaffyAdapter/util.js.map +0 -1
- package/dist/BgzipTaffyAdapter/virtualOffset.d.ts +0 -8
- package/dist/BgzipTaffyAdapter/virtualOffset.js +0 -23
- package/dist/BgzipTaffyAdapter/virtualOffset.js.map +0 -1
- package/dist/LinearMafRenderer/components/ReactComponent.d.ts +0 -9
- package/dist/LinearMafRenderer/components/ReactComponent.js +0 -47
- package/dist/LinearMafRenderer/components/ReactComponent.js.map +0 -1
- package/dist/LinearMafRenderer/components/util.d.ts +0 -1
- package/dist/LinearMafRenderer/components/util.js +0 -13
- package/dist/LinearMafRenderer/components/util.js.map +0 -1
- package/dist/out.js +0 -32303
- package/dist/out.js.map +0 -7
- package/src/LinearMafRenderer/components/util.ts +0 -13
package/src/util/fastaUtils.ts
CHANGED
|
@@ -25,72 +25,44 @@ export function processFeaturesToFasta({
|
|
|
25
25
|
const region = regions[0]!
|
|
26
26
|
const sampleToRowMap = new Map(samples.map((s, i) => [s.id, i]))
|
|
27
27
|
const rlen = region.end - region.start
|
|
28
|
-
|
|
28
|
+
|
|
29
|
+
// Use character arrays instead of strings for O(1) mutations
|
|
30
|
+
const outputRowsArrays = samples.map(() => new Array(rlen).fill('-'))
|
|
31
|
+
|
|
29
32
|
for (const feature of features.values()) {
|
|
30
33
|
const leftCoord = feature.get('start')
|
|
31
34
|
const vals = feature.get('alignments') as Record<string, AlignmentRecord>
|
|
32
35
|
const seq = feature.get('seq')
|
|
33
|
-
for (const [sample, val] of Object.entries(vals)) {
|
|
34
|
-
const origAlignment = val.seq
|
|
35
|
-
const alignment = origAlignment
|
|
36
36
|
|
|
37
|
+
for (const [sample, val] of Object.entries(vals)) {
|
|
38
|
+
const alignment = val.seq
|
|
37
39
|
const row = sampleToRowMap.get(sample)
|
|
38
40
|
if (row === undefined) {
|
|
39
41
|
continue
|
|
40
42
|
}
|
|
41
43
|
|
|
42
|
-
|
|
43
|
-
for (let i = 0, o = 0, l = alignment.length; i < l; i++) {
|
|
44
|
-
if (seq[i] !== '-') {
|
|
45
|
-
if (alignment[i] === '-') {
|
|
46
|
-
const l = leftCoord + o - region.start
|
|
47
|
-
if (l >= 0 && l < rlen) {
|
|
48
|
-
outputRows[row] =
|
|
49
|
-
outputRows[row]!.slice(0, l) +
|
|
50
|
-
'-' +
|
|
51
|
-
outputRows[row]!.slice(l + 1)
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
o++
|
|
55
|
-
}
|
|
56
|
-
}
|
|
44
|
+
const rowArray = outputRowsArrays[row]!
|
|
57
45
|
|
|
58
|
-
|
|
59
|
-
// matches
|
|
60
|
-
for (let i = 0, o = 0, l = alignment.length; i < l; i++) {
|
|
61
|
-
if (seq[i] !== '-') {
|
|
62
|
-
const c = alignment[i]
|
|
63
|
-
const l = leftCoord + o - region.start
|
|
64
|
-
if (l >= 0 && l < rlen) {
|
|
65
|
-
if (seq[i] === c && c !== '-' && c !== ' ') {
|
|
66
|
-
outputRows[row] =
|
|
67
|
-
outputRows[row]!.slice(0, l) +
|
|
68
|
-
'.' +
|
|
69
|
-
outputRows[row]!.slice(l + 1)
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
o++
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// mismatches
|
|
46
|
+
// Single-pass processing: handle gaps, matches, and mismatches together
|
|
78
47
|
for (let i = 0, o = 0, l = alignment.length; i < l; i++) {
|
|
79
|
-
const c = alignment[i]
|
|
80
48
|
if (seq[i] !== '-') {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
49
|
+
const c = alignment[i]
|
|
50
|
+
const pos = leftCoord + o - region.start
|
|
51
|
+
|
|
52
|
+
if (pos >= 0 && pos < rlen) {
|
|
53
|
+
if (c === '-') {
|
|
54
|
+
// Gap
|
|
55
|
+
rowArray[pos] = '-'
|
|
56
|
+
} else if (c !== ' ') {
|
|
57
|
+
if (showAllLetters) {
|
|
58
|
+
// Show all letters mode: write character directly
|
|
59
|
+
rowArray[pos] = c
|
|
60
|
+
} else if (seq[i] === c) {
|
|
61
|
+
// Match: use dot notation
|
|
62
|
+
rowArray[pos] = '.'
|
|
63
|
+
} else {
|
|
64
|
+
// Mismatch: write character
|
|
65
|
+
rowArray[pos] = c
|
|
94
66
|
}
|
|
95
67
|
}
|
|
96
68
|
}
|
|
@@ -99,5 +71,7 @@ export function processFeaturesToFasta({
|
|
|
99
71
|
}
|
|
100
72
|
}
|
|
101
73
|
}
|
|
102
|
-
|
|
74
|
+
|
|
75
|
+
// Convert character arrays back to strings
|
|
76
|
+
return outputRowsArrays.map(arr => arr.join(''))
|
|
103
77
|
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { BaseFeatureDataAdapter, BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
-
import { Feature, Region } from '@jbrowse/core/util';
|
|
3
|
-
import type { IndexData, OrganismRecord } from './types';
|
|
4
|
-
export default class BgzipTaffyAdapter extends BaseFeatureDataAdapter {
|
|
5
|
-
setupP?: Promise<IndexData>;
|
|
6
|
-
private cache;
|
|
7
|
-
getRefNames(): Promise<string[]>;
|
|
8
|
-
getChunk(buffer: Uint8Array, opts?: BaseOptions): Promise<{
|
|
9
|
-
uniqueId: string;
|
|
10
|
-
start: number;
|
|
11
|
-
end: number;
|
|
12
|
-
strand: number;
|
|
13
|
-
alignments: Record<string, OrganismRecord>;
|
|
14
|
-
seq: string;
|
|
15
|
-
} | undefined>;
|
|
16
|
-
setupPre(): Promise<IndexData>;
|
|
17
|
-
setup(opts?: BaseOptions): Promise<IndexData>;
|
|
18
|
-
readTaiFile(): Promise<IndexData>;
|
|
19
|
-
getFeatures(query: Region, opts?: BaseOptions): import("rxjs").Observable<Feature>;
|
|
20
|
-
getSamples(_query: Region): Promise<{
|
|
21
|
-
samples: {
|
|
22
|
-
id: string;
|
|
23
|
-
label?: string;
|
|
24
|
-
color?: string;
|
|
25
|
-
}[];
|
|
26
|
-
tree: Record<string, any> | undefined;
|
|
27
|
-
}>;
|
|
28
|
-
getLines(query: Region, byteRanges: IndexData): Promise<unknown>;
|
|
29
|
-
freeResources(): void;
|
|
30
|
-
}
|
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
import { unzip } from '@gmod/bgzf-filehandle';
|
|
2
|
-
import { BaseFeatureDataAdapter, } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
3
|
-
import { SimpleFeature, updateStatus, } from '@jbrowse/core/util';
|
|
4
|
-
import QuickLRU from '@jbrowse/core/util/QuickLRU';
|
|
5
|
-
import { openLocation } from '@jbrowse/core/util/io';
|
|
6
|
-
import { ObservableCreate } from '@jbrowse/core/util/rxjs';
|
|
7
|
-
import AbortablePromiseCache from 'abortable-promise-cache';
|
|
8
|
-
import Long from 'long';
|
|
9
|
-
import VirtualOffset from './virtualOffset';
|
|
10
|
-
import parseNewick from '../parseNewick';
|
|
11
|
-
import { normalize } from '../util';
|
|
12
|
-
import { parseRowInstructions } from './rowInstructions';
|
|
13
|
-
import { parseLineByLine } from './util';
|
|
14
|
-
const toP = (s = 0) => +(+s).toFixed(1);
|
|
15
|
-
export default class BgzipTaffyAdapter extends BaseFeatureDataAdapter {
|
|
16
|
-
setupP;
|
|
17
|
-
cache = new AbortablePromiseCache({
|
|
18
|
-
cache: new QuickLRU({ maxSize: 50 }),
|
|
19
|
-
// @ts-expect-error
|
|
20
|
-
fill: async ({ nextEntry, firstEntry }, signal, statusCallback) => {
|
|
21
|
-
const file = openLocation(this.getConf('tafGzLocation'));
|
|
22
|
-
const response = await file.read(nextEntry.virtualOffset.blockPosition -
|
|
23
|
-
firstEntry.virtualOffset.blockPosition, firstEntry.virtualOffset.blockPosition);
|
|
24
|
-
const buffer = await unzip(response);
|
|
25
|
-
const slice = buffer.slice(firstEntry.virtualOffset.dataPosition);
|
|
26
|
-
return this.getChunk(slice, {
|
|
27
|
-
statusCallback: statusCallback,
|
|
28
|
-
signal,
|
|
29
|
-
});
|
|
30
|
-
},
|
|
31
|
-
});
|
|
32
|
-
async getRefNames() {
|
|
33
|
-
const data = await this.setup();
|
|
34
|
-
return Object.keys(data);
|
|
35
|
-
}
|
|
36
|
-
async getChunk(buffer, opts) {
|
|
37
|
-
const { statusCallback = () => { } } = opts || {};
|
|
38
|
-
const alignments = {};
|
|
39
|
-
const data = [];
|
|
40
|
-
let a0;
|
|
41
|
-
let j = 0;
|
|
42
|
-
let b = 0;
|
|
43
|
-
parseLineByLine(buffer, line => {
|
|
44
|
-
if (j++ % 100 === 0) {
|
|
45
|
-
statusCallback(`Processing ${toP(b / 1_000_000)}/${toP(buffer.length / 1_000_000)}Mb`);
|
|
46
|
-
}
|
|
47
|
-
b += line.length;
|
|
48
|
-
if (line) {
|
|
49
|
-
const [lineData, rowInstructions] = line.split(' ; ');
|
|
50
|
-
if (rowInstructions) {
|
|
51
|
-
for (const ins of parseRowInstructions(rowInstructions)) {
|
|
52
|
-
if (ins.type === 'i') {
|
|
53
|
-
data.splice(ins.row, 0, ins);
|
|
54
|
-
if (!alignments[ins.asm]) {
|
|
55
|
-
alignments[ins.asm] = {
|
|
56
|
-
start: ins.start,
|
|
57
|
-
strand: ins.strand,
|
|
58
|
-
srcSize: ins.length,
|
|
59
|
-
chr: ins.ref,
|
|
60
|
-
data: '',
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
const e = alignments[ins.asm];
|
|
64
|
-
e.data += ' '.repeat(Math.max(0, j - e.data.length - 1)); // catch it up
|
|
65
|
-
}
|
|
66
|
-
else if (ins.type === 's') {
|
|
67
|
-
if (!alignments[ins.asm]) {
|
|
68
|
-
alignments[ins.asm] = {
|
|
69
|
-
start: ins.start,
|
|
70
|
-
strand: ins.strand,
|
|
71
|
-
srcSize: ins.length,
|
|
72
|
-
chr: ins.ref,
|
|
73
|
-
data: '',
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
const e = alignments[ins.asm];
|
|
77
|
-
e.data += ' '.repeat(Math.max(0, j - e.data.length - 1)); // catch it up
|
|
78
|
-
data[ins.row] = ins;
|
|
79
|
-
}
|
|
80
|
-
else if (ins.type === 'd') {
|
|
81
|
-
data.splice(ins.row, 1);
|
|
82
|
-
}
|
|
83
|
-
// no gaps for now(?)
|
|
84
|
-
// else if (ins.type === 'g') {
|
|
85
|
-
// console.log('g??')
|
|
86
|
-
// } else if (ins.type === 'G') {
|
|
87
|
-
// console.log('G??')
|
|
88
|
-
// }
|
|
89
|
-
}
|
|
90
|
-
if (!a0) {
|
|
91
|
-
a0 = data[0];
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
const lineLen = lineData.length;
|
|
95
|
-
for (let i = 0; i < lineLen; i++) {
|
|
96
|
-
const letter = lineData[i];
|
|
97
|
-
const r = data[i];
|
|
98
|
-
if (r) {
|
|
99
|
-
alignments[r.asm].data += letter;
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
102
|
-
// not sure why but chr22_KI270731v1_random.taf.gz ends up here
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
if (a0) {
|
|
108
|
-
const row0 = alignments[a0.asm];
|
|
109
|
-
// see
|
|
110
|
-
// https://github.com/ComparativeGenomicsToolkit/taffy/blob/f5a5354/docs/taffy_utilities.md#referenced-based-maftaf-and-indexing
|
|
111
|
-
// for the significance of row[0]:
|
|
112
|
-
//
|
|
113
|
-
// "An anchor line in TAF is a column from which all sequence
|
|
114
|
-
// coordinates can be deduced without scanning backwards to previous
|
|
115
|
-
// lines "
|
|
116
|
-
return {
|
|
117
|
-
uniqueId: `${row0.start}-${row0.data.length}`,
|
|
118
|
-
start: row0.start,
|
|
119
|
-
end: row0.start + row0.data.length,
|
|
120
|
-
strand: row0.strand,
|
|
121
|
-
alignments,
|
|
122
|
-
seq: row0.data,
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
return undefined;
|
|
126
|
-
}
|
|
127
|
-
setupPre() {
|
|
128
|
-
if (!this.setupP) {
|
|
129
|
-
this.setupP = this.readTaiFile().catch((e) => {
|
|
130
|
-
this.setupP = undefined;
|
|
131
|
-
throw e;
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
return this.setupP;
|
|
135
|
-
}
|
|
136
|
-
setup(opts) {
|
|
137
|
-
const { statusCallback = () => { } } = opts || {};
|
|
138
|
-
return updateStatus('Downloading index', statusCallback, () => this.setupPre());
|
|
139
|
-
}
|
|
140
|
-
async readTaiFile() {
|
|
141
|
-
const text = await openLocation(this.getConf('taiLocation')).readFile('utf8');
|
|
142
|
-
const lines = text
|
|
143
|
-
.split('\n')
|
|
144
|
-
.map(f => f.trim())
|
|
145
|
-
.filter(line => !!line);
|
|
146
|
-
const entries = {};
|
|
147
|
-
let lastChr = '';
|
|
148
|
-
let lastChrStart = 0;
|
|
149
|
-
let lastRawVirtualOffset = 0;
|
|
150
|
-
for (const line of lines) {
|
|
151
|
-
const [chr, chrStart, virtualOffset] = line.split('\t');
|
|
152
|
-
const relativizedVirtualOffset = lastRawVirtualOffset + +virtualOffset;
|
|
153
|
-
const currChr = chr === '*' ? lastChr : chr.split('.').at(-1);
|
|
154
|
-
// bgzip TAF files store virtual offsets in plaintext in the TAI file
|
|
155
|
-
// these virtualoffsets are 64bit values, so the long library is needed
|
|
156
|
-
// to accurately do the bit manipulations needed
|
|
157
|
-
const x = Long.fromNumber(relativizedVirtualOffset);
|
|
158
|
-
const y = x.shiftRightUnsigned(16);
|
|
159
|
-
const z = x.and(0xffff);
|
|
160
|
-
const voff = new VirtualOffset(y.toNumber(), z.toNumber());
|
|
161
|
-
if (!entries[currChr]) {
|
|
162
|
-
entries[currChr] = [];
|
|
163
|
-
lastChr = '';
|
|
164
|
-
lastChrStart = 0;
|
|
165
|
-
lastRawVirtualOffset = 0;
|
|
166
|
-
}
|
|
167
|
-
const currStart = +chrStart + lastChrStart;
|
|
168
|
-
entries[currChr].push({
|
|
169
|
-
chrStart: currStart,
|
|
170
|
-
virtualOffset: voff,
|
|
171
|
-
});
|
|
172
|
-
lastChr = currChr;
|
|
173
|
-
lastChrStart = currStart;
|
|
174
|
-
lastRawVirtualOffset = relativizedVirtualOffset;
|
|
175
|
-
}
|
|
176
|
-
return entries;
|
|
177
|
-
}
|
|
178
|
-
getFeatures(query, opts) {
|
|
179
|
-
const { statusCallback = () => { } } = opts || {};
|
|
180
|
-
return ObservableCreate(async (observer) => {
|
|
181
|
-
try {
|
|
182
|
-
const byteRanges = await this.setup();
|
|
183
|
-
const feat = await updateStatus('Downloading alignments', statusCallback, () => this.getLines(query, byteRanges));
|
|
184
|
-
if (feat) {
|
|
185
|
-
observer.next(
|
|
186
|
-
// @ts-expect-error
|
|
187
|
-
new SimpleFeature({
|
|
188
|
-
...feat,
|
|
189
|
-
refName: query.refName,
|
|
190
|
-
}));
|
|
191
|
-
}
|
|
192
|
-
else {
|
|
193
|
-
console.error('no feature found');
|
|
194
|
-
}
|
|
195
|
-
statusCallback('');
|
|
196
|
-
observer.complete();
|
|
197
|
-
}
|
|
198
|
-
catch (e) {
|
|
199
|
-
observer.error(e);
|
|
200
|
-
}
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
async getSamples(_query) {
|
|
204
|
-
const nhLoc = this.getConf('nhLocation');
|
|
205
|
-
const nh = nhLoc.uri === '/path/to/my.nh'
|
|
206
|
-
? undefined
|
|
207
|
-
: await openLocation(nhLoc).readFile('utf8');
|
|
208
|
-
// TODO: we may need to resolve the exact set of rows in the visible region
|
|
209
|
-
// here
|
|
210
|
-
return {
|
|
211
|
-
samples: normalize(this.getConf('samples')),
|
|
212
|
-
tree: nh ? parseNewick(nh) : undefined,
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
// TODO: cache processed large chunks
|
|
216
|
-
async getLines(query, byteRanges) {
|
|
217
|
-
const records = byteRanges[query.refName];
|
|
218
|
-
if (records) {
|
|
219
|
-
let firstEntry;
|
|
220
|
-
let nextEntry;
|
|
221
|
-
// two pass:
|
|
222
|
-
// first pass: find first block greater than query start, then -1 from
|
|
223
|
-
// that
|
|
224
|
-
for (let i = 0; i < records.length; i++) {
|
|
225
|
-
if (records[i].chrStart >= query.start) {
|
|
226
|
-
firstEntry = records[Math.max(i - 1, 0)];
|
|
227
|
-
break;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
// second pass: find first block where query end less than record start,
|
|
231
|
-
// and +1 from that
|
|
232
|
-
for (let i = 0; i < records.length; i++) {
|
|
233
|
-
if (query.end <= records[i].chrStart) {
|
|
234
|
-
nextEntry = records[i + 1];
|
|
235
|
-
break;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
nextEntry = nextEntry ?? records.at(-1);
|
|
239
|
-
// we NEED at least a firstEntry (validate behavior?) because othrwise it fetches whole
|
|
240
|
-
// file whn you request e.g. out of range region (e.g. taf in chr22:1-100
|
|
241
|
-
// and you are at chr22:200-300)
|
|
242
|
-
if (firstEntry && nextEntry) {
|
|
243
|
-
return this.cache.get(`${JSON.stringify(nextEntry)}_${JSON.stringify(firstEntry)}`, {
|
|
244
|
-
nextEntry,
|
|
245
|
-
firstEntry,
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
return undefined;
|
|
250
|
-
}
|
|
251
|
-
freeResources() { }
|
|
252
|
-
}
|
|
253
|
-
//# sourceMappingURL=BgzipTaffyAdapter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BgzipTaffyAdapter.js","sourceRoot":"","sources":["../../src/BgzipTaffyAdapter/BgzipTaffyAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC7C,OAAO,EACL,sBAAsB,GAEvB,MAAM,yCAAyC,CAAA;AAChD,OAAO,EAGL,aAAa,EACb,YAAY,GACb,MAAM,oBAAoB,CAAA;AAC3B,OAAO,QAAQ,MAAM,6BAA6B,CAAA;AAClD,OAAO,EAAE,YAAY,EAAE,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ACnB,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,EAC5D;oBACE,SAAS;oBACT,UAAU;iBACX,CACF,CAAA;YACH,CAAC;QACH,CAAC;QACD,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,aAAa,KAAU,CAAC;CACzB"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
declare const configSchema: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
|
-
/**
|
|
3
|
-
* #slot
|
|
4
|
-
*/
|
|
5
|
-
samples: {
|
|
6
|
-
type: string;
|
|
7
|
-
description: string;
|
|
8
|
-
defaultValue: never[];
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* #slot
|
|
12
|
-
*/
|
|
13
|
-
tafGzLocation: {
|
|
14
|
-
type: string;
|
|
15
|
-
description: string;
|
|
16
|
-
defaultValue: {
|
|
17
|
-
uri: string;
|
|
18
|
-
locationType: string;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* #slot
|
|
23
|
-
*/
|
|
24
|
-
taiLocation: {
|
|
25
|
-
type: string;
|
|
26
|
-
description: string;
|
|
27
|
-
defaultValue: {
|
|
28
|
-
uri: string;
|
|
29
|
-
locationType: string;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* #slot
|
|
34
|
-
*/
|
|
35
|
-
nhLocation: {
|
|
36
|
-
type: string;
|
|
37
|
-
description: string;
|
|
38
|
-
defaultValue: {
|
|
39
|
-
uri: string;
|
|
40
|
-
locationType: string;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
44
|
-
export default configSchema;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
2
|
-
/**
|
|
3
|
-
* #config BgzipTaffyAdapter
|
|
4
|
-
* used to configure BgzipTaffy adapter
|
|
5
|
-
*/
|
|
6
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
7
|
-
const configSchema = ConfigurationSchema('BgzipTaffyAdapter', {
|
|
8
|
-
/**
|
|
9
|
-
* #slot
|
|
10
|
-
*/
|
|
11
|
-
samples: {
|
|
12
|
-
type: 'frozen',
|
|
13
|
-
description: 'string[] or {id:string,label:string,color?:string}[]',
|
|
14
|
-
defaultValue: [],
|
|
15
|
-
},
|
|
16
|
-
/**
|
|
17
|
-
* #slot
|
|
18
|
-
*/
|
|
19
|
-
tafGzLocation: {
|
|
20
|
-
type: 'fileLocation',
|
|
21
|
-
description: 'bgzip taffy file',
|
|
22
|
-
defaultValue: {
|
|
23
|
-
uri: '/path/to/my.taf',
|
|
24
|
-
locationType: 'UriLocation',
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
/**
|
|
28
|
-
* #slot
|
|
29
|
-
*/
|
|
30
|
-
taiLocation: {
|
|
31
|
-
type: 'fileLocation',
|
|
32
|
-
description: 'taffy index',
|
|
33
|
-
defaultValue: {
|
|
34
|
-
uri: '/path/to/my.taf.gz.tai',
|
|
35
|
-
locationType: 'UriLocation',
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
/**
|
|
39
|
-
* #slot
|
|
40
|
-
*/
|
|
41
|
-
nhLocation: {
|
|
42
|
-
type: 'fileLocation',
|
|
43
|
-
description: 'newick tree',
|
|
44
|
-
defaultValue: {
|
|
45
|
-
uri: '/path/to/my.nh',
|
|
46
|
-
locationType: 'UriLocation',
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
}, {
|
|
50
|
-
explicitlyTyped: true,
|
|
51
|
-
});
|
|
52
|
-
export default configSchema;
|
|
53
|
-
//# sourceMappingURL=configSchema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"configSchema.js","sourceRoot":"","sources":["../../src/BgzipTaffyAdapter/configSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAEjE;;;GAGG;AACH,SAAS,CAAC,KAAI,CAAC,CAAC,wDAAwD;AAExE,MAAM,YAAY,GAAG,mBAAmB,CACtC,mBAAmB,EACnB;IACE;;OAEG;IACH,OAAO,EAAE;QACP,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,sDAAsD;QACnE,YAAY,EAAE,EAAE;KACjB;IACD;;OAEG;IACH,aAAa,EAAE;QACb,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,kBAAkB;QAC/B,YAAY,EAAE;YACZ,GAAG,EAAE,iBAAiB;YACtB,YAAY,EAAE,aAAa;SAC5B;KACF;IACD;;OAEG;IACH,WAAW,EAAE;QACX,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,aAAa;QAC1B,YAAY,EAAE;YACZ,GAAG,EAAE,wBAAwB;YAC7B,YAAY,EAAE,aAAa;SAC5B;KACF;IACD;;OAEG;IACH,UAAU,EAAE;QACV,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,aAAa;QAC1B,YAAY,EAAE;YACZ,GAAG,EAAE,gBAAgB;YACrB,YAAY,EAAE,aAAa;SAC5B;KACF;CACF,EACD;IACE,eAAe,EAAE,IAAI;CACtB,CACF,CAAA;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { AdapterType } from '@jbrowse/core/pluggableElementTypes';
|
|
2
|
-
import BgzipTaffyAdapter from './BgzipTaffyAdapter';
|
|
3
|
-
import configSchema from './configSchema';
|
|
4
|
-
export default function BgzipTaffyAdapterF(pluginManager) {
|
|
5
|
-
return pluginManager.addAdapterType(() => new AdapterType({
|
|
6
|
-
name: 'BgzipTaffyAdapter',
|
|
7
|
-
AdapterClass: BgzipTaffyAdapter,
|
|
8
|
-
configSchema,
|
|
9
|
-
}));
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/BgzipTaffyAdapter/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AAEjE,OAAO,iBAAiB,MAAM,qBAAqB,CAAA;AACnD,OAAO,YAAY,MAAM,gBAAgB,CAAA;AAEzC,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,aAA4B;IACrE,OAAO,aAAa,CAAC,cAAc,CACjC,GAAG,EAAE,CACH,IAAI,WAAW,CAAC;QACd,IAAI,EAAE,mBAAmB;QACzB,YAAY,EAAE,iBAAiB;QAC/B,YAAY;KACb,CAAC,CACL,CAAA;AACH,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
interface RowInsert {
|
|
2
|
-
type: 'i';
|
|
3
|
-
row: number;
|
|
4
|
-
asm: string;
|
|
5
|
-
ref: string;
|
|
6
|
-
start: number;
|
|
7
|
-
strand: number;
|
|
8
|
-
length: number;
|
|
9
|
-
}
|
|
10
|
-
interface RowSubstitute {
|
|
11
|
-
type: 's';
|
|
12
|
-
row: number;
|
|
13
|
-
asm: string;
|
|
14
|
-
ref: string;
|
|
15
|
-
start: number;
|
|
16
|
-
strand: number;
|
|
17
|
-
length: number;
|
|
18
|
-
}
|
|
19
|
-
interface RowDelete {
|
|
20
|
-
type: 'd';
|
|
21
|
-
row: number;
|
|
22
|
-
}
|
|
23
|
-
interface RowGap {
|
|
24
|
-
type: 'g';
|
|
25
|
-
row: number;
|
|
26
|
-
gapLen: number;
|
|
27
|
-
}
|
|
28
|
-
interface RowGapSubstring {
|
|
29
|
-
type: 'G';
|
|
30
|
-
row: number;
|
|
31
|
-
gapSubstring: string;
|
|
32
|
-
}
|
|
33
|
-
type RowInstruction = RowInsert | RowDelete | RowGap | RowGapSubstring | RowSubstitute;
|
|
34
|
-
export declare function parseRowInstructions(meta: string): RowInstruction[];
|
|
35
|
-
export {};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
export function parseRowInstructions(meta) {
|
|
2
|
-
const ret = meta.split(' ');
|
|
3
|
-
const rows = [];
|
|
4
|
-
for (let i = 0; i < ret.length;) {
|
|
5
|
-
const type = ret[i++];
|
|
6
|
-
if (type === 'i') {
|
|
7
|
-
const row = +ret[i++];
|
|
8
|
-
const [asm, ref] = ret[i++].split('.');
|
|
9
|
-
rows.push({
|
|
10
|
-
type,
|
|
11
|
-
row,
|
|
12
|
-
asm: asm,
|
|
13
|
-
ref: ref,
|
|
14
|
-
start: +ret[i++],
|
|
15
|
-
strand: ret[i++] === '-' ? -1 : 1,
|
|
16
|
-
length: +ret[i++],
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
if (type === 's') {
|
|
20
|
-
const row = +ret[i++];
|
|
21
|
-
const [asm, ref] = ret[i++].split('.');
|
|
22
|
-
rows.push({
|
|
23
|
-
type,
|
|
24
|
-
row,
|
|
25
|
-
asm: asm,
|
|
26
|
-
ref: ref,
|
|
27
|
-
start: +ret[i++],
|
|
28
|
-
strand: ret[i++] === '-' ? -1 : 1,
|
|
29
|
-
length: +ret[i++],
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
else if (type === 'd') {
|
|
33
|
-
rows.push({
|
|
34
|
-
type,
|
|
35
|
-
row: +ret[i++],
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
else if (type === 'g') {
|
|
39
|
-
rows.push({
|
|
40
|
-
type,
|
|
41
|
-
row: +ret[i++],
|
|
42
|
-
gapLen: +ret[i++],
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
else if (type === 'G') {
|
|
46
|
-
rows.push({
|
|
47
|
-
type,
|
|
48
|
-
row: +ret[i++],
|
|
49
|
-
gapSubstring: ret[i++],
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return rows;
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=rowInstructions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rowInstructions.js","sourceRoot":"","sources":["../../src/BgzipTaffyAdapter/rowInstructions.ts"],"names":[],"mappings":"AAuCA,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAC3B,MAAM,IAAI,GAAG,EAAsB,CAAA;IAEnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,GAAI,CAAC;QACjC,MAAM,IAAI,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,CAAA;QACrB,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACjB,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAE,CAAA;YACtB,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,EAAE,CAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;YACvC,IAAI,CAAC,IAAI,CAAC;gBACR,IAAI;gBACJ,GAAG;gBACH,GAAG,EAAE,GAAI;gBACT,GAAG,EAAE,GAAI;gBACT,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAE;gBACjB,MAAM,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACjC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAE;aACnB,CAAC,CAAA;QACJ,CAAC;QACD,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACjB,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAE,CAAA;YACtB,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,EAAE,CAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;YACvC,IAAI,CAAC,IAAI,CAAC;gBACR,IAAI;gBACJ,GAAG;gBACH,GAAG,EAAE,GAAI;gBACT,GAAG,EAAE,GAAI;gBACT,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAE;gBACjB,MAAM,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACjC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAE;aACnB,CAAC,CAAA;QACJ,CAAC;aAAM,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACxB,IAAI,CAAC,IAAI,CAAC;gBACR,IAAI;gBACJ,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAE;aAChB,CAAC,CAAA;QACJ,CAAC;aAAM,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACxB,IAAI,CAAC,IAAI,CAAC;gBACR,IAAI;gBACJ,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAE;gBACf,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAE;aACnB,CAAC,CAAA;QACJ,CAAC;aAAM,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACxB,IAAI,CAAC,IAAI,CAAC;gBACR,IAAI;gBACJ,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAE;gBACf,YAAY,EAAE,GAAG,CAAC,CAAC,EAAE,CAAE;aACxB,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import VirtualOffset from './virtualOffset';
|
|
2
|
-
export interface OrganismRecord {
|
|
3
|
-
chr: string;
|
|
4
|
-
start: number;
|
|
5
|
-
srcSize: number;
|
|
6
|
-
strand: number;
|
|
7
|
-
data: string;
|
|
8
|
-
}
|
|
9
|
-
export interface ByteRange {
|
|
10
|
-
chrStart: number;
|
|
11
|
-
virtualOffset: VirtualOffset;
|
|
12
|
-
}
|
|
13
|
-
export type IndexData = Record<string, ByteRange[]>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/BgzipTaffyAdapter/types.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function parseLineByLine<T>(buffer: Uint8Array, cb: (line: string) => T | undefined): T[];
|