jbrowse-plugin-tview 2.2.1 → 3.0.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 +349 -69
- 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 +18 -17
- package/dist/LaunchTView/align.js +198 -151
- package/dist/LaunchTView/align.js.map +1 -1
- package/dist/LaunchTView/alleles.d.ts +14 -0
- package/dist/LaunchTView/alleles.js +51 -3
- 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 -6
- package/dist/LaunchTView/repeatStats.js.map +1 -1
- package/dist/LaunchTView/repeats.js +6 -4
- package/dist/LaunchTView/repeats.js.map +1 -1
- package/dist/LaunchTView/tview.d.ts +47 -24
- package/dist/LaunchTView/tview.js +188 -99
- 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 +1178 -383
- package/dist/TViewPanel/model.js +298 -87
- package/dist/TViewPanel/model.js.map +1 -1
- package/dist/TViewPanel/modifications.d.ts +25 -0
- package/dist/TViewPanel/modifications.js +89 -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 -89
- 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 +21 -18
- 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 +233 -177
- package/src/LaunchTView/alleles.ts +70 -4
- 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 -7
- package/src/LaunchTView/repeats.ts +6 -4
- package/src/LaunchTView/tview.ts +228 -112
- package/src/TViewPanel/components/TViewPanel.tsx +33 -4
- 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 +350 -97
- package/src/TViewPanel/modifications.ts +127 -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,6 +1,6 @@
|
|
|
1
1
|
/** the subset of an @jbrowse/core Feature that the layout reads */
|
|
2
2
|
export interface AlignmentFeature {
|
|
3
|
-
get: (key: string) =>
|
|
3
|
+
get: (key: string) => unknown;
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
6
|
* Only '-' and '.' are treated as gaps by react-msaview (anything else counts
|
|
@@ -14,35 +14,43 @@ export interface AlignmentFeature {
|
|
|
14
14
|
*/
|
|
15
15
|
export declare const SPANNED_GAP = "-";
|
|
16
16
|
export declare const ABSENT = ".";
|
|
17
|
+
export declare const GAPS: RegExp;
|
|
17
18
|
export interface ReadLayout {
|
|
18
19
|
/**
|
|
19
|
-
* Identity. Every per-row lookup is
|
|
20
|
-
*
|
|
20
|
+
* Identity, and the row's name in the alignment. Every per-row lookup is
|
|
21
|
+
* keyed by this — the array blocks, the row table — so it is fixed once,
|
|
22
|
+
* here, and nothing downstream rewrites it.
|
|
21
23
|
*/
|
|
22
24
|
name: string;
|
|
23
|
-
/**
|
|
24
|
-
* What the row is called on screen, when that is not just its name. Kept
|
|
25
|
-
* apart from `name` because the copy-number label is added after the array
|
|
26
|
-
* blocks are built and keyed: renaming in place instead left every labelled
|
|
27
|
-
* row unable to find its own block, and the block fell back to gaps — a row
|
|
28
|
-
* that silently loses its sequence while keeping its label.
|
|
29
|
-
*/
|
|
30
|
-
label?: string;
|
|
31
|
-
/**
|
|
32
|
-
* The sample the row belongs to, when several were loaded at once. Already
|
|
33
|
-
* Newick-safe, and the same string the row's own name is prefixed with, so
|
|
34
|
-
* the clade label and its leaves agree.
|
|
35
|
-
*/
|
|
25
|
+
/** the sample the row belongs to, as the caller named it */
|
|
36
26
|
sample?: string;
|
|
37
27
|
start: number;
|
|
38
28
|
/** one char per reference position consumed: the aligned base, or a gap */
|
|
39
29
|
refChars: string;
|
|
40
30
|
/** reference position -> bases inserted immediately before that position */
|
|
41
31
|
insertions: Map<number, string>;
|
|
32
|
+
/** where the row's bases came from in the read, for a row parsed from one */
|
|
33
|
+
query?: ReadQuery;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The read's own sequence, SEQ as the file stores it, and enough of its CIGAR
|
|
37
|
+
* to find any base of the row in it: the query index of the first base at
|
|
38
|
+
* `start`, and how many bases the aligner inserted before each position. Kept
|
|
39
|
+
* as parsed, since the layout later moves and drops insertions.
|
|
40
|
+
*/
|
|
41
|
+
export interface ReadQuery {
|
|
42
|
+
seq: string;
|
|
43
|
+
offset: number;
|
|
44
|
+
inserted: Map<number, number>;
|
|
42
45
|
}
|
|
43
46
|
export declare const byStart: (a: ReadLayout, b: ReadLayout) => number;
|
|
44
47
|
export declare function parseCigar(cigar: string): string[];
|
|
45
48
|
export declare function parseRead(feature: AlignmentFeature, name: string, sample?: string): ReadLayout;
|
|
49
|
+
/**
|
|
50
|
+
* The query index of the first base a parsed read has at or after reference
|
|
51
|
+
* position `pos`, counting what it inserted at `pos` itself as coming first.
|
|
52
|
+
*/
|
|
53
|
+
export declare function queryIndexAt(read: ReadLayout, query: ReadQuery, pos: number): number;
|
|
46
54
|
/**
|
|
47
55
|
* Reads are fetched by overlap, so they carry insertions on either side of the
|
|
48
56
|
* region. Those get no columns and are never rendered, so dropping them keeps
|
|
@@ -51,35 +59,23 @@ export declare function parseRead(feature: AlignmentFeature, name: string, sampl
|
|
|
51
59
|
export declare function clipInsertions(reads: ReadLayout[], start: number, end: number): {
|
|
52
60
|
insertions: Map<number, string>;
|
|
53
61
|
/**
|
|
54
|
-
* Identity. Every per-row lookup is
|
|
55
|
-
*
|
|
62
|
+
* Identity, and the row's name in the alignment. Every per-row lookup is
|
|
63
|
+
* keyed by this — the array blocks, the row table — so it is fixed once,
|
|
64
|
+
* here, and nothing downstream rewrites it.
|
|
56
65
|
*/
|
|
57
66
|
name: string;
|
|
58
|
-
/**
|
|
59
|
-
* What the row is called on screen, when that is not just its name. Kept
|
|
60
|
-
* apart from `name` because the copy-number label is added after the array
|
|
61
|
-
* blocks are built and keyed: renaming in place instead left every labelled
|
|
62
|
-
* row unable to find its own block, and the block fell back to gaps — a row
|
|
63
|
-
* that silently loses its sequence while keeping its label.
|
|
64
|
-
*/
|
|
65
|
-
label?: string;
|
|
66
|
-
/**
|
|
67
|
-
* The sample the row belongs to, when several were loaded at once. Already
|
|
68
|
-
* Newick-safe, and the same string the row's own name is prefixed with, so
|
|
69
|
-
* the clade label and its leaves agree.
|
|
70
|
-
*/
|
|
67
|
+
/** the sample the row belongs to, as the caller named it */
|
|
71
68
|
sample?: string;
|
|
72
69
|
start: number;
|
|
73
70
|
/** one char per reference position consumed: the aligned base, or a gap */
|
|
74
71
|
refChars: string;
|
|
72
|
+
/** where the row's bases came from in the read, for a row parsed from one */
|
|
73
|
+
query?: ReadQuery;
|
|
75
74
|
}[];
|
|
76
75
|
/**
|
|
77
|
-
* MSA rows are keyed by name,
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
* The name is made Newick-safe here rather than where the tree is written,
|
|
82
|
-
* because the tree names the same rows the FASTA does and the two have to agree
|
|
83
|
-
* exactly. '|' separates the parts because ':' opens a branch length.
|
|
76
|
+
* MSA rows are keyed by name, and a FASTA defline names its row by the first
|
|
77
|
+
* whitespace-delimited word, dropping any later row whose word repeats. So a
|
|
78
|
+
* name loses its whitespace, mates are told apart by flag, and whatever still
|
|
79
|
+
* collides (the same read in two files, or a name in `reserved`) is numbered.
|
|
84
80
|
*/
|
|
85
|
-
export declare function getReadNames(features: AlignmentFeature[],
|
|
81
|
+
export declare function getReadNames(features: AlignmentFeature[], reserved?: string[]): string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
const text = (value) => (typeof value === 'string' ? value : '');
|
|
2
2
|
/**
|
|
3
3
|
* Only '-' and '.' are treated as gaps by react-msaview (anything else counts
|
|
4
4
|
* as a base in the conservation track and column stats), so the two of them
|
|
@@ -11,21 +11,27 @@ import { newickSafe } from './sampleTree';
|
|
|
11
11
|
*/
|
|
12
12
|
export const SPANNED_GAP = '-';
|
|
13
13
|
export const ABSENT = '.';
|
|
14
|
+
export const GAPS = /[-.]/g;
|
|
14
15
|
const cigarRegex = /([MIDNSHPX=])/;
|
|
15
16
|
export const byStart = (a, b) => a.start - b.start;
|
|
16
17
|
export function parseCigar(cigar) {
|
|
17
18
|
return cigar.split(cigarRegex).slice(0, -1);
|
|
18
19
|
}
|
|
19
20
|
export function parseRead(feature, name, sample) {
|
|
20
|
-
const seq = feature.get('seq');
|
|
21
|
-
const ops = parseCigar(feature.get('CIGAR'));
|
|
22
|
-
const start = feature.get('start');
|
|
21
|
+
const seq = text(feature.get('seq'));
|
|
22
|
+
const ops = parseCigar(text(feature.get('CIGAR')));
|
|
23
|
+
const start = Number(feature.get('start'));
|
|
23
24
|
const insertions = new Map();
|
|
25
|
+
const inserted = new Map();
|
|
24
26
|
let refChars = '';
|
|
25
27
|
let seqOffset = 0;
|
|
28
|
+
let offset;
|
|
26
29
|
for (let i = 0; i < ops.length; i += 2) {
|
|
27
30
|
const len = +ops[i];
|
|
28
31
|
const op = ops[i + 1];
|
|
32
|
+
if (op !== 'S' && op !== 'H' && op !== 'P') {
|
|
33
|
+
offset ??= seqOffset;
|
|
34
|
+
}
|
|
29
35
|
if (op === 'S') {
|
|
30
36
|
seqOffset += len;
|
|
31
37
|
}
|
|
@@ -34,6 +40,7 @@ export function parseRead(feature, name, sample) {
|
|
|
34
40
|
const pos = start + refChars.length;
|
|
35
41
|
const prev = insertions.get(pos) ?? '';
|
|
36
42
|
insertions.set(pos, prev + seq.slice(seqOffset, seqOffset + len));
|
|
43
|
+
inserted.set(pos, (inserted.get(pos) ?? 0) + len);
|
|
37
44
|
seqOffset += len;
|
|
38
45
|
}
|
|
39
46
|
else if (op === 'D') {
|
|
@@ -48,16 +55,31 @@ export function parseRead(feature, name, sample) {
|
|
|
48
55
|
}
|
|
49
56
|
// H and P consume neither the read sequence nor the reference
|
|
50
57
|
}
|
|
51
|
-
// sanitized here, the same way getReadNames sanitizes the prefix it builds
|
|
52
|
-
// from it, so the clade label and the leaves inside it are one string
|
|
53
58
|
return {
|
|
54
59
|
name,
|
|
55
|
-
sample
|
|
60
|
+
sample,
|
|
56
61
|
start,
|
|
57
62
|
refChars,
|
|
58
63
|
insertions,
|
|
64
|
+
query: { seq, offset: offset ?? seqOffset, inserted },
|
|
59
65
|
};
|
|
60
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* The query index of the first base a parsed read has at or after reference
|
|
69
|
+
* position `pos`, counting what it inserted at `pos` itself as coming first.
|
|
70
|
+
*/
|
|
71
|
+
export function queryIndexAt(read, query, pos) {
|
|
72
|
+
const aligned = read.refChars
|
|
73
|
+
.slice(0, Math.max(0, pos - read.start))
|
|
74
|
+
.replaceAll(GAPS, '').length;
|
|
75
|
+
let insertedBefore = 0;
|
|
76
|
+
for (const [at, len] of query.inserted) {
|
|
77
|
+
if (at < pos) {
|
|
78
|
+
insertedBefore += len;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return query.offset + aligned + insertedBefore;
|
|
82
|
+
}
|
|
61
83
|
/**
|
|
62
84
|
* Reads are fetched by overlap, so they carry insertions on either side of the
|
|
63
85
|
* region. Those get no columns and are never rendered, so dropping them keeps
|
|
@@ -73,24 +95,22 @@ function mateSuffix(flags) {
|
|
|
73
95
|
return flags === undefined || !(flags & 1) ? '' : flags & 64 ? '/1' : '/2';
|
|
74
96
|
}
|
|
75
97
|
/**
|
|
76
|
-
* MSA rows are keyed by name,
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
* The name is made Newick-safe here rather than where the tree is written,
|
|
81
|
-
* because the tree names the same rows the FASTA does and the two have to agree
|
|
82
|
-
* exactly. '|' separates the parts because ':' opens a branch length.
|
|
98
|
+
* MSA rows are keyed by name, and a FASTA defline names its row by the first
|
|
99
|
+
* whitespace-delimited word, dropping any later row whose word repeats. So a
|
|
100
|
+
* name loses its whitespace, mates are told apart by flag, and whatever still
|
|
101
|
+
* collides (the same read in two files, or a name in `reserved`) is numbered.
|
|
83
102
|
*/
|
|
84
|
-
export function getReadNames(features,
|
|
85
|
-
const
|
|
86
|
-
return features.map(
|
|
87
|
-
const
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
103
|
+
export function getReadNames(features, reserved = []) {
|
|
104
|
+
const taken = new Set(reserved);
|
|
105
|
+
return features.map(f => {
|
|
106
|
+
const flags = f.get('flags');
|
|
107
|
+
const base = `${String(f.get('name')).replaceAll(/\s+/g, '_')}${mateSuffix(typeof flags === 'number' ? flags : undefined)}`;
|
|
108
|
+
let name = base;
|
|
109
|
+
for (let n = 2; taken.has(name); n++) {
|
|
110
|
+
name = `${base}_${n}`;
|
|
111
|
+
}
|
|
112
|
+
taken.add(name);
|
|
113
|
+
return name;
|
|
94
114
|
});
|
|
95
115
|
}
|
|
96
116
|
//# sourceMappingURL=readLayout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readLayout.js","sourceRoot":"","sources":["../../src/LaunchTView/readLayout.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"readLayout.js","sourceRoot":"","sources":["../../src/LaunchTView/readLayout.ts"],"names":[],"mappings":"AAKA,MAAM,IAAI,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;AAEzE;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAA;AAC9B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;AACzB,MAAM,CAAC,MAAM,IAAI,GAAG,OAAO,CAAA;AAgC3B,MAAM,UAAU,GAAG,eAAe,CAAA;AAElC,MAAM,CAAC,MAAM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,CAAA;IAC/B,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;QACtB,MAAM,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QAC5B,MAAM,IAAI,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,UAAU,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAA;QAC3H,IAAI,IAAI,GAAG,IAAI,CAAA;QACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YACrC,IAAI,GAAG,GAAG,IAAI,IAAI,CAAC,EAAE,CAAA;QACvB,CAAC;QACD,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACf,OAAO,IAAI,CAAA;IACb,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -43,7 +43,7 @@ export interface ArrayStats {
|
|
|
43
43
|
width: number;
|
|
44
44
|
/** the reference's own copy count, when the reference was a row */
|
|
45
45
|
referenceCopies?: number;
|
|
46
|
-
/** whether the rows were ordered
|
|
46
|
+
/** whether the rows were ordered by this array */
|
|
47
47
|
subject: boolean;
|
|
48
48
|
samples: SampleArrayStats[];
|
|
49
49
|
}
|
|
@@ -91,9 +91,11 @@ export function alleleModes(copies) {
|
|
|
91
91
|
}
|
|
92
92
|
return peaks.filter(p => p.reads >= floor).sort((a, b) => a.value - b.value);
|
|
93
93
|
}
|
|
94
|
-
function
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
function rowsOfSample(array, plan, sample) {
|
|
95
|
+
return plan.reads
|
|
96
|
+
.filter(read => read.sample === sample)
|
|
97
|
+
.map(read => array.copiesByName.get(read.name))
|
|
98
|
+
.filter(copies => copies !== undefined);
|
|
97
99
|
}
|
|
98
100
|
function arrayStats(array, plan, samples) {
|
|
99
101
|
return {
|
|
@@ -108,9 +110,7 @@ function arrayStats(array, plan, samples) {
|
|
|
108
110
|
: undefined,
|
|
109
111
|
subject: array === plan.subject,
|
|
110
112
|
samples: samples.map(sample => {
|
|
111
|
-
const copies =
|
|
112
|
-
.filter(([name]) => sampleOfRow(name) === sample)
|
|
113
|
-
.map(([, n]) => n);
|
|
113
|
+
const copies = rowsOfSample(array, plan, sample);
|
|
114
114
|
const modes = alleleModes(copies);
|
|
115
115
|
return {
|
|
116
116
|
sample,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repeatStats.js","sourceRoot":"","sources":["../../src/LaunchTView/repeatStats.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAKnC;;;GAGG;AACH,MAAM,mBAAmB,GAAG,IAAI,CAAA;AAEhC,iDAAiD;AACjD,MAAM,gBAAgB,GAAG,CAAC,CAAA;AAE1B;;;;;;;;;;;;;GAaG;AACH,MAAM,eAAe,GAAG,GAAG,CAAA;AAE3B;;;;;;;;;;;;;;;GAeG;AACH,MAAM,gBAAgB,GAAG,GAAG,CAAA;AAO5B,+EAA+E;AAC/E,MAAM,UAAU,KAAK,CAAC,MAAgB;IACpC,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAA;IACxC,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;QACvB,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;IACzC,CAAC;IACD,OAAO,CAAC,GAAG,MAAM,CAAC;SACf,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,E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AAM,KAAK,IAAI,SAAS,EAAE,CAAC;QAC9B,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;YAChB,YAAY,EAAE,CAAA;QAChB,CAAC;aAAM,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;YACvB,gBAAgB,EAAE,CAAA;QACpB,CAAC;IACH,CAAC;IACD,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM;QACvB,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,YAAY;QACjC,gBAAgB;QAChB,YAAY;QACZ,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAC9B,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,CACjD;KACF,CAAA;AACH,CAAC"}
|
|
@@ -174,15 +174,17 @@ const RIVAL_SPAN_FRACTION = 0.5;
|
|
|
174
174
|
*/
|
|
175
175
|
export function mergeArrays(arrays, gap = 0) {
|
|
176
176
|
const groups = [];
|
|
177
|
+
// how far right the open group reaches, which is not its last member's end:
|
|
178
|
+
// sorting by start lets a long array be followed by one that ends inside it
|
|
179
|
+
let reach = -Infinity;
|
|
177
180
|
for (const array of [...arrays].sort((a, b) => a.start - b.start)) {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
if (last && array.start <= end + gap) {
|
|
181
|
-
last.push(array);
|
|
181
|
+
if (array.start <= reach + gap) {
|
|
182
|
+
groups.at(-1).push(array);
|
|
182
183
|
}
|
|
183
184
|
else {
|
|
184
185
|
groups.push([array]);
|
|
185
186
|
}
|
|
187
|
+
reach = Math.max(reach, array.end);
|
|
186
188
|
}
|
|
187
189
|
return groups.map(group => {
|
|
188
190
|
const span = (a) => a.end - a.start;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repeats.js","sourceRoot":"","sources":["../../src/LaunchTView/repeats.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;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AAI,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;IACpC,CAAC;IACD,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QACxB,MAAM,IAAI,GAAG,CAAC,CAAiB,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,CAAA;QACnD,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA;QAC3C,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,mBAAmB,GAAG,MAAM,CAAC,CAAA;QACzE,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QACpE,OAAO;YACL,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YAC3C,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;YACvC,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,IAAI,EAAE,KAAK,CAAC,IAAI;SACjB,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -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>;
|
|
@@ -32,6 +33,16 @@ export interface ColumnLayout {
|
|
|
32
33
|
*/
|
|
33
34
|
offsets: number[];
|
|
34
35
|
totalColumns: number;
|
|
36
|
+
/** the array beginning at a position, for the positions one begins at */
|
|
37
|
+
arrayByStart: Map<number, ArrayBlock>;
|
|
38
|
+
/**
|
|
39
|
+
* Ascending, the positions a row cannot be laid out in bulk over: an array
|
|
40
|
+
* block starts here, or some read inserts here. Between two of them every
|
|
41
|
+
* position is one reference column, so that stretch of a row is a slice of
|
|
42
|
+
* the read's own bases rather than a walk over them — which is what keeps
|
|
43
|
+
* rendering proportional to the indels in a region rather than to its width.
|
|
44
|
+
*/
|
|
45
|
+
breaks: number[];
|
|
35
46
|
}
|
|
36
47
|
/**
|
|
37
48
|
* Each reference position contributes its insertion columns (widest across all
|
|
@@ -40,37 +51,36 @@ export interface ColumnLayout {
|
|
|
40
51
|
* contributes one run of columns for the whole interval it covers.
|
|
41
52
|
*/
|
|
42
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
|
+
};
|
|
43
63
|
/**
|
|
44
64
|
* Lays a single row out across the whole region. Rows are typically a tiny
|
|
45
65
|
* fraction of the region, so the columns on either side are filled in one shot
|
|
46
66
|
* from the offsets rather than walked position by position — which works over
|
|
47
|
-
* array blocks too, since the offsets already carry their width.
|
|
67
|
+
* array blocks too, since the offsets already carry their width. Inside its own
|
|
68
|
+
* span a row is walked only at the layout's breaks, and copied straight out of
|
|
69
|
+
* `refChars` between them.
|
|
48
70
|
*/
|
|
49
71
|
export declare function renderRow(read: ReadLayout, layout: ColumnLayout): string;
|
|
50
72
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
|
|
55
|
-
export declare function rowLabel(read: ReadLayout): string;
|
|
56
|
-
/**
|
|
57
|
-
* Rows ordered longest-allele-first and labelled with their copy count.
|
|
58
|
-
*
|
|
59
|
-
* Copy number is the measurement at a tandem array, and reading it off where a
|
|
60
|
-
* row runs out is the thing the unit-per-block layout exists to avoid, so it is
|
|
61
|
-
* stated in the label. Ordering by it puts the alleles in a ladder, which is
|
|
62
|
-
* what makes one row's array comparable to the next at a glance. Rows that do
|
|
63
|
-
* not span the array keep genomic order, below the ones that do; the reference
|
|
64
|
-
* stays on top whatever its allele, since it is what the columns are named
|
|
65
|
-
* 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.
|
|
66
77
|
*/
|
|
67
|
-
export declare
|
|
78
|
+
export declare const REFERENCE = "reference";
|
|
68
79
|
export interface TviewPlan {
|
|
69
80
|
reads: ReadLayout[];
|
|
81
|
+
/** the row each feature became, parallel to the features planned */
|
|
82
|
+
featureNames: string[];
|
|
70
83
|
layout: ColumnLayout;
|
|
71
|
-
insertionWidths: [number, number][];
|
|
72
|
-
/** [start, end, width] per array block, to rebuild the column mapping */
|
|
73
|
-
arraySpans: [number, number, number][];
|
|
74
84
|
region: {
|
|
75
85
|
refName: string;
|
|
76
86
|
start: number;
|
|
@@ -80,7 +90,7 @@ export interface TviewPlan {
|
|
|
80
90
|
cellCount: number;
|
|
81
91
|
/** tandem arrays the reference carries here, left to right */
|
|
82
92
|
arrays: ArrayBlock[];
|
|
83
|
-
/** the array the rows are ordered
|
|
93
|
+
/** the array the rows are ordered by, when there is one */
|
|
84
94
|
subject?: ArrayBlock;
|
|
85
95
|
/** name of the reference row, when the reference sequence was available */
|
|
86
96
|
referenceName?: string;
|
|
@@ -103,11 +113,24 @@ export interface PlanArgs {
|
|
|
103
113
|
* proportional to rows x columns and can be far larger.
|
|
104
114
|
*/
|
|
105
115
|
export declare function planTviewMsa({ features, refName, start, end, sequence, sampleOf, }: PlanArgs): TviewPlan;
|
|
106
|
-
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[];
|
|
107
129
|
export declare function buildTviewMsa(args: PlanArgs): {
|
|
108
130
|
msa: string;
|
|
131
|
+
rowData: RowDataInput;
|
|
132
|
+
highlights: Highlight[];
|
|
109
133
|
insertionWidths: [number, number][];
|
|
110
|
-
arraySpans: [number, number, number][];
|
|
111
134
|
region: {
|
|
112
135
|
refName: string;
|
|
113
136
|
start: number;
|