Multi-sample variant display
TL;DR: A VCF can carry genotypes for many samples. JBrowse shows them with one of two displays, switchable from the track menu:
- Multi-sample variant display (regular) - variants drawn at their true genomic positions, one row per sample
- Multi-sample variant display (matrix) - variants laid out as a heatmap, one row per sample and one column per variant
Regular display: structural variants at their real span
Each variant is drawn at its real genomic position. This is the only multi-sample display that renders structural variants at the right scale, and overlapping calls use slight transparency so you can still tell them apart.
If overlaps overwhelm the view, use "Edit filters" in the track menu to hide variants by size, name, or any Jexl expression.
Matrix display: SNP and indel patterns
Each visible variant gets one column and each sample gets one row, regardless of how far apart the variants are on the genome. A thin black line connects each column to its real genomic position.
Sparse small variants that would be only 1–2px wide at their true positions each get a full readable column. Patterns like shared haplotypes, runs of homozygosity, and population structure become visible at a glance.
Filtering by allele frequency and missingness
Two inline sliders in the track menu thin a dense callset down to the variants worth looking at. Both live under Track menu → Filter by... and re-fetch as you release the slider:
- Minor allele frequency hides variants whose minor allele frequency falls below the threshold, so singletons and near-monomorphic sites drop out and the common, population-informative variants remain.
- Missingness hides variants whose fraction of no-call genotypes rises above the threshold. Its default keeps every variant; lowering it drops the poorly-genotyped columns that are mostly missing data.
Missingness is especially useful on a matrix display, where each variant takes a full column no matter how many of its genotypes are no-calls.
Either filter can be preset so the track loads already filtered, with the
minorAlleleFrequencyFilter
and
maxMissingnessFilter
display slots. See
configuring default display settings.
Genotype coloring: allele dosage vs phased
Both the regular and matrix displays color each genotype cell, and how they
color it is set by the
renderingMode
display option.
In allele-dosage mode ('alleleCount'), one cell is drawn per sample and
shaded by how many alternate alleles the call carries:
- homozygous reference (
0/0) → light grey - heterozygous (
0/1) → a medium shade - homozygous alternate (
1/1) → the darkest shade
so the cell color reads directly as allele dosage (0, 1, or 2 alt alleles) and
runs of homozygous-alt samples stand out as the darkest blocks. Genotypes mixing
two different non-reference alleles (e.g. 1/2) get a distinct color from a
simple homozygous-alt call, and uncalled genotypes (./.) are left blank.
In phased mode (renderingMode: 'phased'), each sample is split into one
row per haplotype and every haplotype cell is colored reference vs alt on its
own, rather than collapsed to a dosage. This is what makes inherited haplotype
blocks line up as the contiguous vertical bands in the trio matrix above. Phased
mode requires phased genotypes (|-separated) in the VCF.
You can switch modes from the track menu, or set renderingMode in the display
configuration.
Coloring by consequence impact (SnpEff/VEP annotations)
If the VCF's INFO field carries SnpEff ANN or VEP CSQ annotations, each
variant's alt-carrying cells can be colored by the severity of its most severe
predicted consequence instead of by genotype. From the track menu, open Color
by... and choose Consequence impact under Cells. The entry stays
visible on a VCF that carries no annotations, but is greyed out and names why:
(checking for annotations...) while the scan runs, then (no SnpEff/VEP
annotations found).
Every annotation is bucketed into one of four impact tiers and painted with a fixed color, so the legend is the same across tracks:
- HIGH (red) - e.g.
stop_gained,frameshift_variant,exon_loss_variant - MODERATE (orange) - e.g.
missense_variant,inframe_deletion - LOW (yellow) - e.g.
synonymous_variant,splice_region_variant - MODIFIER (grey) - e.g.
intron_variant,intergenic_region
This works for both SNVs/indels and structural variants. SnpEff's SV-specific
consequence terms (exon_loss_variant, transcript_ablation, gene_fusion,
...) map onto the same four tiers, so a deletion that removes an exon reads as
HIGH the same way a stop-gained SNV does.
To have the track load already colored this way, preset the display's
featureColor slot: see
coloring cells by the variant instead of the genotype.
Coloring by SV type
Structural variants can be colored by their class instead of by genotype: each alt-carrying cell takes the color of its variant's structural-variant type. From the track menu, open Color by... and choose SV type under Cells. Like the consequence option it greys out rather than disappearing, reading (no structural variants found) on a callset that carries none.
The common classes get fixed colors, so the legend reads the same across tracks:
deletion (red), duplication (blue), insertion (green), inversion (orange), copy
number (purple), and breakend (brown). Any other SVTYPE token gets an
auto-assigned color and shows its raw token in the legend, and a record whose
alleles span more than one class is flagged Mixed (grey). The legend lists
only the classes actually present in the loaded region.
Copy-number alleles written as <CN0>, <CN1>, <CN3>, ... are colored on an
absolute rainbow by copy number (low copy blue, ascending to red), so different
copy states read apart. The spectrum ascends plainly, with no assumed baseline
copy number.
The class is read from the ALT allele (<DEL>, <CN3>, breakend notation),
falling back to INFO/SVTYPE when the ALT is a plain sequence.
This preset also has a
featureColor value
so a track can load already colored by SV type.
Coloring and grouping by sample metadata
Samples can be grouped and colored by metadata: population, phenotype, sex, or any attribute you supply. Two slots wire it up:
samplesTsvLocationon the adapter takes a samples TSV whose first column is the sample name (matching the VCF header) and whose every remaining column is a metadata attribute.colorByon the display names one of those columns, and the per-sample rows are grouped and colored by that attribute the first time the track loads.
The JBrowse demo wires up the 1000 Genomes phase 3 chr1 callset (2,504 samples across 26 population codes) this way. For the TSV layout and the adapter and display slots, see auto-coloring samples by metadata.
You can also change the grouping attribute and colors interactively after the track is open.
Clustering samples by genotype
Samples can be reordered by genotype similarity, via Clustering → Cluster rows by genotype... in the track menu. See Clustering rows for the modes, the dendrogram, and how to share a result in a session URL.
In phased mode, clustering treats each haplotype as a separate row, so the dendrogram shows haplotype-level relationships.