@populationgenomics/gene-glyph 0.0.0-stage → 1.1.1
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/LICENSE +21 -0
- package/README.md +58 -2
- package/dist/adapters/clinvar.d.ts +34 -0
- package/dist/adapters/clinvar.d.ts.map +1 -0
- package/dist/adapters/clinvar.test.d.ts +2 -0
- package/dist/adapters/clinvar.test.d.ts.map +1 -0
- package/dist/adapters/rmc.d.ts +31 -0
- package/dist/adapters/rmc.d.ts.map +1 -0
- package/dist/adapters/rmc.test.d.ts +2 -0
- package/dist/adapters/rmc.test.d.ts.map +1 -0
- package/dist/chrome/default-minimap.d.ts +26 -0
- package/dist/chrome/default-minimap.d.ts.map +1 -0
- package/dist/chrome/default-minimap.test.d.ts +2 -0
- package/dist/chrome/default-minimap.test.d.ts.map +1 -0
- package/dist/chrome/default-track-chevron.d.ts +37 -0
- package/dist/chrome/default-track-chevron.d.ts.map +1 -0
- package/dist/chrome/default-track-chevron.test.d.ts +2 -0
- package/dist/chrome/default-track-chevron.test.d.ts.map +1 -0
- package/dist/coordinate-mapper.d.ts +13 -0
- package/dist/coordinate-mapper.d.ts.map +1 -0
- package/dist/coordinate-mapper.test.d.ts +2 -0
- package/dist/coordinate-mapper.test.d.ts.map +1 -0
- package/dist/data-source.d.ts +24 -0
- package/dist/data-source.d.ts.map +1 -0
- package/dist/data-source.test.d.ts +2 -0
- package/dist/data-source.test.d.ts.map +1 -0
- package/dist/debug-leash.d.ts +73 -0
- package/dist/debug-leash.d.ts.map +1 -0
- package/dist/export.d.ts +69 -0
- package/dist/export.d.ts.map +1 -0
- package/dist/export.test.d.ts +2 -0
- package/dist/export.test.d.ts.map +1 -0
- package/dist/feature-id-hash.d.ts +26 -0
- package/dist/feature-id-hash.d.ts.map +1 -0
- package/dist/feature-id-hash.test.d.ts +2 -0
- package/dist/feature-id-hash.test.d.ts.map +1 -0
- package/dist/figure-scale.d.ts +145 -0
- package/dist/figure-scale.d.ts.map +1 -0
- package/dist/figure-scale.test.d.ts +2 -0
- package/dist/figure-scale.test.d.ts.map +1 -0
- package/dist/gutter.test.d.ts +2 -0
- package/dist/gutter.test.d.ts.map +1 -0
- package/dist/index.d.ts +62 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7910 -0
- package/dist/index.js.map +1 -0
- package/dist/layout-engine.d.ts +52 -0
- package/dist/layout-engine.d.ts.map +1 -0
- package/dist/layout-engine.test.d.ts +2 -0
- package/dist/layout-engine.test.d.ts.map +1 -0
- package/dist/pack-lanes.d.ts +27 -0
- package/dist/pack-lanes.d.ts.map +1 -0
- package/dist/pack-lanes.test.d.ts +2 -0
- package/dist/pack-lanes.test.d.ts.map +1 -0
- package/dist/painter/index.d.ts +4 -0
- package/dist/painter/index.d.ts.map +1 -0
- package/dist/painter/svg-painter.d.ts +6 -0
- package/dist/painter/svg-painter.d.ts.map +1 -0
- package/dist/painter/svg-painter.test.d.ts +2 -0
- package/dist/painter/svg-painter.test.d.ts.map +1 -0
- package/dist/projection-frame.d.ts +92 -0
- package/dist/projection-frame.d.ts.map +1 -0
- package/dist/projection-frame.test.d.ts +2 -0
- package/dist/projection-frame.test.d.ts.map +1 -0
- package/dist/segments.d.ts +86 -0
- package/dist/segments.d.ts.map +1 -0
- package/dist/slots.test.d.ts +2 -0
- package/dist/slots.test.d.ts.map +1 -0
- package/dist/styles.css +1127 -0
- package/dist/symbol-encoding.d.ts +103 -0
- package/dist/symbol-encoding.d.ts.map +1 -0
- package/dist/symbol-encoding.test.d.ts +2 -0
- package/dist/symbol-encoding.test.d.ts.map +1 -0
- package/dist/test-setup.d.ts +2 -0
- package/dist/test-setup.d.ts.map +1 -0
- package/dist/tracks/aa-track.d.ts +67 -0
- package/dist/tracks/aa-track.d.ts.map +1 -0
- package/dist/tracks/aa-track.test.d.ts +2 -0
- package/dist/tracks/aa-track.test.d.ts.map +1 -0
- package/dist/tracks/clinvar-summary-track.d.ts +29 -0
- package/dist/tracks/clinvar-summary-track.d.ts.map +1 -0
- package/dist/tracks/clinvar-summary-track.test.d.ts +2 -0
- package/dist/tracks/clinvar-summary-track.test.d.ts.map +1 -0
- package/dist/tracks/clinvar-track.d.ts +161 -0
- package/dist/tracks/clinvar-track.d.ts.map +1 -0
- package/dist/tracks/clinvar-track.test.d.ts +2 -0
- package/dist/tracks/clinvar-track.test.d.ts.map +1 -0
- package/dist/tracks/exon-track.d.ts +25 -0
- package/dist/tracks/exon-track.d.ts.map +1 -0
- package/dist/tracks/exon-track.test.d.ts +2 -0
- package/dist/tracks/exon-track.test.d.ts.map +1 -0
- package/dist/tracks/interpro-track.d.ts +69 -0
- package/dist/tracks/interpro-track.d.ts.map +1 -0
- package/dist/tracks/interpro-track.test.d.ts +2 -0
- package/dist/tracks/interpro-track.test.d.ts.map +1 -0
- package/dist/tracks/nucleotide-track.d.ts +84 -0
- package/dist/tracks/nucleotide-track.d.ts.map +1 -0
- package/dist/tracks/nucleotide-track.test.d.ts +2 -0
- package/dist/tracks/nucleotide-track.test.d.ts.map +1 -0
- package/dist/tracks/overview-track.d.ts +50 -0
- package/dist/tracks/overview-track.d.ts.map +1 -0
- package/dist/tracks/overview-track.test.d.ts +2 -0
- package/dist/tracks/overview-track.test.d.ts.map +1 -0
- package/dist/tracks/parse-user-variants.d.ts +55 -0
- package/dist/tracks/parse-user-variants.d.ts.map +1 -0
- package/dist/tracks/parse-user-variants.test.d.ts +2 -0
- package/dist/tracks/parse-user-variants.test.d.ts.map +1 -0
- package/dist/tracks/pfam-track.d.ts +33 -0
- package/dist/tracks/pfam-track.d.ts.map +1 -0
- package/dist/tracks/pfam-track.test.d.ts +2 -0
- package/dist/tracks/pfam-track.test.d.ts.map +1 -0
- package/dist/tracks/profile-track.d.ts +133 -0
- package/dist/tracks/profile-track.d.ts.map +1 -0
- package/dist/tracks/profile-track.test.d.ts +2 -0
- package/dist/tracks/profile-track.test.d.ts.map +1 -0
- package/dist/tracks/scale-track.d.ts +70 -0
- package/dist/tracks/scale-track.d.ts.map +1 -0
- package/dist/tracks/scale-track.test.d.ts +2 -0
- package/dist/tracks/scale-track.test.d.ts.map +1 -0
- package/dist/tracks/segment-band-track.d.ts +86 -0
- package/dist/tracks/segment-band-track.d.ts.map +1 -0
- package/dist/tracks/segment-band-track.test.d.ts +2 -0
- package/dist/tracks/segment-band-track.test.d.ts.map +1 -0
- package/dist/tracks/user-variant-track.d.ts +50 -0
- package/dist/tracks/user-variant-track.d.ts.map +1 -0
- package/dist/tracks/user-variant-track.test.d.ts +2 -0
- package/dist/tracks/user-variant-track.test.d.ts.map +1 -0
- package/dist/tracks/variant-summary-track.d.ts +24 -0
- package/dist/tracks/variant-summary-track.d.ts.map +1 -0
- package/dist/tracks/variant-summary-track.test.d.ts +2 -0
- package/dist/tracks/variant-summary-track.test.d.ts.map +1 -0
- package/dist/tracks/variant-track.d.ts +89 -0
- package/dist/tracks/variant-track.d.ts.map +1 -0
- package/dist/tracks/variant-track.test.d.ts +2 -0
- package/dist/tracks/variant-track.test.d.ts.map +1 -0
- package/dist/types.d.ts +671 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/use-viewport-interactions.d.ts +49 -0
- package/dist/use-viewport-interactions.d.ts.map +1 -0
- package/dist/viewer-interactions.test.d.ts +2 -0
- package/dist/viewer-interactions.test.d.ts.map +1 -0
- package/dist/viewer-overlay.test.d.ts +2 -0
- package/dist/viewer-overlay.test.d.ts.map +1 -0
- package/dist/viewer-selection-range.test.d.ts +2 -0
- package/dist/viewer-selection-range.test.d.ts.map +1 -0
- package/dist/viewer.d.ts +319 -0
- package/dist/viewer.d.ts.map +1 -0
- package/dist/viewer.test.d.ts +2 -0
- package/dist/viewer.test.d.ts.map +1 -0
- package/dist/viewport.d.ts +352 -0
- package/dist/viewport.d.ts.map +1 -0
- package/dist/viewport.test.d.ts +2 -0
- package/dist/viewport.test.d.ts.map +1 -0
- package/package.json +65 -4
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { ClinVarRecord } from './tracks/clinvar-track.js';
|
|
2
|
+
import type { VariantCategory, ViewerVariant } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Symbol vocabulary for stacked-variant rendering (Slice 27). One glyph
|
|
5
|
+
* carries three orthogonal facts — shape, fill, colour — so the viewer can
|
|
6
|
+
* encode e.g. category × predicted-effect × clinical-significance without a
|
|
7
|
+
* legend lookup per variant.
|
|
8
|
+
*/
|
|
9
|
+
export type GlyphShape = 'circle' | 'square' | 'triangle-up' | 'triangle-down' | 'diamond' | 'pentagon' | 'cross' | 'bar';
|
|
10
|
+
/**
|
|
11
|
+
* Host-supplied encoding from a feature object to glyph attributes. `lane`
|
|
12
|
+
* groups features into discrete vertical bands — items with the same lane
|
|
13
|
+
* string share a contiguous row block, items with different lane strings
|
|
14
|
+
* never share a row. Returning the same string from every call collapses
|
|
15
|
+
* lane separation; omit `lane` for the same effect.
|
|
16
|
+
*/
|
|
17
|
+
export interface SymbolEncoding<T> {
|
|
18
|
+
shape: (v: T) => GlyphShape;
|
|
19
|
+
/** Fill colour (CSS string, typically `var(--…, fallback)`). */
|
|
20
|
+
fill: (v: T) => string;
|
|
21
|
+
/** Stroke colour for the glyph's outline. Defaults to `fill` when omitted. */
|
|
22
|
+
color?: (v: T) => string;
|
|
23
|
+
/** Optional row-group key. Items with the same string land in the same
|
|
24
|
+
* contiguous lane block; the rendering order across blocks follows the
|
|
25
|
+
* insertion order of the first item in each block. */
|
|
26
|
+
lane?: (v: T) => string;
|
|
27
|
+
/** Optional per-glyph radius override. Defaults to the track's `markRadius`. */
|
|
28
|
+
radius?: (v: T) => number;
|
|
29
|
+
/** Canonical lane order for stacked render. When supplied, the packer
|
|
30
|
+
* emits lane blocks in this sequence (top → bottom) regardless of
|
|
31
|
+
* the order records arrive in. Lane keys not in `laneOrder` are
|
|
32
|
+
* appended alphabetically after the declared keys, so the layout is
|
|
33
|
+
* deterministic even when the encoding adds new lanes later. Omit to
|
|
34
|
+
* fall back to alphabetical-by-key order. */
|
|
35
|
+
laneOrder?: readonly string[];
|
|
36
|
+
/** Human-readable label for each lane key. Used by tracks that paint
|
|
37
|
+
* per-lane section headers (e.g. the ClinVar stacked render's
|
|
38
|
+
* consequence-bucket dividers). Lanes whose keys aren't present here
|
|
39
|
+
* fall back to the key string itself; encodings that don't paint
|
|
40
|
+
* per-lane chrome can omit the field entirely. */
|
|
41
|
+
laneLabels?: Record<string, string>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Build an SVG `<path>` `d` string for `shape` centred at the origin and
|
|
45
|
+
* inscribed in a circle of radius `r`. Pure geometry — no CSS, no transforms,
|
|
46
|
+
* so the path data is stable across themes and reduced-motion paths.
|
|
47
|
+
*/
|
|
48
|
+
export declare function glyphPath(shape: GlyphShape, r: number): string;
|
|
49
|
+
export declare function variantCategoryColor(category: VariantCategory): string;
|
|
50
|
+
export declare function variantShapeFor(category: VariantCategory): GlyphShape;
|
|
51
|
+
export declare function variantLaneFor(category: VariantCategory): string;
|
|
52
|
+
/**
|
|
53
|
+
* Default symbol encoding for {@link ViewerVariant}. Shape encodes category
|
|
54
|
+
* (circle = missense, cross = nonsense/frameshift, triangle-down = splice/
|
|
55
|
+
* stop_lost, …); fill encodes category colour; lane groups loss-of-function
|
|
56
|
+
* vs missense vs synonymous so the stacked render reads as discrete bands.
|
|
57
|
+
*/
|
|
58
|
+
export declare const defaultVariantSymbolEncoding: SymbolEncoding<ViewerVariant>;
|
|
59
|
+
/**
|
|
60
|
+
* Default symbol encoding for {@link ClinVarRecord}. Shape and fill both
|
|
61
|
+
* encode clinical significance (diamond+red = pathogenic, circle+green =
|
|
62
|
+
* benign, …); lane groups path/likely-path together, benign/likely-benign
|
|
63
|
+
* together, and segregates VUS / conflicting / other.
|
|
64
|
+
*/
|
|
65
|
+
export declare const defaultClinVarSymbolEncoding: SymbolEncoding<ClinVarRecord>;
|
|
66
|
+
/** Coarse consequence bucket used by {@link decipherClinVarSymbolEncoding}.
|
|
67
|
+
* Mirrors the four DECIPHER consequence colour classes plus a fallback
|
|
68
|
+
* bucket for anything outside coding-effect space (UTR / intronic /
|
|
69
|
+
* regulatory / non-coding). */
|
|
70
|
+
export type DecipherConsequenceBucket = 'lof' | 'protein-changing' | 'splice-region' | 'synonymous' | 'other';
|
|
71
|
+
/** Bucket a raw VEP / SO consequence term into one of the four DECIPHER
|
|
72
|
+
* consequence classes (LoF, protein-changing, splice region, synonymous)
|
|
73
|
+
* or the fallback `'other'` for UTR / intronic / regulatory / non-coding.
|
|
74
|
+
* Pure function — the same input always returns the same bucket. */
|
|
75
|
+
export declare function decipherConsequenceBucket(consequence: string | null | undefined): DecipherConsequenceBucket;
|
|
76
|
+
/** CSS-var-backed colour for a DECIPHER consequence bucket. Hosts can
|
|
77
|
+
* override each of the four buckets (plus the fallback) by setting the
|
|
78
|
+
* matching `--vv-decipher-color-*` custom property on the figure. */
|
|
79
|
+
export declare function decipherBucketColor(bucket: DecipherConsequenceBucket): string;
|
|
80
|
+
/** Pick the DECIPHER-aligned glyph shape for a raw consequence term.
|
|
81
|
+
* Square is reserved for `stop_gained` (DECIPHER's "location of protein
|
|
82
|
+
* truncating codons"); everything else — including frameshift, whose
|
|
83
|
+
* position is the indel rather than the downstream stop — uses
|
|
84
|
+
* `triangle-up`. */
|
|
85
|
+
export declare function decipherShapeFor(consequence: string | null | undefined): GlyphShape;
|
|
86
|
+
/**
|
|
87
|
+
* DECIPHER-aligned ClinVar encoding (Slice 39). Reads the raw VEP
|
|
88
|
+
* consequence from `record.meta.majorConsequence` and turns it into:
|
|
89
|
+
*
|
|
90
|
+
* - **fill colour** — DECIPHER's four consequence classes (LoF /
|
|
91
|
+
* protein-changing / splice-region / synonymous), plus a grey
|
|
92
|
+
* fallback for non-coding;
|
|
93
|
+
* - **shape** — `square` for `stop_gained` (protein truncation),
|
|
94
|
+
* `triangle-up` otherwise (per DECIPHER's truncating-vs-not axis);
|
|
95
|
+
* - **lane** — same five buckets, top-to-bottom severity.
|
|
96
|
+
*
|
|
97
|
+
* Designed to live inside a per-significance ClinVar sub-track so each
|
|
98
|
+
* sub-track reads as a mini consequence-distribution view; the
|
|
99
|
+
* existing {@link defaultClinVarSymbolEncoding} stays for the single-
|
|
100
|
+
* strip significance-on-glyph render.
|
|
101
|
+
*/
|
|
102
|
+
export declare const decipherClinVarSymbolEncoding: SymbolEncoding<ClinVarRecord>;
|
|
103
|
+
//# sourceMappingURL=symbol-encoding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symbol-encoding.d.ts","sourceRoot":"","sources":["../src/symbol-encoding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAuB,MAAM,2BAA2B,CAAC;AAEpF,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEjE;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GACpB,QAAQ,GAAG,QAAQ,GAAG,aAAa,GAAG,eAAe,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,GAAG,KAAK,CAAC;AAEnG;;;;;;GAMG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC;IAC/B,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,UAAU,CAAC;IAC5B,gEAAgE;IAChE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,MAAM,CAAC;IACvB,8EAA8E;IAC9E,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,MAAM,CAAC;IACzB;;2DAEuD;IACvD,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,MAAM,CAAC;IACxB,gFAAgF;IAChF,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,MAAM,CAAC;IAC1B;;;;;kDAK8C;IAC9C,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B;;;;uDAImD;IACnD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrC;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CA2D9D;AAsED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,CAEtE;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,eAAe,GAAG,UAAU,CAErE;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,CAEhE;AAED;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,EAAE,cAAc,CAAC,aAAa,CAStE,CAAC;AAsBF;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,EAAE,cAAc,CAAC,aAAa,CAUtE,CAAC;AAMF;;;gCAGgC;AAChC,MAAM,MAAM,yBAAyB,GACnC,KAAK,GAAG,kBAAkB,GAAG,eAAe,GAAG,YAAY,GAAG,OAAO,CAAC;AAgCxE;;;qEAGqE;AACrE,wBAAgB,yBAAyB,CACvC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACrC,yBAAyB,CAQ3B;AAkBD;;sEAEsE;AACtE,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,yBAAyB,GAAG,MAAM,CAE7E;AAED;;;;qBAIqB;AACrB,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,UAAU,CAGnF;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,6BAA6B,EAAE,cAAc,CAAC,aAAa,CAYvE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symbol-encoding.test.d.ts","sourceRoot":"","sources":["../src/symbol-encoding.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-setup.d.ts","sourceRoot":"","sources":["../src/test-setup.ts"],"names":[],"mappings":"AAAA,OAAO,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { type DataSource, type Track, type Viewport } from '../types.js';
|
|
2
|
+
/** Protein sequence lookup, keyed by transcript id. The result is an
|
|
3
|
+
* IUPAC single-letter amino-acid string (1-indexed: position 1 is the
|
|
4
|
+
* first residue). Pass a plain string to skip the adapter ceremony
|
|
5
|
+
* when the host already has the sequence. */
|
|
6
|
+
export type ProteinSequenceSource = string | DataSource<{
|
|
7
|
+
transcriptId: string;
|
|
8
|
+
}, string>;
|
|
9
|
+
/** Nucleotide source consumed for aa derivation. The aa track
|
|
10
|
+
* translates the CDS via the standard codon table when no protein
|
|
11
|
+
* source is supplied. */
|
|
12
|
+
export type NucleotideForAaSource = string | DataSource<{
|
|
13
|
+
transcriptId: string;
|
|
14
|
+
}, string>;
|
|
15
|
+
export interface AaTrackConfig {
|
|
16
|
+
id?: string;
|
|
17
|
+
/** Direct protein sequence source. Takes precedence over
|
|
18
|
+
* {@link nucleotideSource}. */
|
|
19
|
+
proteinSource?: ProteinSequenceSource;
|
|
20
|
+
/** Nucleotide source used to derive the protein sequence via the
|
|
21
|
+
* standard codon table. Ignored when {@link proteinSource} is set. */
|
|
22
|
+
nucleotideSource?: NucleotideForAaSource;
|
|
23
|
+
/** Reading-frame offset (0/1/2 bp) applied before codon translation
|
|
24
|
+
* of the nucleotide source. Default 0 (CDS is in-frame from bp 1). */
|
|
25
|
+
frame?: 0 | 1 | 2;
|
|
26
|
+
/** Minimum live pixels per aa before the track unfurls. Default 14
|
|
27
|
+
* — enough room to read a single AA glyph. */
|
|
28
|
+
minPxPerAa?: number;
|
|
29
|
+
/** Letter font size in px. The track height is `letterFontPx +
|
|
30
|
+
* topPad`. Default 12. */
|
|
31
|
+
letterFontPx?: number;
|
|
32
|
+
/** Padding between the ribbon's bottom and the top of the letter
|
|
33
|
+
* row. Default 2. */
|
|
34
|
+
topPad?: number;
|
|
35
|
+
/** Override the default chemistry-coloured palette. Keyed by
|
|
36
|
+
* upper-case single-letter aa code; unknown letters fall back to
|
|
37
|
+
* the `X` colour. */
|
|
38
|
+
palette?: Partial<Record<string, string>>;
|
|
39
|
+
}
|
|
40
|
+
export interface AaTrackData {
|
|
41
|
+
/** Protein sequence (upper-case). Position 1 = first residue. */
|
|
42
|
+
sequence: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Slice 29 — per-aa letter glyphs under the exon ribbon. The track
|
|
46
|
+
* collapses to zero height (and renders nothing) until the live zoom
|
|
47
|
+
* gives each aa at least `minPxPerAa` (default 14) of on-screen
|
|
48
|
+
* width. Above the threshold, one glyph appears per visible aa: in
|
|
49
|
+
* CDS modes the letter sits at its codon's centre bp; in protein
|
|
50
|
+
* mode it sits at the aa's baseline position.
|
|
51
|
+
*
|
|
52
|
+
* Derivation: when only a `nucleotideSource` is supplied, the track
|
|
53
|
+
* translates the CDS via the standard codon table (frame-offset
|
|
54
|
+
* configurable), truncating any trailing partial codon.
|
|
55
|
+
*/
|
|
56
|
+
export declare function aaTrack(config: AaTrackConfig): Track<AaTrackConfig, AaTrackData>;
|
|
57
|
+
/** Live pixels per aa, accounting for the active viewport mode. In
|
|
58
|
+
* CDS modes one aa spans three bp, so the px-per-bp scale is
|
|
59
|
+
* tripled; in protein mode the underlying pxPerBp already encodes
|
|
60
|
+
* px-per-aa. */
|
|
61
|
+
export declare function livePxPerAa(viewport: Viewport): number;
|
|
62
|
+
/** Translate a nucleotide string into single-letter aa codes via the
|
|
63
|
+
* standard genetic code. Any trailing partial codon (< 3 bp) is
|
|
64
|
+
* dropped — DOD says we never crash on non-multiple-of-three CDS
|
|
65
|
+
* lengths. */
|
|
66
|
+
export declare function translate(nt: string, frame?: 0 | 1 | 2): string;
|
|
67
|
+
//# sourceMappingURL=aa-track.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aa-track.d.ts","sourceRoot":"","sources":["../../src/tracks/aa-track.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,UAAU,EA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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aa-track.test.d.ts","sourceRoot":"","sources":["../../src/tracks/aa-track.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type Track } from '../types.js';
|
|
2
|
+
import { type ClinVarRecord, type ClinVarSource } from './clinvar-track.js';
|
|
3
|
+
export interface ClinVarSummaryTrackConfig {
|
|
4
|
+
id?: string;
|
|
5
|
+
source: ClinVarSource;
|
|
6
|
+
/** Track height in px. Default 18. */
|
|
7
|
+
height?: number;
|
|
8
|
+
/** Bin width in *screen* pixels. Default 4. Smaller bins reveal more
|
|
9
|
+
* local structure; larger bins read as smoother density. */
|
|
10
|
+
binPx?: number;
|
|
11
|
+
/** Optional predicate applied to the loaded record set before binning.
|
|
12
|
+
* Mirrors `clinVarTrack`'s host-supplied filter so the same chip /
|
|
13
|
+
* toggle UI can narrow both the detail and the summary view
|
|
14
|
+
* consistently (RD-1110). */
|
|
15
|
+
filter?: (record: ClinVarRecord) => boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface ClinVarSummaryTrackData {
|
|
18
|
+
records: ClinVarRecord[];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* One-row density heat-strip for ClinVar records. Bins the figure's visible
|
|
22
|
+
* width into fixed-screen-pixel cells (default 4 px); each cell's fill
|
|
23
|
+
* saturation encodes record density within the bin, hue encodes the
|
|
24
|
+
* strongest clinical significance present. Carries the same `filter`
|
|
25
|
+
* predicate as `clinVarTrack` so the host can narrow both the detail and
|
|
26
|
+
* summary views with one toggle. RD-1110.
|
|
27
|
+
*/
|
|
28
|
+
export declare function clinVarSummaryTrack(config: ClinVarSummaryTrackConfig): Track<ClinVarSummaryTrackConfig, ClinVarSummaryTrackData>;
|
|
29
|
+
//# sourceMappingURL=clinvar-summary-track.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clinvar-summary-track.d.ts","sourceRoot":"","sources":["../../src/tracks/clinvar-summary-track.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,KAAK,EAKX,MAAM,aAAa,CAAC;AACrB,OAAO,EAGL,KAAK,aAAa,EAElB,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,WAAW,yBAAyB;IACxC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,aAAa,CAAC;IACtB,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;iEAC6D;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;kCAG8B;IAC9B,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,OAAO,CAAC;CAC7C;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,aAAa,EAAE,CAAC;CAC1B;AAUD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,yBAAyB,GAChC,KAAK,CAAC,yBAAyB,EAAE,uBAAuB,CAAC,CA6U3D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clinvar-summary-track.test.d.ts","sourceRoot":"","sources":["../../src/tracks/clinvar-summary-track.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { type SymbolEncoding } from '../symbol-encoding.js';
|
|
2
|
+
import { type CoordinateMapper, type DataSource, type Track, type Viewport, type ViewportQuery } from '../types.js';
|
|
3
|
+
/** Clinical significance bucket used to colour ClinVar marks. The viewer
|
|
4
|
+
* doesn't try to encode the full ClinVar review-status matrix — instead the
|
|
5
|
+
* adapter normalises the upstream string into one of these buckets so the
|
|
6
|
+
* visual surface is consistent across data sources (NCBI eutils, downloaded
|
|
7
|
+
* VCF, or a host's own pipeline). */
|
|
8
|
+
export type ClinVarSignificance = 'pathogenic' | 'likely_pathogenic' | 'uncertain_significance' | 'likely_benign' | 'benign' | 'conflicting' | 'other';
|
|
9
|
+
/** One ClinVar record. Coordinates are genomic — the track maps them through
|
|
10
|
+
* the host's {@link CoordinateMapper} per render. `condition` and
|
|
11
|
+
* `reviewStatus` are surfaced verbatim in the cluster popover. */
|
|
12
|
+
export interface ClinVarRecord {
|
|
13
|
+
/** Stable identifier (typically the ClinVar VCV accession). */
|
|
14
|
+
id: string;
|
|
15
|
+
/** Short label, usually HGVS (e.g., "c.524G>A"). */
|
|
16
|
+
label: string;
|
|
17
|
+
chr: string;
|
|
18
|
+
pos: number;
|
|
19
|
+
significance: ClinVarSignificance;
|
|
20
|
+
reviewStatus?: string;
|
|
21
|
+
condition?: string;
|
|
22
|
+
/** Reference allele length in bp. Defaults to 1 (SNV). For deletions
|
|
23
|
+
* and other multi-bp variants the marker anchors at the transcript-5'
|
|
24
|
+
* end of the affected range (the HGVS-start) and the renderer extends
|
|
25
|
+
* a horizontal line rightward to the transcript-3' end. On minus-
|
|
26
|
+
* strand transcripts this means the anchor sits at the CDS coord of
|
|
27
|
+
* `pos + refLen - 1`, not `pos`. Lane packing sorts by refLen
|
|
28
|
+
* descending so long variants take the top rows. */
|
|
29
|
+
refLen?: number;
|
|
30
|
+
/** Free-form metadata; the playground / host can surface this in tooltips. */
|
|
31
|
+
meta?: Record<string, unknown>;
|
|
32
|
+
}
|
|
33
|
+
export type ClinVarSource = ClinVarRecord[] | DataSource<ViewportQuery, ClinVarRecord[]>;
|
|
34
|
+
export interface ClinVarTrackConfig {
|
|
35
|
+
id?: string;
|
|
36
|
+
source: ClinVarSource;
|
|
37
|
+
/** Total track height in pixels (cluster style only). Ignored when
|
|
38
|
+
* {@link stackedVariantStyle} is set — stacked render uses
|
|
39
|
+
* `heightPolicy: 'data-dependent'` and grows to fit packed lanes. */
|
|
40
|
+
height?: number;
|
|
41
|
+
/** Pixel threshold for density clustering. Records whose live screen-x
|
|
42
|
+
* positions are within this distance are merged into one cluster mark.
|
|
43
|
+
* Defaults to 14px — roughly the cluster glyph's own diameter, so adjacent
|
|
44
|
+
* records never visually overlap. */
|
|
45
|
+
clusterPx?: number;
|
|
46
|
+
/** Radius of the cluster mark. */
|
|
47
|
+
markRadius?: number;
|
|
48
|
+
/** Opt in to the stacked-symbol render (Slice 27). When supplied the track
|
|
49
|
+
* suppresses density-clustering — every record renders as its own
|
|
50
|
+
* pure-symbol glyph in a packed-lane column. */
|
|
51
|
+
stackedVariantStyle?: SymbolEncoding<ClinVarRecord>;
|
|
52
|
+
/** Per-row pitch for the stacked render. Defaults to `2 * markRadius + 2`. */
|
|
53
|
+
stackLanePx?: number;
|
|
54
|
+
/** Optional predicate applied to the loaded record set before clustering
|
|
55
|
+
* and packing. Returning `false` drops the record from every display
|
|
56
|
+
* surface (cluster marks, stacked glyphs, cluster popover, on-figure
|
|
57
|
+
* count). Pure display filter — hosts that want to permanently exclude
|
|
58
|
+
* records should narrow `source` instead. Applied at render time so the
|
|
59
|
+
* host can swap predicates without invalidating the cached load. */
|
|
60
|
+
filter?: (record: ClinVarRecord) => boolean;
|
|
61
|
+
/** Surfaced as {@link Track.configKey} so the viewer can detect filter /
|
|
62
|
+
* encoding changes that reshape the laid-out data and re-run `load()`.
|
|
63
|
+
* Hosts should derive this from anything that affects packing
|
|
64
|
+
* (typically a hash of `filter`'s exclusion sets). */
|
|
65
|
+
configKey?: string;
|
|
66
|
+
}
|
|
67
|
+
export interface ClinVarTrackData {
|
|
68
|
+
records: ClinVarRecord[];
|
|
69
|
+
/** Pre-computed stacked layout — populated only when the track was
|
|
70
|
+
* constructed with a `stackedVariantStyle`. */
|
|
71
|
+
stackLayout?: ClinVarStackLayout;
|
|
72
|
+
}
|
|
73
|
+
export interface PlacedClinVarStacked extends PlacedClinVar {
|
|
74
|
+
row: number;
|
|
75
|
+
laneKey: string;
|
|
76
|
+
}
|
|
77
|
+
export interface ClinVarStackLayout {
|
|
78
|
+
rowCount: number;
|
|
79
|
+
placements: PlacedClinVarStacked[];
|
|
80
|
+
/** Lane block metadata in the order they were packed (top → bottom).
|
|
81
|
+
* `startRow` is inclusive; `endRow` is exclusive. Used by the
|
|
82
|
+
* renderer to draw a divider hairline + section label at each lane
|
|
83
|
+
* boundary. Empty when no records were packed. */
|
|
84
|
+
lanes: ClinVarStackLane[];
|
|
85
|
+
}
|
|
86
|
+
export interface ClinVarStackLane {
|
|
87
|
+
key: string;
|
|
88
|
+
startRow: number;
|
|
89
|
+
endRow: number;
|
|
90
|
+
}
|
|
91
|
+
export interface PlacedClinVar {
|
|
92
|
+
record: ClinVarRecord;
|
|
93
|
+
exonIdx: number;
|
|
94
|
+
cPos: number;
|
|
95
|
+
/** Baseline (fit-gene) screen-x within the figure. */
|
|
96
|
+
baselineX: number;
|
|
97
|
+
/** Baseline screen-x of the variant's transcript-3' end. Equal to
|
|
98
|
+
* `baselineX` for single-bp variants. For multi-bp variants the
|
|
99
|
+
* renderer extends a line rightward from the marker to this x. The
|
|
100
|
+
* marker anchors on the transcript-5' end (HGVS-start), so
|
|
101
|
+
* `endBaselineX ≥ baselineX` is invariant regardless of strand. */
|
|
102
|
+
endBaselineX: number;
|
|
103
|
+
/** Set when the variant extends past the visible intron flank into
|
|
104
|
+
* the chevron-compressed bulk on that side. The renderer draws an
|
|
105
|
+
* arrow stub at the truncated end to flag the hidden extent. */
|
|
106
|
+
truncatedSide?: 'left' | 'right';
|
|
107
|
+
/** Live screen-x after pan/zoom; used for clustering. */
|
|
108
|
+
screenX: number;
|
|
109
|
+
}
|
|
110
|
+
export interface ClinVarCluster {
|
|
111
|
+
id: string;
|
|
112
|
+
members: PlacedClinVar[];
|
|
113
|
+
/** Representative — the most clinically significant member; used to colour
|
|
114
|
+
* the cluster mark. */
|
|
115
|
+
representative: PlacedClinVar;
|
|
116
|
+
/** Median baseline-x across the cluster's members. */
|
|
117
|
+
baselineX: number;
|
|
118
|
+
/** Median live screen-x across the cluster's members. */
|
|
119
|
+
screenX: number;
|
|
120
|
+
/** Exon hosting the cluster — owns the per-exon `<g>` the mark renders into.
|
|
121
|
+
* Picked from the representative member so the mark animates with that
|
|
122
|
+
* exon during pan/zoom. */
|
|
123
|
+
exonIdx: number;
|
|
124
|
+
/** Highest-severity significance among members; drives the cluster fill. */
|
|
125
|
+
topSignificance: ClinVarSignificance;
|
|
126
|
+
}
|
|
127
|
+
export declare function clinVarSignificanceColor(s: ClinVarSignificance): string;
|
|
128
|
+
/** Project each record into the current viewport. Records whose genomic
|
|
129
|
+
* coordinate doesn't map to a CDS position (UTR / intergenic) or which fall
|
|
130
|
+
* on a collapsed intron are dropped — the cluster path is for *visible*
|
|
131
|
+
* features only, mirroring variant-track's `placed`/`unplaced` partition. */
|
|
132
|
+
export declare function placeClinVarRecords(records: ClinVarRecord[], viewport: Viewport, mapper: CoordinateMapper): {
|
|
133
|
+
placed: PlacedClinVar[];
|
|
134
|
+
unplaced: ClinVarRecord[];
|
|
135
|
+
};
|
|
136
|
+
/** Greedy density clustering: sort placements by live screen-x and merge any
|
|
137
|
+
* whose neighbour-distance is below the threshold. The threshold is in
|
|
138
|
+
* *screen* pixels so the user-visible density changes with zoom — fit-gene
|
|
139
|
+
* produces broad clusters, deep zoom breaks them apart. */
|
|
140
|
+
export declare function clusterClinVar(placed: PlacedClinVar[], clusterPx: number): ClinVarCluster[];
|
|
141
|
+
/** Pack ClinVar placements into stacked rows. Mirrors `packStackedVariants`
|
|
142
|
+
* for the variant track: group by `encoding.lane()`, sort each group by
|
|
143
|
+
* current-zoom layout-x, assign each record to the lowest local row whose
|
|
144
|
+
* previous occupant's right edge has cleared. Strict lane separation —
|
|
145
|
+
* items with different lane keys never share a row.
|
|
146
|
+
*
|
|
147
|
+
* Unlike `packStackedVariants`, this packs against `viewport.baselineToLayoutX`
|
|
148
|
+
* rather than the raw baseline-x. The row count therefore shrinks as the
|
|
149
|
+
* user zooms in (glyphs spread far enough that previously-overlapping
|
|
150
|
+
* neighbours collapse into the same row). Pan is irrelevant because
|
|
151
|
+
* `baselineToLayoutX` adds the same display offset to every position,
|
|
152
|
+
* preserving relative distances. */
|
|
153
|
+
export declare function packStackedClinVar(placed: PlacedClinVar[], encoding: SymbolEncoding<ClinVarRecord>, viewport: Viewport, markRadius: number): ClinVarStackLayout;
|
|
154
|
+
export declare function clinVarTrack(config: ClinVarTrackConfig): Track<ClinVarTrackConfig, ClinVarTrackData>;
|
|
155
|
+
export declare function humanSignificance(s: ClinVarSignificance): string;
|
|
156
|
+
/** Normalise the various spellings ClinVar uses for clinical significance
|
|
157
|
+
* into the bucket used by the track. The matcher is permissive — multi-call
|
|
158
|
+
* records like "Pathogenic/Likely pathogenic" pick the dominant call;
|
|
159
|
+
* "Conflicting interpretations of pathogenicity" maps to `conflicting`. */
|
|
160
|
+
export declare function parseClinVarSignificance(raw: string): ClinVarSignificance;
|
|
161
|
+
//# sourceMappingURL=clinvar-track.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clinvar-track.d.ts","sourceRoot":"","sources":["../../src/tracks/clinvar-track.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvE,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,UAAU,EAEf,KAAK,KAAK,EAKV,KAAK,QAAQ,EACb,KAAK,aAAa,EACnB,MAAM,aAAa,CAAC;AAErB;;;;sCAIsC;AACtC,MAAM,MAAM,mBAAmB,GAC3B,YAAY,GACZ,mBAAmB,GACnB,wBAAwB,GACxB,eAAe,GACf,QAAQ,GACR,aAAa,GACb,OAAO,CAAC;AAEZ;;mEAEmE;AACnE,MAAM,WAAW,aAAa;IAC5B,+DAA+D;IAC/D,EAAE,EAAE,MAAM,CAAC;IACX,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,mBAAmB,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;yDAM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MAAM,GACjB,kBAAkB,CA4FpB;AAkBD,wBAAgB,YAAY,CAC1B,MAAM,EAAE,kBAAkB,GACzB,KAAK,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,CAoI7C;AA0wBD,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,mBAAmB,GAAG,MAAM,CAEhE;AAED;;;4EAG4E;AAC5E,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB,CAYzE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clinvar-track.test.d.ts","sourceRoot":"","sources":["../../src/tracks/clinvar-track.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Track } from '../types.js';
|
|
2
|
+
export interface ExonTrackConfig {
|
|
3
|
+
id?: string;
|
|
4
|
+
/** Total track height in pixels; the exon ribbon sits on its vertical centre. */
|
|
5
|
+
height?: number;
|
|
6
|
+
/** Half-thickness of the exon rectangle. */
|
|
7
|
+
exonHalfHeight?: number;
|
|
8
|
+
/** Pixel width of the donor / acceptor flank drawn at exon scale on either
|
|
9
|
+
* side of every collapsed intron. Drawn inside the intron-decoration group
|
|
10
|
+
* whose opacity is tied to `--vv-intron-scale`. When the inter-exon gap is
|
|
11
|
+
* narrow the flank is capped so the central chevron-peaked section keeps a
|
|
12
|
+
* visible horizontal extent. */
|
|
13
|
+
flankPx?: number;
|
|
14
|
+
/** Vertical lift of the chevron peak above the intron baseline. */
|
|
15
|
+
chevronLift?: number;
|
|
16
|
+
/** Half-width (in px) of the hidden-feature indicator badge rendered over
|
|
17
|
+
* each intron gap in spliced / protein modes (Slice 15). */
|
|
18
|
+
hiddenMarkHalfWidth?: number;
|
|
19
|
+
}
|
|
20
|
+
interface ExonTrackData {
|
|
21
|
+
ready: true;
|
|
22
|
+
}
|
|
23
|
+
export declare function exonTrack(config?: ExonTrackConfig): Track<ExonTrackConfig, ExonTrackData>;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=exon-track.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exon-track.d.ts","sourceRoot":"","sources":["../../src/tracks/exon-track.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,KAAK,EAKN,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,eAAe;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,iFAAiF;IACjF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;qCAIiC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;iEAC6D;IAC7D,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,UAAU,aAAa;IAErB,KAAK,EAAE,IAAI,CAAC;CACb;AAQD,wBAAgB,SAAS,CAAC,MAAM,GAAE,eAAoB,GAAG,KAAK,CAAC,eAAe,EAAE,aAAa,CAAC,CAoZ7F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exon-track.test.d.ts","sourceRoot":"","sources":["../../src/tracks/exon-track.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { ProteinDomain, ProteinDomainEntryType, RangeSegment, Track, TrackGroup } from '../types.js';
|
|
2
|
+
export type InterProRenderStyle = 'minimal' | 'rect';
|
|
3
|
+
export interface InterProTrackConfig {
|
|
4
|
+
id?: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
/** Entry types to surface, in display order. Each becomes a sub-track in
|
|
7
|
+
* the returned TrackGroup. Defaults to the four lit-manager surfaces. */
|
|
8
|
+
groups?: ProteinDomainEntryType[];
|
|
9
|
+
/** Display style for each domain. `'minimal'` (default) draws a thin
|
|
10
|
+
* horizontal line with end-cap ticks and a label left-aligned to the
|
|
11
|
+
* domain's start — the visual treatment lit-manager used for secondary
|
|
12
|
+
* annotations so the Pfam track stays prominent. `'rect'` keeps the
|
|
13
|
+
* rounded-rectangle treatment from earlier iterations. */
|
|
14
|
+
style?: InterProRenderStyle;
|
|
15
|
+
/** Vertical pixels reserved per packed lane in a sub-track. Sized so the
|
|
16
|
+
* rect + above-rect label fit in one row without crashing the lane above. */
|
|
17
|
+
laneHeight?: number;
|
|
18
|
+
/** Half-thickness of each rounded rect drawn for a domain segment.
|
|
19
|
+
* Only consulted by `style: 'rect'`. */
|
|
20
|
+
rectHalfHeight?: number;
|
|
21
|
+
/** Font size used for labels (and for the half-distance label budget). */
|
|
22
|
+
labelFontSize?: number;
|
|
23
|
+
/** Vertical offset of the label above the rect's top edge / above the
|
|
24
|
+
* minimal line. */
|
|
25
|
+
labelOffset?: number;
|
|
26
|
+
/** Pixel gap enforced between domains placed on the same lane so labels
|
|
27
|
+
* don't crash into each other. */
|
|
28
|
+
laneGapPx?: number;
|
|
29
|
+
/** Override the default `source.toLowerCase() === 'interpro'` filter. */
|
|
30
|
+
domainFilter?: (domain: ProteinDomain) => boolean;
|
|
31
|
+
/** Pixels reserved for the parent "InterPro" label row at the top
|
|
32
|
+
* of the group's extent. Mirrors {@link TrackGroup.headerHeight}.
|
|
33
|
+
* Defaults to 22 (matches the ClinVar hierarchy). */
|
|
34
|
+
headerHeight?: number;
|
|
35
|
+
}
|
|
36
|
+
export interface InterProSubTrackData {
|
|
37
|
+
entryType: ProteinDomainEntryType;
|
|
38
|
+
domains: ProteinDomain[];
|
|
39
|
+
placements: PlacedDomain[];
|
|
40
|
+
laneCount: number;
|
|
41
|
+
}
|
|
42
|
+
interface PlacedDomain {
|
|
43
|
+
domain: ProteinDomain;
|
|
44
|
+
segments: RangeSegment[];
|
|
45
|
+
xStart: number;
|
|
46
|
+
xEnd: number;
|
|
47
|
+
xMid: number;
|
|
48
|
+
lane: number;
|
|
49
|
+
}
|
|
50
|
+
declare const ENTRY_TYPE_LABEL: Record<ProteinDomainEntryType, string>;
|
|
51
|
+
/**
|
|
52
|
+
* Build an InterPro `TrackGroup` containing one sub-track per requested
|
|
53
|
+
* entry-type (family / domain / repeat / homologous_superfamily by default).
|
|
54
|
+
*
|
|
55
|
+
* Each sub-track filters the host-supplied `ProteinAnnotations.domains` down
|
|
56
|
+
* to its entry-type, lane-packs the visible projections so overlapping
|
|
57
|
+
* domains stack into rows, and emits joined rectangles + linkers + labels in
|
|
58
|
+
* the same vocabulary as the Pfam track. Lane count is data-dependent, so a
|
|
59
|
+
* sub-track with no visible domains collapses to zero height (no empty row).
|
|
60
|
+
*/
|
|
61
|
+
/** InterPro returns a flat group — every member is a leaf {@link Track}.
|
|
62
|
+
* The refined return type preserves that invariant for callers that
|
|
63
|
+
* read `group.tracks[i].load(...)` directly without going through
|
|
64
|
+
* {@link isTrackGroup}. */
|
|
65
|
+
export declare function interProTrack(config?: InterProTrackConfig): TrackGroup & {
|
|
66
|
+
tracks: Track[];
|
|
67
|
+
};
|
|
68
|
+
export { ENTRY_TYPE_LABEL as interProEntryTypeLabel };
|
|
69
|
+
//# sourceMappingURL=interpro-track.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interpro-track.d.ts","sourceRoot":"","sources":["../../src/tracks/interpro-track.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAIV,aAAa,EACb,sBAAsB,EACtB,YAAY,EACZ,KAAK,EACL,UAAU,EAOX,MAAM,aAAa,CAAC;AAGrB,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,MAAM,CAAC;AAErD,MAAM,WAAW,mBAAmB;IAClC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;8EAC0E;IAC1E,MAAM,CAAC,EAAE,sBAAsB,EAAE,CAAC;IAClC;;;;+DAI2D;IAC3D,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B;kFAC8E;IAC9E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;6CACyC;IACzC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0EAA0E;IAC1E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;wBACoB;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;uCACmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,OAAO,CAAC;IAClD;;0DAEsD;IACtD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,sBAAsB,CAAC;IAClC,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,UAAU,EAAE,YAAY,EAAE,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,YAAY;IACpB,MAAM,EAAE,aAAa,CAAC;IACtB,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAmBD,QAAA,MAAM,gBAAgB,EAAE,MAAM,CAAC,sBAAsB,EAAE,MAAM,CAU5D,CAAC;AAqiBF;;;;;;;;;GASG;AACH;;;4BAG4B;AAC5B,wBAAgB,aAAa,CAAC,MAAM,GAAE,mBAAwB,GAAG,UAAU,GAAG;IAAE,MAAM,EAAE,KAAK,EAAE,CAAA;CAAE,CAwChG;AAED,OAAO,EAAE,gBAAgB,IAAI,sBAAsB,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interpro-track.test.d.ts","sourceRoot":"","sources":["../../src/tracks/interpro-track.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { type DataSource, type Track, type Viewport } from '../types.js';
|
|
2
|
+
/** Per-transcript CDS sequence lookup. The source returns the
|
|
3
|
+
* concatenated CDS string (A/C/G/T/N) for a given `transcriptId` —
|
|
4
|
+
* position 1 of the string corresponds to CDS bp 1. Pass a plain
|
|
5
|
+
* string to skip the adapter ceremony when the host already has the
|
|
6
|
+
* sequence in hand. */
|
|
7
|
+
export type NucleotideSource = string | DataSource<{
|
|
8
|
+
transcriptId: string;
|
|
9
|
+
}, string>;
|
|
10
|
+
export type NucleotideLetter = 'A' | 'C' | 'G' | 'T' | 'N' | 'U';
|
|
11
|
+
/** Bases for the donor and acceptor flank of one intron, both written
|
|
12
|
+
* 5′→3′. `donor[0]` is the bp immediately after the upstream exon's
|
|
13
|
+
* 3′ end (c.X+1); `acceptor[acceptor.length - 1]` is the bp
|
|
14
|
+
* immediately before the downstream exon's 5′ start (c.Y-1). Lengths
|
|
15
|
+
* should match the flank bp counts the viewport's collapsed-region
|
|
16
|
+
* spec assigns to this intron — any shortfall renders as `N`. */
|
|
17
|
+
export interface IntronicFlankBases {
|
|
18
|
+
intronIdx: number;
|
|
19
|
+
donor: string;
|
|
20
|
+
acceptor: string;
|
|
21
|
+
}
|
|
22
|
+
/** Optional companion to {@link NucleotideSource} that supplies the
|
|
23
|
+
* intronic flank bases adjacent to each spliced intron. When wired,
|
|
24
|
+
* the track renders faint cells under the donor / acceptor flank
|
|
25
|
+
* ribbons so the visible sequence reads continuously across the
|
|
26
|
+
* splice junctions. */
|
|
27
|
+
export type IntronicFlankSource = IntronicFlankBases[] | DataSource<{
|
|
28
|
+
transcriptId: string;
|
|
29
|
+
}, IntronicFlankBases[]>;
|
|
30
|
+
export interface NucleotideTrackConfig {
|
|
31
|
+
id?: string;
|
|
32
|
+
/** CDS sequence (5′→3′) keyed by transcript. */
|
|
33
|
+
source: NucleotideSource;
|
|
34
|
+
/** Optional intronic flank bases. When supplied, the track draws
|
|
35
|
+
* faint nucleotide cells over each donor / acceptor flank ribbon
|
|
36
|
+
* configured by the viewport's collapsed-region spec. */
|
|
37
|
+
flankSource?: IntronicFlankSource;
|
|
38
|
+
/** Opacity multiplier applied to the flank cell backgrounds and
|
|
39
|
+
* letter glyphs (so the flank readout reads visually subordinate to
|
|
40
|
+
* the exonic sequence). Default 0.45. */
|
|
41
|
+
flankOpacity?: number;
|
|
42
|
+
/** Minimum live pixels per CDS bp before the track unfurls. Below
|
|
43
|
+
* this the track reports `height === 0` and renders nothing.
|
|
44
|
+
* Default 8 — enough room to read a single ACGT glyph. */
|
|
45
|
+
minPxPerBp?: number;
|
|
46
|
+
/** Letter font size in px. The track height is `letterFontPx +
|
|
47
|
+
* topPad`. Default 12. */
|
|
48
|
+
letterFontPx?: number;
|
|
49
|
+
/** Padding between the exon ribbon's bottom and the top of the
|
|
50
|
+
* letter row. Default 2. */
|
|
51
|
+
topPad?: number;
|
|
52
|
+
/** Override the default A/C/G/T/N palette. Keyed by upper-case
|
|
53
|
+
* letter; any unknown letter falls back to the `N` colour. */
|
|
54
|
+
palette?: Partial<Record<NucleotideLetter, string>>;
|
|
55
|
+
}
|
|
56
|
+
export interface NucleotideTrackData {
|
|
57
|
+
/** CDS sequence (upper-case). May be shorter than `cdsLength` when
|
|
58
|
+
* the source returned a truncated string; positions past the end
|
|
59
|
+
* render as `N`. */
|
|
60
|
+
sequence: string;
|
|
61
|
+
/** Intronic flank bases, keyed by intronIdx. Each entry stores the
|
|
62
|
+
* donor and acceptor strings, upper-cased. */
|
|
63
|
+
flanks: Map<number, {
|
|
64
|
+
donor: string;
|
|
65
|
+
acceptor: string;
|
|
66
|
+
}>;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Slice 29 — per-bp nucleotide letters anchored under the exon
|
|
70
|
+
* ribbon. The track collapses to zero height (and renders nothing)
|
|
71
|
+
* until the live zoom exceeds `minPxPerBp`, at which point one glyph
|
|
72
|
+
* appears per visible CDS bp. Letters ride per-exon CSS transforms
|
|
73
|
+
* via the standard counter-scale wrapper so the on-screen font stays
|
|
74
|
+
* crisp regardless of zoom level.
|
|
75
|
+
*
|
|
76
|
+
* Protein mode hides the track entirely (`height === 0`) because CDS
|
|
77
|
+
* bp don't lay out under the aa axis.
|
|
78
|
+
*/
|
|
79
|
+
export declare function nucleotideTrack(config: NucleotideTrackConfig): Track<NucleotideTrackConfig, NucleotideTrackData>;
|
|
80
|
+
/** Live pixels per ruler unit (CDS bp in CDS modes, aa in protein
|
|
81
|
+
* mode). Computed against the public viewport API only — the
|
|
82
|
+
* current range's baseline-x span vs. the figure width. */
|
|
83
|
+
export declare function livePxPerUnit(viewport: Viewport): number;
|
|
84
|
+
//# sourceMappingURL=nucleotide-track.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nucleotide-track.d.ts","sourceRoot":"","sources":["../../src/tracks/nucleotide-track.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,UAAU,EAEf,KAAK,KAAK,EAKV,KAAK,QAAQ,EACd,MAAM,aAAa,CAAC;AAErB;;;;wBAIwB;AACxB,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,UAAU,CAAC;IAAE,YAAY,EAAE,MAAM,CAAA;CAAE,EAAE,MAAM,CAAC,CAAC;AAErF,MAAM,MAAM,gBAAgB,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAEjE;;;;;kEAKkE;AAClE,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;wBAIwB;AACxB,MAAM,MAAM,mBAAmB,GAC7B,kBAAkB,EAAE,GAAG,UAAU,CAAC;IAAE,YAAY,EAAE,MAAM,CAAA;CAAE,EAAE,kBAAkB,EAAE,CAAC,CAAC;AAEpF,MAAM,WAAW,qBAAqB;IACpC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,gDAAgD;IAChD,MAAM,EAAE,gBAAgB,CAAC;IACzB;;8DAE0D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