jbrowse-plugin-tview 2.2.3 → 3.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/README.md +325 -106
- package/dist/AddHighlightModel/index.js +2 -13
- package/dist/AddHighlightModel/index.js.map +1 -1
- package/dist/LaunchTView/TviewGetPlanRpc/TviewGetPlan.d.ts +44 -64
- package/dist/LaunchTView/TviewGetPlanRpc/TviewGetPlan.js +57 -81
- package/dist/LaunchTView/TviewGetPlanRpc/TviewGetPlan.js.map +1 -1
- package/dist/LaunchTView/TviewGetPlanRpc/index.d.ts +1 -1
- package/dist/LaunchTView/align.d.ts +11 -17
- package/dist/LaunchTView/align.js +190 -150
- package/dist/LaunchTView/align.js.map +1 -1
- package/dist/LaunchTView/alleles.d.ts +51 -0
- package/dist/LaunchTView/alleles.js +213 -0
- package/dist/LaunchTView/alleles.js.map +1 -1
- package/dist/LaunchTView/fetchTviewPlan.d.ts +5 -37
- package/dist/LaunchTView/fetchTviewPlan.js +7 -28
- package/dist/LaunchTView/fetchTviewPlan.js.map +1 -1
- package/dist/LaunchTView/index.js +45 -16
- package/dist/LaunchTView/index.js.map +1 -1
- package/dist/LaunchTView/launch.d.ts +50 -0
- package/dist/LaunchTView/launch.js +48 -0
- package/dist/LaunchTView/launch.js.map +1 -0
- package/dist/LaunchTView/launchView.d.ts +3 -8
- package/dist/LaunchTView/launchView.js +18 -12
- package/dist/LaunchTView/launchView.js.map +1 -1
- package/dist/LaunchTView/modifications.d.ts +64 -0
- package/dist/LaunchTView/modifications.js +131 -0
- package/dist/LaunchTView/modifications.js.map +1 -0
- package/dist/LaunchTView/readLayout.d.ts +35 -39
- package/dist/LaunchTView/readLayout.js +44 -24
- package/dist/LaunchTView/readLayout.js.map +1 -1
- package/dist/LaunchTView/repeatStats.d.ts +1 -1
- package/dist/LaunchTView/repeatStats.js +6 -21
- package/dist/LaunchTView/repeatStats.js.map +1 -1
- package/dist/LaunchTView/tview.d.ts +34 -23
- package/dist/LaunchTView/tview.js +133 -78
- package/dist/LaunchTView/tview.js.map +1 -1
- package/dist/TViewPanel/components/TViewPanel.js +9 -4
- package/dist/TViewPanel/components/TViewPanel.js.map +1 -1
- package/dist/TViewPanel/genome.d.ts +11 -0
- package/dist/TViewPanel/genome.js +32 -0
- package/dist/TViewPanel/genome.js.map +1 -0
- package/dist/TViewPanel/init.d.ts +38 -19
- package/dist/TViewPanel/init.js +66 -39
- package/dist/TViewPanel/init.js.map +1 -1
- package/dist/TViewPanel/initMenu.d.ts +28 -0
- package/dist/TViewPanel/initMenu.js +79 -0
- package/dist/TViewPanel/initMenu.js.map +1 -0
- package/dist/TViewPanel/model.d.ts +1090 -334
- package/dist/TViewPanel/model.js +295 -89
- package/dist/TViewPanel/model.js.map +1 -1
- package/dist/TViewPanel/modifications.d.ts +25 -0
- package/dist/TViewPanel/modifications.js +94 -0
- package/dist/TViewPanel/modifications.js.map +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/jbrowse-plugin-tview.umd.production.min.js +125 -88
- package/dist/jbrowse-plugin-tview.umd.production.min.js.map +4 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +8 -8
- package/src/AddHighlightModel/index.tsx +8 -14
- package/src/LaunchTView/TviewGetPlanRpc/TviewGetPlan.ts +119 -157
- package/src/LaunchTView/TviewGetPlanRpc/index.ts +0 -1
- package/src/LaunchTView/align.ts +225 -176
- package/src/LaunchTView/alleles.ts +272 -0
- package/src/LaunchTView/fetchTviewPlan.ts +11 -54
- package/src/LaunchTView/index.ts +74 -16
- package/src/LaunchTView/launch.ts +98 -0
- package/src/LaunchTView/launchView.ts +28 -20
- package/src/LaunchTView/modifications.ts +200 -0
- package/src/LaunchTView/readLayout.ts +65 -41
- package/src/LaunchTView/repeatStats.ts +7 -23
- package/src/LaunchTView/tview.ts +165 -91
- package/src/TViewPanel/components/TViewPanel.tsx +30 -5
- package/src/TViewPanel/genome.ts +41 -0
- package/src/TViewPanel/init.ts +104 -51
- package/src/TViewPanel/initMenu.ts +126 -0
- package/src/TViewPanel/model.ts +346 -97
- package/src/TViewPanel/modifications.ts +132 -0
- package/src/index.ts +0 -2
- package/src/version.ts +1 -1
- package/dist/AddHighlightModel/GenomeMouseoverHighlight.d.ts +0 -6
- package/dist/AddHighlightModel/GenomeMouseoverHighlight.js +0 -23
- package/dist/AddHighlightModel/GenomeMouseoverHighlight.js.map +0 -1
- package/dist/AddHighlightModel/HighlightComponents.d.ts +0 -7
- package/dist/AddHighlightModel/HighlightComponents.js +0 -11
- package/dist/AddHighlightModel/HighlightComponents.js.map +0 -1
- package/dist/LaunchTView/components/ArrayReport.d.ts +0 -10
- package/dist/LaunchTView/components/ArrayReport.js +0 -59
- package/dist/LaunchTView/components/ArrayReport.js.map +0 -1
- package/dist/LaunchTView/components/LaunchTViewDialog.d.ts +0 -6
- package/dist/LaunchTView/components/LaunchTViewDialog.js +0 -124
- package/dist/LaunchTView/components/LaunchTViewDialog.js.map +0 -1
- package/dist/LaunchTView/sampleTree.d.ts +0 -37
- package/dist/LaunchTView/sampleTree.js +0 -65
- package/dist/LaunchTView/sampleTree.js.map +0 -1
- package/dist/LaunchTView/useTviewMsa.d.ts +0 -18
- package/dist/LaunchTView/useTviewMsa.js +0 -24
- package/dist/LaunchTView/useTviewMsa.js.map +0 -1
- package/dist/TViewPanel/coords.d.ts +0 -25
- package/dist/TViewPanel/coords.js +0 -56
- package/dist/TViewPanel/coords.js.map +0 -1
- package/src/AddHighlightModel/GenomeMouseoverHighlight.tsx +0 -46
- package/src/AddHighlightModel/HighlightComponents.tsx +0 -25
- package/src/LaunchTView/components/ArrayReport.tsx +0 -64
- package/src/LaunchTView/components/LaunchTViewDialog.tsx +0 -212
- package/src/LaunchTView/sampleTree.ts +0 -73
- package/src/LaunchTView/useTviewMsa.ts +0 -39
- package/src/TViewPanel/coords.ts +0 -65
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ArrayBlock } from './alleles';
|
|
2
2
|
import type { AlignmentFeature, ReadLayout } from './readLayout';
|
|
3
|
+
import type { Highlight, RowDataInput } from 'react-msaview';
|
|
3
4
|
export type { AlignmentFeature, ReadLayout } from './readLayout';
|
|
4
5
|
export { clipInsertions, parseCigar, parseRead } from './readLayout';
|
|
5
6
|
/**
|
|
@@ -12,10 +13,10 @@ export { clipInsertions, parseCigar, parseRead } from './readLayout';
|
|
|
12
13
|
export declare function alignInsertionColumns(reads: ReadLayout[], ownedByArray: Set<number>): {
|
|
13
14
|
insertions: Map<number, string>;
|
|
14
15
|
name: string;
|
|
15
|
-
label?: string;
|
|
16
16
|
sample?: string;
|
|
17
17
|
start: number;
|
|
18
18
|
refChars: string;
|
|
19
|
+
query?: import("./readLayout").ReadQuery;
|
|
19
20
|
}[];
|
|
20
21
|
/** widest insertion any read has at each reference position (sparse) */
|
|
21
22
|
export declare function maxInsertionWidths(reads: ReadLayout[], ownedByArray: Set<number>): Map<number, number>;
|
|
@@ -50,6 +51,15 @@ export interface ColumnLayout {
|
|
|
50
51
|
* contributes one run of columns for the whole interval it covers.
|
|
51
52
|
*/
|
|
52
53
|
export declare function buildColumnLayout(start: number, end: number, insWidths: Map<number, number>, arrays?: ArrayBlock[]): ColumnLayout;
|
|
54
|
+
/**
|
|
55
|
+
* The reference positions a row is walked over, from inclusive to exclusive. A
|
|
56
|
+
* trailing insertion is keyed one past the last position the read spans, so
|
|
57
|
+
* that slot is in it.
|
|
58
|
+
*/
|
|
59
|
+
export declare function rowSpan(read: ReadLayout, layout: ColumnLayout): {
|
|
60
|
+
from: number;
|
|
61
|
+
to: number;
|
|
62
|
+
};
|
|
53
63
|
/**
|
|
54
64
|
* Lays a single row out across the whole region. Rows are typically a tiny
|
|
55
65
|
* fraction of the region, so the columns on either side are filled in one shot
|
|
@@ -60,29 +70,17 @@ export declare function buildColumnLayout(start: number, end: number, insWidths:
|
|
|
60
70
|
*/
|
|
61
71
|
export declare function renderRow(read: ReadLayout, layout: ColumnLayout): string;
|
|
62
72
|
/**
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
|
|
67
|
-
export declare function rowLabel(read: ReadLayout): string;
|
|
68
|
-
/**
|
|
69
|
-
* Rows ordered longest-allele-first and labelled with their copy count.
|
|
70
|
-
*
|
|
71
|
-
* Copy number is the measurement at a tandem array, and reading it off where a
|
|
72
|
-
* row runs out is the thing the unit-per-block layout exists to avoid, so it is
|
|
73
|
-
* stated in the label. Ordering by it puts the alleles in a ladder, which is
|
|
74
|
-
* what makes one row's array comparable to the next at a glance. Rows that do
|
|
75
|
-
* not span the array keep genomic order, below the ones that do; the reference
|
|
76
|
-
* stays on top whatever its allele, since it is what the columns are named
|
|
77
|
-
* after rather than one of the observations.
|
|
73
|
+
* The reference row's name, and the sample its row table entry gives it. Not
|
|
74
|
+
* the sequence's own name: react-msaview prints a row's residues as
|
|
75
|
+
* `<row>:<index>`, and `chr4:25` would read as a genome coordinate when it is an
|
|
76
|
+
* index into the window.
|
|
78
77
|
*/
|
|
79
|
-
export declare
|
|
78
|
+
export declare const REFERENCE = "reference";
|
|
80
79
|
export interface TviewPlan {
|
|
81
80
|
reads: ReadLayout[];
|
|
81
|
+
/** the row each feature became, parallel to the features planned */
|
|
82
|
+
featureNames: string[];
|
|
82
83
|
layout: ColumnLayout;
|
|
83
|
-
insertionWidths: [number, number][];
|
|
84
|
-
/** [start, end, width] per array block, to rebuild the column mapping */
|
|
85
|
-
arraySpans: [number, number, number][];
|
|
86
84
|
region: {
|
|
87
85
|
refName: string;
|
|
88
86
|
start: number;
|
|
@@ -92,7 +90,7 @@ export interface TviewPlan {
|
|
|
92
90
|
cellCount: number;
|
|
93
91
|
/** tandem arrays the reference carries here, left to right */
|
|
94
92
|
arrays: ArrayBlock[];
|
|
95
|
-
/** the array the rows are ordered
|
|
93
|
+
/** the array the rows are ordered by, when there is one */
|
|
96
94
|
subject?: ArrayBlock;
|
|
97
95
|
/** name of the reference row, when the reference sequence was available */
|
|
98
96
|
referenceName?: string;
|
|
@@ -115,11 +113,24 @@ export interface PlanArgs {
|
|
|
115
113
|
* proportional to rows x columns and can be far larger.
|
|
116
114
|
*/
|
|
117
115
|
export declare function planTviewMsa({ features, refName, start, end, sequence, sampleOf, }: PlanArgs): TviewPlan;
|
|
118
|
-
export declare function
|
|
116
|
+
export declare function renderRows({ reads, layout }: TviewPlan): string[];
|
|
117
|
+
export declare function toFasta({ reads }: TviewPlan, rows: string[]): string;
|
|
118
|
+
export declare function renderTviewMsa(plan: TviewPlan): string;
|
|
119
|
+
/**
|
|
120
|
+
* What each row is, keyed by its name: the sample it came from and, where there
|
|
121
|
+
* is a subject array, the copies it carries there and their length in bp.
|
|
122
|
+
*/
|
|
123
|
+
export declare function planRowData({ reads, subject }: TviewPlan): RowDataInput;
|
|
124
|
+
/**
|
|
125
|
+
* A bracket over the runs of columns that are not one reference base: the
|
|
126
|
+
* insertion sites, and each array block. Columns are the file's, 1-based.
|
|
127
|
+
*/
|
|
128
|
+
export declare function planHighlights({ reads, layout, region, referenceName, }: TviewPlan): Highlight[];
|
|
119
129
|
export declare function buildTviewMsa(args: PlanArgs): {
|
|
120
130
|
msa: string;
|
|
131
|
+
rowData: RowDataInput;
|
|
132
|
+
highlights: Highlight[];
|
|
121
133
|
insertionWidths: [number, number][];
|
|
122
|
-
arraySpans: [number, number, number][];
|
|
123
134
|
region: {
|
|
124
135
|
refName: string;
|
|
125
136
|
start: number;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { alignInsertionSite } from './align';
|
|
2
|
-
import { buildArrayBlocks, reanchorInsertions } from './alleles';
|
|
2
|
+
import { buildArrayBlocks, mergeInsertionSites, normalizeInsertions, reanchorInsertions, } from './alleles';
|
|
3
3
|
import { ABSENT, SPANNED_GAP, byStart, clipInsertions, getReadNames, parseRead, } from './readLayout';
|
|
4
4
|
import { findReferenceArrays, mergeArrays } from './repeats';
|
|
5
|
-
import { newickSafe } from './sampleTree';
|
|
6
5
|
export { clipInsertions, parseCigar, parseRead } from './readLayout';
|
|
7
6
|
/**
|
|
8
7
|
* Mutually aligns the sequences inserted at each reference position, so reads
|
|
@@ -113,6 +112,25 @@ function breakIndex(breaks, pos) {
|
|
|
113
112
|
function arrayContaining(arrays, pos) {
|
|
114
113
|
return arrays.find(a => a.start < pos && pos < a.end);
|
|
115
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* The reference positions a row is walked over, from inclusive to exclusive. A
|
|
117
|
+
* trailing insertion is keyed one past the last position the read spans, so
|
|
118
|
+
* that slot is in it.
|
|
119
|
+
*/
|
|
120
|
+
export function rowSpan(read, layout) {
|
|
121
|
+
const { start, end, arrays } = layout;
|
|
122
|
+
const lastPos = read.start + read.refChars.length;
|
|
123
|
+
const from = Math.max(start, read.start);
|
|
124
|
+
const to = Math.min(end, lastPos + 1);
|
|
125
|
+
// a row that begins or ends inside an array does not span it, so it gets no
|
|
126
|
+
// block; snapping past the block keeps the walk from emitting part of one
|
|
127
|
+
const startsInside = arrayContaining(arrays, from);
|
|
128
|
+
const endsInside = arrayContaining(arrays, to);
|
|
129
|
+
return {
|
|
130
|
+
from: startsInside ? Math.min(end, startsInside.end) : from,
|
|
131
|
+
to: endsInside ? endsInside.start : to,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
116
134
|
/**
|
|
117
135
|
* Lays a single row out across the whole region. Rows are typically a tiny
|
|
118
136
|
* fraction of the region, so the columns on either side are filled in one shot
|
|
@@ -122,22 +140,10 @@ function arrayContaining(arrays, pos) {
|
|
|
122
140
|
* `refChars` between them.
|
|
123
141
|
*/
|
|
124
142
|
export function renderRow(read, layout) {
|
|
125
|
-
const { start,
|
|
143
|
+
const { start, insWidths, offsets, totalColumns } = layout;
|
|
126
144
|
const { arrayByStart, breaks } = layout;
|
|
127
|
-
// a trailing insertion is keyed one past the last position the read spans
|
|
128
145
|
const lastPos = read.start + read.refChars.length;
|
|
129
|
-
|
|
130
|
-
let to = Math.min(end, lastPos + 1);
|
|
131
|
-
// a row that begins or ends inside an array does not span it, so it gets no
|
|
132
|
-
// block; snapping past the block keeps the walk from emitting part of one
|
|
133
|
-
const startsInside = arrayContaining(arrays, from);
|
|
134
|
-
if (startsInside) {
|
|
135
|
-
from = Math.min(end, startsInside.end);
|
|
136
|
-
}
|
|
137
|
-
const endsInside = arrayContaining(arrays, to);
|
|
138
|
-
if (endsInside) {
|
|
139
|
-
to = endsInside.start;
|
|
140
|
-
}
|
|
146
|
+
const { from, to } = rowSpan(read, layout);
|
|
141
147
|
if (to <= from) {
|
|
142
148
|
return ABSENT.repeat(totalColumns);
|
|
143
149
|
}
|
|
@@ -168,59 +174,26 @@ export function renderRow(read, layout) {
|
|
|
168
174
|
continue;
|
|
169
175
|
}
|
|
170
176
|
const refChar = pos < lastPos ? read.refChars[pos - read.start] : ABSENT;
|
|
171
|
-
// a read that is not really here pads the insertion the same way it pads
|
|
172
|
-
// the reference column, so an intron reads as one absence
|
|
173
|
-
const pad = refChar === ABSENT ? ABSENT : SPANNED_GAP;
|
|
174
177
|
const ins = read.insertions.get(pos) ?? '';
|
|
178
|
+
// insertion columns sit between pos - 1 and pos, so a read that is absent
|
|
179
|
+
// on either side, an intron or its own first base, does not span them
|
|
180
|
+
const spans = ins !== '' ||
|
|
181
|
+
(refChar !== ABSENT &&
|
|
182
|
+
pos > read.start &&
|
|
183
|
+
read.refChars[pos - read.start - 1] !== ABSENT);
|
|
184
|
+
const pad = spans ? SPANNED_GAP : ABSENT;
|
|
175
185
|
ret += ins + pad.repeat(insWidths.get(pos) - ins.length) + refChar;
|
|
176
186
|
pos++;
|
|
177
187
|
}
|
|
178
188
|
return ret + ABSENT.repeat(totalColumns - offsets[to - start]);
|
|
179
189
|
}
|
|
180
|
-
// A defline is truncated at its first space (msa-parsers' FastaMSA), so the
|
|
181
|
-
// count is joined on. `labelsAlignRight` puts it flush against the sequence.
|
|
182
|
-
const COPY_COUNT_SEPARATOR = '|';
|
|
183
190
|
/**
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
191
|
+
* The reference row's name, and the sample its row table entry gives it. Not
|
|
192
|
+
* the sequence's own name: react-msaview prints a row's residues as
|
|
193
|
+
* `<row>:<index>`, and `chr4:25` would read as a genome coordinate when it is an
|
|
194
|
+
* index into the window.
|
|
187
195
|
*/
|
|
188
|
-
export
|
|
189
|
-
return read.label ?? read.name;
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* Rows ordered longest-allele-first and labelled with their copy count.
|
|
193
|
-
*
|
|
194
|
-
* Copy number is the measurement at a tandem array, and reading it off where a
|
|
195
|
-
* row runs out is the thing the unit-per-block layout exists to avoid, so it is
|
|
196
|
-
* stated in the label. Ordering by it puts the alleles in a ladder, which is
|
|
197
|
-
* what makes one row's array comparable to the next at a glance. Rows that do
|
|
198
|
-
* not span the array keep genomic order, below the ones that do; the reference
|
|
199
|
-
* stays on top whatever its allele, since it is what the columns are named
|
|
200
|
-
* after rather than one of the observations.
|
|
201
|
-
*/
|
|
202
|
-
export function labelAndOrderByCopies(reads, array, referenceName) {
|
|
203
|
-
const rank = (read) => (read.name === referenceName ? 1 : 0);
|
|
204
|
-
return reads
|
|
205
|
-
.map(read => ({ read, copies: array.copiesByName.get(read.name) }))
|
|
206
|
-
.sort((a, b) => {
|
|
207
|
-
const byRef = rank(b.read) - rank(a.read);
|
|
208
|
-
if (byRef) {
|
|
209
|
-
return byRef;
|
|
210
|
-
}
|
|
211
|
-
if (a.copies === undefined || b.copies === undefined) {
|
|
212
|
-
return a.copies === b.copies
|
|
213
|
-
? byStart(a.read, b.read)
|
|
214
|
-
: a.copies === undefined
|
|
215
|
-
? 1
|
|
216
|
-
: -1;
|
|
217
|
-
}
|
|
218
|
-
return b.copies - a.copies || byStart(a.read, b.read);
|
|
219
|
-
})
|
|
220
|
-
.map(({ read, copies }) => copies === undefined
|
|
221
|
-
? read
|
|
222
|
-
: { ...read, label: `${read.name}${COPY_COUNT_SEPARATOR}n=${copies}` });
|
|
223
|
-
}
|
|
196
|
+
export const REFERENCE = 'reference';
|
|
224
197
|
/** Widest spread of allele lengths, i.e. the array the reads disagree most about. */
|
|
225
198
|
function alleleSpread(array) {
|
|
226
199
|
const lengths = [...array.lengthByName.values()];
|
|
@@ -232,17 +205,18 @@ function alleleSpread(array) {
|
|
|
232
205
|
* proportional to rows x columns and can be far larger.
|
|
233
206
|
*/
|
|
234
207
|
export function planTviewMsa({ features, refName, start, end, sequence, sampleOf, }) {
|
|
235
|
-
const names = getReadNames(features,
|
|
208
|
+
const names = getReadNames(features, [REFERENCE]);
|
|
236
209
|
const parsed = features
|
|
237
210
|
.map((f, i) => parseRead(f, names[i], sampleOf?.(i)))
|
|
238
211
|
.sort(byStart);
|
|
239
212
|
// The reference is laid out as a row like any other, which is what lets it be
|
|
240
213
|
// one of the alleles an array block squares up rather than a thing the block
|
|
241
214
|
// has to be compared against afterwards.
|
|
242
|
-
const referenceName = sequence ?
|
|
215
|
+
const referenceName = sequence ? REFERENCE : undefined;
|
|
243
216
|
const referenceRead = sequence
|
|
244
217
|
? {
|
|
245
|
-
name:
|
|
218
|
+
name: REFERENCE,
|
|
219
|
+
sample: REFERENCE,
|
|
246
220
|
start,
|
|
247
221
|
refChars: sequence.toUpperCase(),
|
|
248
222
|
insertions: new Map(),
|
|
@@ -257,7 +231,13 @@ export function planTviewMsa({ features, refName, start, end, sequence, sampleOf
|
|
|
257
231
|
const intervals = sequence
|
|
258
232
|
? mergeArrays(findReferenceArrays(sequence, start))
|
|
259
233
|
: [];
|
|
260
|
-
const
|
|
234
|
+
const normalized = normalizeInsertions(reanchorInsertions(clipped, intervals), intervals, start);
|
|
235
|
+
const anchored = referenceRead
|
|
236
|
+
? mergeInsertionSites(normalized, intervals, {
|
|
237
|
+
seq: referenceRead.refChars,
|
|
238
|
+
start,
|
|
239
|
+
})
|
|
240
|
+
: normalized;
|
|
261
241
|
const arrays = buildArrayBlocks(anchored, intervals);
|
|
262
242
|
const ownedByArray = new Set();
|
|
263
243
|
for (const array of arrays) {
|
|
@@ -270,35 +250,110 @@ export function planTviewMsa({ features, refName, start, end, sequence, sampleOf
|
|
|
270
250
|
// about, since ordering rows by two copy numbers at once is not a thing rows
|
|
271
251
|
// can do and an array every row agrees on orders nothing.
|
|
272
252
|
const subject = arrays.reduce((best, array) => best && alleleSpread(best) >= alleleSpread(array) ? best : array, undefined);
|
|
273
|
-
const
|
|
274
|
-
? labelAndOrderByCopies(aligned, subject, referenceName)
|
|
275
|
-
: aligned;
|
|
276
|
-
const insWidths = maxInsertionWidths(reads, ownedByArray);
|
|
253
|
+
const insWidths = maxInsertionWidths(aligned, ownedByArray);
|
|
277
254
|
const layout = buildColumnLayout(start, end, insWidths, arrays);
|
|
278
255
|
return {
|
|
279
|
-
reads,
|
|
256
|
+
reads: aligned,
|
|
257
|
+
featureNames: names,
|
|
280
258
|
layout,
|
|
281
|
-
insertionWidths: [...insWidths.entries()].sort((a, b) => a[0] - b[0]),
|
|
282
|
-
arraySpans: arrays.map(a => [a.start, a.end, a.width]),
|
|
283
259
|
region: { refName, start, end },
|
|
284
|
-
cellCount:
|
|
260
|
+
cellCount: aligned.length * layout.totalColumns,
|
|
285
261
|
arrays,
|
|
286
262
|
subject,
|
|
287
263
|
referenceName,
|
|
288
264
|
samples: [
|
|
289
|
-
...new Set(
|
|
265
|
+
...new Set(features.map((_, i) => sampleOf?.(i)).filter(s => s !== undefined)),
|
|
290
266
|
],
|
|
291
267
|
};
|
|
292
268
|
}
|
|
293
|
-
export function
|
|
294
|
-
return reads.map(r =>
|
|
269
|
+
export function renderRows({ reads, layout }) {
|
|
270
|
+
return reads.map(r => renderRow(r, layout));
|
|
271
|
+
}
|
|
272
|
+
export function toFasta({ reads }, rows) {
|
|
273
|
+
return reads.map((r, i) => `>${r.name}\n${rows[i]}\n`).join('');
|
|
274
|
+
}
|
|
275
|
+
export function renderTviewMsa(plan) {
|
|
276
|
+
return toFasta(plan, renderRows(plan));
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* What each row is, keyed by its name: the sample it came from and, where there
|
|
280
|
+
* is a subject array, the copies it carries there and their length in bp.
|
|
281
|
+
*/
|
|
282
|
+
export function planRowData({ reads, subject }) {
|
|
283
|
+
return Object.fromEntries(reads.map(({ name, sample }) => {
|
|
284
|
+
const copies = subject?.copiesByName.get(name);
|
|
285
|
+
const alleleBp = subject?.lengthByName.get(name);
|
|
286
|
+
return [
|
|
287
|
+
name,
|
|
288
|
+
{
|
|
289
|
+
...(sample === undefined ? {} : { sample }),
|
|
290
|
+
...(copies === undefined ? {} : { copies }),
|
|
291
|
+
...(alleleBp === undefined ? {} : { alleleBp }),
|
|
292
|
+
},
|
|
293
|
+
];
|
|
294
|
+
}));
|
|
295
|
+
}
|
|
296
|
+
/** the value most of `values` share, the larger of two equally common */
|
|
297
|
+
function commonest(values) {
|
|
298
|
+
const counts = new Map();
|
|
299
|
+
for (const value of values) {
|
|
300
|
+
counts.set(value, (counts.get(value) ?? 0) + 1);
|
|
301
|
+
}
|
|
302
|
+
return [...counts].sort((a, b) => b[1] - a[1] || b[0] - a[0])[0][0];
|
|
303
|
+
}
|
|
304
|
+
// A bracket is kept in the session and drawn in one strip, and a noisy window
|
|
305
|
+
// has an insertion site every few bases, so only the sites carrying the most
|
|
306
|
+
// inserted sequence are marked.
|
|
307
|
+
const MAX_INSERTION_BRACKETS = 100;
|
|
308
|
+
/**
|
|
309
|
+
* A bracket over the runs of columns that are not one reference base: the
|
|
310
|
+
* insertion sites, and each array block. Columns are the file's, 1-based.
|
|
311
|
+
*/
|
|
312
|
+
export function planHighlights({ reads, layout, region, referenceName, }) {
|
|
313
|
+
const { start, offsets, insWidths, arrays } = layout;
|
|
314
|
+
const n = (x) => x.toLocaleString('en-US');
|
|
315
|
+
const column = (pos) => offsets[pos - start] + 1;
|
|
316
|
+
const lengthsAt = new Map();
|
|
317
|
+
for (const read of reads) {
|
|
318
|
+
for (const [pos, ins] of read.insertions) {
|
|
319
|
+
const lengths = lengthsAt.get(pos) ?? [];
|
|
320
|
+
lengths.push(ins.replaceAll(SPANNED_GAP, '').length);
|
|
321
|
+
lengthsAt.set(pos, lengths);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
const insertedBases = (pos) => (lengthsAt.get(pos) ?? []).reduce((a, b) => a + b, 0);
|
|
325
|
+
const insertions = [...insWidths]
|
|
326
|
+
.filter(([, width]) => width > 0)
|
|
327
|
+
.sort((a, b) => insertedBases(b[0]) - insertedBases(a[0]) || a[0] - b[0])
|
|
328
|
+
.slice(0, MAX_INSERTION_BRACKETS)
|
|
329
|
+
.map(([pos, width]) => ({
|
|
330
|
+
start: column(pos),
|
|
331
|
+
end: column(pos) + width - 1,
|
|
332
|
+
label: `+${commonest(lengthsAt.get(pos) ?? [width])}bp after ${region.refName}:${n(pos)}`,
|
|
333
|
+
}));
|
|
334
|
+
const blocks = arrays.map(array => {
|
|
335
|
+
const copies = referenceName
|
|
336
|
+
? array.copiesByName.get(referenceName)
|
|
337
|
+
: undefined;
|
|
338
|
+
return {
|
|
339
|
+
start: column(array.start),
|
|
340
|
+
end: column(array.start) + array.width - 1,
|
|
341
|
+
label: copies === undefined
|
|
342
|
+
? `(${array.unit})n`
|
|
343
|
+
: `(${array.unit})x${copies} in the reference`,
|
|
344
|
+
};
|
|
345
|
+
});
|
|
346
|
+
return [...insertions, ...blocks]
|
|
347
|
+
.sort((a, b) => a.start - b.start)
|
|
348
|
+
.map((h) => ({ ...h, mark: 'bracket' }));
|
|
295
349
|
}
|
|
296
350
|
export function buildTviewMsa(args) {
|
|
297
351
|
const plan = planTviewMsa(args);
|
|
298
352
|
return {
|
|
299
353
|
msa: renderTviewMsa(plan),
|
|
300
|
-
|
|
301
|
-
|
|
354
|
+
rowData: planRowData(plan),
|
|
355
|
+
highlights: planHighlights(plan),
|
|
356
|
+
insertionWidths: [...plan.layout.insWidths].sort((a, b) => a[0] - b[0]),
|
|
302
357
|
region: plan.region,
|
|
303
358
|
arrays: plan.ar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,EAAE,SAAS,EAAE,CAAC,CAAC,CAAA;AACvD,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAAc;IAC1C,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,CAAA;IAC/B,OAAO;QACL,GAAG,EAAE,cAAc,CAAC,IAAI,CAAC;QACzB,OAAO,EAAE,WAAW,CAAC,IAAI,CAAC;QAC1B,UAAU,EAAE,cAAc,CAAC,IAAI,CAAC;QAChC,eAAe,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACvE,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,OAAO,EAAE,IAAI,CAAC,OAAO;KACtB,CAAA;AACH,CAAC"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { ErrorMessage, LoadingEllipses } from '@jbrowse/core/ui';
|
|
3
|
+
import { Button, Typography } from '@mui/material';
|
|
2
4
|
import { observer } from 'mobx-react';
|
|
3
5
|
import { MSAView } from 'react-msaview';
|
|
6
|
+
const padded = { padding: 20 };
|
|
4
7
|
const TViewPanel = observer(function TViewPanel2({ model, }) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
const state = model.viewState;
|
|
9
|
+
return state.kind === 'alignment' ? (React.createElement(MSAView, { model: model })) : (React.createElement("div", { style: padded }, state.kind === 'loading' ? (React.createElement(LoadingEllipses, { variant: "h6", message: state.message })) : state.kind === 'notice' ? (React.createElement(Typography, null, state.message)) : (React.createElement(React.Fragment, null,
|
|
10
|
+
React.createElement(ErrorMessage, { error: state.error }),
|
|
11
|
+
state.retry ? (React.createElement(Button, { variant: "contained", onClick: () => {
|
|
12
|
+
model.retryLoad();
|
|
13
|
+
} }, "Retry")) : null))));
|
|
9
14
|
});
|
|
10
15
|
export default TViewPanel;
|
|
11
16
|
//# sourceMappingURL=TViewPanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TViewPanel.js","sourceRoot":"","sources":["../../../src/TViewPanel/components/TViewPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"TViewPanel.js","sourceRoot":"","sources":["../../../src/TViewPanel/components/TViewPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAChE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAIvC,MAAM,MAAM,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,CAAA;AAE9B,MAAM,UAAU,GAAG,QAAQ,CAAC,SAAS,WAAW,CAAC,EAC/C,KAAK,GAGN;IACC,MAAM,KAAK,GAAG,KAAK,CAAC,SAAS,CAAA;IAC7B,OAAO,KAAK,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,CAClC,oBAAC,OAAO,IAAC,KAAK,EAAE,KAAK,GAAI,CAC1B,CAAC,CAAC,CAAC,CACF,6BAAK,KAAK,EAAE,MAAM,IACf,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,CAC1B,oBAAC,eAAe,IAAC,OAAO,EAAC,IAAI,EAAC,OAAO,EAAE,KAAK,CAAC,OAAO,GAAI,CACzD,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,CAC5B,oBAAC,UAAU,QAAE,KAAK,CAAC,OAAO,CAAc,CACzC,CAAC,CAAC,CAAC,CACF;QACE,oBAAC,YAAY,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,GAAI;QACnC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CACb,oBAAC,MAAM,IACL,OAAO,EAAC,WAAW,EACnB,OAAO,EAAE,GAAG,EAAE;gBACZ,KAAK,CAAC,SAAS,EAAE,CAAA;YACnB,CAAC,YAGM,CACV,CAAC,CAAC,CAAC,IAAI,CACP,CACJ,CACG,CACP,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface HoverPosition {
|
|
2
|
+
/** 1-based */
|
|
3
|
+
coord: number;
|
|
4
|
+
refName: string;
|
|
5
|
+
/** the genome view the cursor is in, where the host says */
|
|
6
|
+
viewId?: string;
|
|
7
|
+
}
|
|
8
|
+
/** the base a genome view's cursor is over, from `session.hovered` */
|
|
9
|
+
export declare function hoverPosition(hovered: unknown): HoverPosition | undefined;
|
|
10
|
+
/** how many entries of an ascending index are below `value` */
|
|
11
|
+
export declare function lowerBound(index: ArrayLike<number>, value: number): number;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** the base a genome view's cursor is over, from `session.hovered` */
|
|
2
|
+
export function hoverPosition(hovered) {
|
|
3
|
+
const hover = !!hovered && typeof hovered === 'object' ? hovered : undefined;
|
|
4
|
+
const pos = hover && 'hoverPosition' in hover ? hover.hoverPosition : undefined;
|
|
5
|
+
const viewId = hover && 'viewId' in hover && typeof hover.viewId === 'string'
|
|
6
|
+
? hover.viewId
|
|
7
|
+
: undefined;
|
|
8
|
+
return !!pos &&
|
|
9
|
+
typeof pos === 'object' &&
|
|
10
|
+
'coord' in pos &&
|
|
11
|
+
typeof pos.coord === 'number' &&
|
|
12
|
+
'refName' in pos &&
|
|
13
|
+
typeof pos.refName === 'string'
|
|
14
|
+
? { coord: pos.coord, refName: pos.refName, viewId }
|
|
15
|
+
: undefined;
|
|
16
|
+
}
|
|
17
|
+
/** how many entries of an ascending index are below `value` */
|
|
18
|
+
export function lowerBound(index, value) {
|
|
19
|
+
let lo = 0;
|
|
20
|
+
let hi = index.length;
|
|
21
|
+
while (lo < hi) {
|
|
22
|
+
const mid = (lo + hi) >>> 1;
|
|
23
|
+
if (index[mid] < value) {
|
|
24
|
+
lo = mid + 1;
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
hi = mid;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return lo;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=genome.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genome.js","sourceRoot":"","sources":["../../src/TViewPanel/genome.ts"],"names":[],"mappings":"AAQA,sEAAsE;AACtE,MAAM,UAAU,aAAa,CAAC,OAAgB;IAC5C,MAAM,KAAK,GAAG,CAAC,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAA;IAC5E,MAAM,GAAG,GACP,KAAK,IAAI,eAAe,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAA;IACrE,MAAM,MAAM,GACV,KAAK,IAAI,QAAQ,IAAI,KAAK,IAAI,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ;QAC5D,CAAC,CAAC,KAAK,CAAC,MAAM;QACd,CAAC,CAAC,SAAS,CAAA;IACf,OAAO,CAAC,CAAC,GAAG;QACV,OAAO,GAAG,KAAK,QAAQ;QACvB,OAAO,IAAI,GAAG;QACd,OAAO,GAAG,CAAC,KAAK,KAAK,QAAQ;QAC7B,SAAS,IAAI,GAAG;QAChB,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ;QAC/B,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE;QACpD,CAAC,CAAC,SAAS,CAAA;AACf,CAAC;AAED,+DAA+D;AAC/D,MAAM,UAAU,UAAU,CAAC,KAAwB,EAAE,KAAa;IAChE,IAAI,EAAE,GAAG,CAAC,CAAA;IACV,IAAI,EAAE,GAAG,KAAK,CAAC,MAAM,CAAA;IACrB,OAAO,EAAE,GAAG,EAAE,EAAE,CAAC;QACf,MAAM,GAAG,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,CAAA;QAC3B,IAAI,KAAK,CAAC,GAAG,CAAE,GAAG,KAAK,EAAE,CAAC;YACxB,EAAE,GAAG,GAAG,GAAG,CAAC,CAAA;QACd,CAAC;aAAM,CAAC;YACN,EAAE,GAAG,GAAG,CAAA;QACV,CAAC;IACH,CAAC;IACD,OAAO,EAAE,CAAA;AACX,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TviewSource } from '../LaunchTView/fetchTviewPlan';
|
|
1
|
+
import type { FetchRegion, TviewSource } from '../LaunchTView/fetchTviewPlan';
|
|
2
2
|
import type { AbstractSessionModel } from '@jbrowse/core/util';
|
|
3
3
|
/**
|
|
4
4
|
* One alignment file the view reads, and optionally the name to group its rows
|
|
@@ -19,15 +19,14 @@ export type TviewTrackInit = string | {
|
|
|
19
19
|
* - A session can **author** a tview. `{ type: 'TView', init: { … } }` in a
|
|
20
20
|
* defaultSession opens one with no click path — as does the flat form of the
|
|
21
21
|
* same keys in a session spec URL, which is what makes a repeat locus a link.
|
|
22
|
-
* - There is one code path. Launching from
|
|
23
|
-
*
|
|
24
|
-
*
|
|
22
|
+
* - There is one code path. Launching from a menu, restoring a saved session
|
|
23
|
+
* and following a link all end up applying the same blob, and changing what
|
|
24
|
+
* the view shows from its own menu is replacing that blob.
|
|
25
25
|
*
|
|
26
26
|
* Unlike LinearGenomeView's, this init is **kept, not cleared**. What it
|
|
27
|
-
* resolves to
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* view is.
|
|
27
|
+
* resolves to — the alignment and its row table — is kept out of snapshots and
|
|
28
|
+
* rebuilt from it on restore, so the blob is the only durable statement of what
|
|
29
|
+
* the view is.
|
|
31
30
|
*/
|
|
32
31
|
export interface TviewInit {
|
|
33
32
|
/** assembly the locus and the tracks belong to */
|
|
@@ -37,20 +36,40 @@ export interface TviewInit {
|
|
|
37
36
|
/** the alignment files to draw rows from, in order */
|
|
38
37
|
tracks: TviewTrackInit[];
|
|
39
38
|
}
|
|
40
|
-
export
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
export type RegionCheck = {
|
|
40
|
+
region: FetchRegion;
|
|
41
|
+
error?: undefined;
|
|
42
|
+
} | {
|
|
43
|
+
region?: undefined;
|
|
44
|
+
error: string;
|
|
45
|
+
};
|
|
46
|
+
/** the slice of a loaded assembly that a locstring is resolved against */
|
|
47
|
+
export interface LocAssembly {
|
|
48
|
+
name: string;
|
|
49
|
+
isValidRefName: (refName: string) => boolean;
|
|
50
|
+
getCanonicalRefName2: (refName: string) => string;
|
|
51
|
+
getRegionForRefName: (refName: string) => {
|
|
52
|
+
start: number;
|
|
53
|
+
end: number;
|
|
54
|
+
} | undefined;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The region `loc` names on `assembly`, under the assembly's own name for the
|
|
58
|
+
* sequence and clamped to it, or why there is none: a locstring that does not
|
|
59
|
+
* parse, a region off the end of the contig, or one wider than {@link MAX_BP}.
|
|
60
|
+
* A bare refName means the whole contig, and is held to the same limit.
|
|
61
|
+
*/
|
|
62
|
+
export declare function checkRegion(assembly: LocAssembly, loc: string): RegionCheck;
|
|
63
|
+
/** {@link checkRegion} for `init`, or undefined until its assembly has loaded */
|
|
64
|
+
export declare function initRegion(session: AbstractSessionModel, init: TviewInit): RegionCheck | undefined;
|
|
65
|
+
export declare function entryTrackId(entry: TviewTrackInit): string;
|
|
66
|
+
/** what rows from `entry` are grouped under, or its trackId if no track has it */
|
|
67
|
+
export declare function trackLabel(session: AbstractSessionModel, entry: TviewTrackInit): string;
|
|
48
68
|
/**
|
|
49
69
|
* The sources `init.tracks` names, or undefined until every one of them
|
|
50
70
|
* resolves. All or nothing: a partial set comes back with samples missing and
|
|
51
71
|
* nothing on screen says any were.
|
|
52
|
-
*
|
|
53
|
-
* Whether the names are *used* is decided here and only here — one file's rows
|
|
54
|
-
* need no prefix, and would gain a tree of one clade drawn beside a list.
|
|
55
72
|
*/
|
|
56
73
|
export declare function initSources(session: AbstractSessionModel, init: TviewInit): TviewSource[] | undefined;
|
|
74
|
+
/** the trackIds `init.tracks` names that this session has no track for */
|
|
75
|
+
export declare function missingTrackIds(session: AbstractSessionModel, init: TviewInit): string[];
|