LinearMultiSampleVariantDisplay
Auto-generated from the config schema in the source — see the config guide for concepts. Provided by the variants plugin. View source.
Example usage
Minimal VariantTrack config selecting this display type. The displays
array form is required here (rather than the object shorthand) because
this is a non-default display type — see
configuring displays:
{
type: 'VariantTrack',
trackId: 'cohort',
name: 'Cohort variants',
assemblyNames: ['hg38'],
adapter: {
type: 'VcfTabixAdapter',
uri: 'https://example.com/cohort.vcf.gz',
},
displays: [
{
type: 'LinearMultiSampleVariantDisplay',
},
],
}Preloading sample metadata: point the adapter's samplesTsvLocation at a TSV
whose first column is the sample name and whose other columns are per-sample
attributes (e.g. population), then rowColor one of those attributes to
color the sidebar rows on load. referenceDrawingMode: 'skip' (the default)
paints the background solid grey and draws only ALT alleles on top, which
makes overlapping structural variants easier to see; 'draw' paints the
reference alleles too. This is the 1000 Genomes "colored by population" demo
config:
{
type: 'VariantTrack',
trackId: 'cohort',
name: 'Cohort variants',
assemblyNames: ['hg38'],
adapter: {
type: 'VcfTabixAdapter',
uri: 'https://example.com/cohort.vcf.gz',
samplesTsvLocation: { uri: 'https://example.com/samples.tsv' },
},
displays: [
{
type: 'LinearMultiSampleVariantDisplay',
height: 800,
rowColor: 'population',
referenceDrawingMode: 'skip',
},
],
}Phased haplotype rows, one per haplotype of each sample. rows arranges
them by sample name, so the order below puts both of HG002's rows first:
{
type: 'VariantTrack',
trackId: 'cohort',
name: 'Cohort variants',
assemblyNames: ['hg38'],
adapter: {
type: 'VcfTabixAdapter',
uri: 'https://example.com/cohort.vcf.gz',
},
displays: [
{
type: 'LinearMultiSampleVariantDisplay',
height: 400,
unit: 'haplotype',
rows: { domain: ['HG002'] },
},
],
}One equal-width column per variant, tied to the genome by connector lines, for reading a genotype pattern across variants too close together to separate at their positions:
{
type: 'LinearMultiSampleVariantDisplay',
variantLayout: 'columns',
}See the Config slots section below for all available configuration fields.
Related links
- Adapter: BedpeAdapter
- Adapter: SplitVcfTabixAdapter
- Adapter: StarFusionAdapter
- Adapter: VcfAdapter
- Adapter: VcfTabixAdapter
- State model: runtime API
- Base config: BaseLinearDisplay
- Guide: Custom track and display types
- Guide: Grouping and lane order
- Guide: LD across an inversion (mosquitoes)
- Guide: Multi-sample variant display
- Guide: Mutation cohort (TCGA)
- Guide: Tracks
- Config guide: Variant track
Config slots
These slots go on a display entry: "displays": [{ "type": "LinearMultiSampleVariantDisplay", ... }], or in the track's displayDefaults when this is its default display. Slot types (fileLocation, frozen, ...) are explained in the config slot types reference. Slots a base configuration contributes are listed here too, so this table is the whole surface.
| Slot | Description |
|---|---|
heightnumber = 200 | Starting height in pixels for the whole display, including any band above the rows; drag-resizable, and the rows divide what is left while row height is on auto-fit |
variantLayoutstringEnum (genomic, columns) = 'genomic' | 'genomic' draws each variant across the bases it covers; 'columns' draws one equal-width column per variant in view, with a line tying each column to its position. Columns keep variants a few bases apart readable at any zoom, at the cost of their lengths. The LD display takes the same slot for the same choice. |
lineZoneHeightnumber = 20 | Height of the band of connector lines above the columns, spent only in the 'columns' layout.advanced |
| rows SampleRows | The rows are the file's samples, and the object is the arrangement a reader gives them, each member by row name: a sample in allele-count mode, a haplotype ("<sample> HP<n>") in phased mode, where a sample name stands for all of its haplotypes. The samples domain lists come first and the rest keep the file's order; a facet groups within it. Written whole, as every display's rows is. |
showTooltipsboolean = true | Show the hover tooltip naming the genotype, the sample and the record under the pointer. Off, the crosshairs, the highlighted cell and the cross-display session.hovered channel stay. |
unitstringEnum (sample, haplotype) = 'sample' | What one row stands for: 'sample' colors each row by allele dosage, 'haplotype' draws one row per phased haplotype |
| color VariantCellColor | The hue of every alt-carrying genotype cell: unset, the genotype colors; a CSS color or jexl: callback; or a field, one of the impact, svType and phaseSet presets or any record field, whose values each take a color with a key. |
shadeByDosageboolean = true | Compose the cell hue with the genotype's alt dosage — the fraction of its called alleles that are non-reference — so a homozygote paints the hue itself and a heterozygote a lighter version of it. Off paints each alt-carrying cell its flat hue. |
minorAlleleFrequencyFilternumber = 0 | Hide variants whose minor allele frequency is below this threshold advanced |
maxMissingnessFilternumber = 1 | Hide variants whose fraction of uncalled alleles is above this threshold; 1 keeps every variant advanced |
showLegendboolean = true | Whether to draw the floating legend over the display. It is clipped to the display's own bounds, so turn it off to size a short display to its rows rather than to its key. |
| rowColor RowColor | The bar beside each row's label: a sample-metadata attribute whose palette colors every row, or under name the colors a reader set row by row. |
| facet Facet | A sample-metadata attribute (a column in the adapter's samplesTsvLocation, e.g. "population") whose values each take their own band of rows; or { field, domain }, the listed values banding first and the rest sorted. Unset, the rows keep their existing order.The band is applied when the rows are read, over whatever order the reader has arranged, so a drag that moves a sample into another band snaps back while this is set. Each band is labelled beside the tree and draws the clade of the cluster tree whose leaves are exactly its rows; a clustering run under bands clusters each band apart. |
referenceDrawingModestringEnum (draw, skip) = 'skip' | Whether to paint reference alleles: 'skip' (the default) fills the row background solid grey and paints only ALT alleles, which makes overlapping variants easier to pick out; 'draw' paints reference alleles like any other genotype. |
showInsertionGlyphsboolean = true | Widen each alt-carrying cell of an insertion to a marker sized by the inserted bp, the same one plugins/alignments and plugins/maf draw, with the bp count when the row is tall enough. An insertion consumes almost no reference, so without it a 65 kb insertion draws at the same 2px floor as a SNP. Only cells whose genotype carries the allele widen, and each keeps its genotype color. Columns have no span to correct, so this applies at genomic positions only. |
showVariantLaneboolean = false | Draw a LinearVariantDisplay-style lane above the genotype rows: one mark per record at its genomic span, colored by whatever "Color by → Cells" is set to, drawn by that display's own band code. Overlapping records stack while the band has room and share a row once it has not; hovering a mark reports the record, clicking opens its details, and right-clicking opens the menu a genotype cell does. At genomic positions only. |
variantLaneHeightnumber = 40 | Height of the variant lane, spent only while showVariantLane is on.advanced |
variantLaneLabelsstringEnum (auto, nameAndDescription, name, description, none) = 'auto' | Letter the lane's marks with each record's VCF ID and/or its description, as a LinearVariantDisplay letters the same record. What the band has room for is decided by that display's fit ladder: descriptions go first, then IDs are thinned, then dropped. |
filterexpressionArray = [] | jexl: expressions a feature must pass to be drawn |
rowHeightnumber = 0 | per-row height in px, scrolling the rows that do not fit; 0 (the default) fits the rows to the display height instead, dividing it between them |
showTreeboolean = true | Show the sample clustering tree in the sidebar |
showBranchLengthboolean = true | position tree nodes by branch length (dendrogram) rather than evenly by topology (cladogram) |
showRowLabelsboolean = true | Show the per-sample row labels in the sidebar |
treeAreaWidthnumber = 80 | width in px of the tree sidebar, which a drag on its edge also writes |
showRowSeparatorsboolean = false | draw a hairline between adjacent rows; off by default, because a painting whose neighbouring rows differ in color already separates itself and the line only earns its pixel where they do not — a run of same-colored rows reads as one block without it, with no way to recover the row count by eye. Drawn only once rows are at least 4px tall: below that the line is as thick as the row it borders, turning a dense painting into a grid of hairlines with a little color between them |
| Inherited from BaseLinearDisplay | 3 slots |
mouseoverstring = | text to display when the cursor hovers over a feature callback args: feature |
fetchSizeLimitnumber = 1_000_000 | maximum data to attempt to download for a given track, used if adapter doesn't specify one advanced |
forceLoadboolean = false | Declarative equivalent of the "Force load" button on the "too much data" banner: when true the display always renders, however large the region or dense the features. Off by default (the gate guards against huge downloads). Set it on a view no one can interact with — an embedded / notebook view, or a screenshot — where the region is known and you want it drawn without a click. advanced |