Alignment
Open a sorted, indexed BAM — or a SAM, which needs no index — and look at a locus: the coverage over the window and the reads beneath it, drawn from the real CIGAR so insertions and deletions land where the aligner put them.
| Reached by | Tools → Alignment (BAM · SAM) |
| Formats | BAM with .bai index SAM (no index needed) FASTA reference, with or without a .fai |
| Sample project | BAM & SAM alignments |
What it does
Opens a sorted, indexed alignment and draws one window of it: a coverage histogram across the
window, and beneath it the reads themselves, packed into rows. Every read is drawn from its real
CIGAR string, so an insertion, a deletion and a soft-clipped end land exactly where the aligner put
them rather than being smoothed into a bar. Mismatches come from the reference when one is loaded
and from the read's own MD tag when it is not — so a substitution mark is always something the
file actually states, never an inference.
The pileup is a browser, not a report: you drag to pan, wheel to zoom around the cursor, and type a locus to jump. A window is fetched from the index as you move, so a 50 kb view of a whole contig and a 200 bp view of one exon cost the same.
When you'd use this
Used in: Read a variant call set at a locus
You have an alignment and a question about one place in it. The three that come up most:
- "Is this variant real?" — go to the position and look. Depth, strand balance and where the mismatches fall in the reads answer it faster than any filter expression.
- "Did my construct assemble the way I think?" — align the reads to the design and read the junctions.
- "What is wrong with this library?" — the groupings below are the diagnosis: a pile of MAPQ 0 reads is a repeat, a band of RL-oriented pairs is a duplication signature, a band of mate-on-another-reference reads is a translocation or a contaminant.
Either side of it: Compare to reference when your reads are traces rather than short reads, and Variant calls when you want the calls rather than the evidence.
What this computes
Everything here is read out of the alignment you loaded — nothing is modelled and nothing is inferred from a published distribution.
Per window
- read depth across the window, drawn as a coverage histogram and reported as the maximum depth in view
- the read count, and whether it was sampled — a window over the drawing cap says "3,000 of 9,596 reads (sampled)" rather than quietly drawing a subset
- the insert-size band, measured from this file's own percentiles, not assumed; the panel states the band in bp and says whether it was measured or fell back to a default
- the proper-pair count, and plainly "none (unpaired reads)" when the library has no mates
- which reference the mismatches were called against — a loaded FASTA, a UCSC genome, or the
reads' own
MDtag - SAM provenance warnings: a headerless SAM whose reference lengths are the furthest aligned base rather than the true length, a SAM that was not coordinate-sorted and was sorted after reading, a truncated load, and malformed lines with the first one's line number
Per read
- mapping quality (MAPQ), CIGAR, length on the reference, and the mismatches
against the reference or the
MDtag - insert size (TLEN) and pair orientation — LR, RL, RR, LL — classified by IGV's own definitions, so a read flagged here is the read IGV flags
- the mate: its reference (
RNEXT), position (PNEXT) and strand, or the statement that there is no mapped mate - the SAM flags decomposed into their named bits — paired, proper pair, unmapped, mate unmapped, reverse strand, mate reverse, first/second in pair, secondary, supplementary, duplicate, QC fail
Diagnostics you get by grouping, each a separate question with its own picture: strand bias, first-of-pair strand for a stranded library, pair-orientation signatures of duplication and inversion, insert-size outliers over a deletion, mate-on-another-reference reads for translocations and contaminants, MAPQ bands that separate repeats from evidence, duplicate-flag bands that say whether depth is real, and primary/secondary/supplementary bands that expose split reads. Reads the grouping has no answer for get their own trailing band rather than being folded in, because "unpaired" is not the same claim as "mate on this reference".
What it does not compute: variant calls. This panel is the evidence; the calls are Variant calls.
Where it lives
Tools → Alignment (BAM · SAM), or open a .bam from the file rail and it opens its own canvas
tab. Right-click anywhere on the reads for the full menu: the layout, the four view-shaping
submenus below, read filters, export, the SAM header, and the two hand-offs — Align reads in view
(MSA) and Screen reads for vector.
Inputs and outputs
Accepts a coordinate-sorted BAM with its .bai, or a SAM (which needs no index because it
is read whole). A reference FASTA is optional and can be loaded separately; with one, mismatches
are called against it, and without one they fall back to the MD tag.
Refuses, with the reason on screen: a BAM with no index (it names the missing .bai — a browser
cannot scan a 3 GB file to find your locus), a reference whose contig names do not match the
alignment's, and a window whose read count exceeds the sampling cap, where it says what it sampled
rather than silently drawing a subset.
Produces the drawn window, a selectable read with its full record (flags decomposed, optional fields, the sequence), and the exports in the menu.
Worked example
Open the BAM & SAM alignments starter and let volvox-sorted.bam load at ctgA:1–50,001.
The locus bar reads 3,000 of 9,596 reads (sampled), mean coverage 59.4×, max 93×, MAPQ 37, 0.0% MAPQ0 — a clean library. The pileup packs those reads into 12 rows.
Now right-click ▸ Group by ▸ Mapping quality. The stack splits into two labelled bands: MAPQ 30+ · 2,904 reads and MAPQ 10–29 · 96. The second band is the interesting one: fewer than a hundred reads in the window map ambiguously, and they are not spread evenly — they cluster, which is what a small repeat looks like from here. Reads whose mates are missing or unmapped make the mate-derived groupings inert on this file, so those menu entries are disabled with the reason attached rather than silently doing nothing.
Silent, 18 seconds, recorded on the BAM & SAM alignments sample project. volvox-sorted.bam
opens over its first 50 kb as 3,000 of 9,596 reads, sampled evenly, at 19.2× mean depth; the
depth track is computed from every overlapping read, only the stacked reads are sampled. Typing
ctgA:10,000-10,300 and Go jumps to that window, Table lists those
reads with their positions and mapping quality, and Fit reference returns to the whole contig.
The file is read where it sits: nothing is uploaded.
Controls
| Control | What it changes |
|---|---|
| Locus | The window. Type ctgA:1,200-1,400, or use the zoom, fit and step buttons beside it |
| Views — Stack · Coverage only | Whether the reads are drawn at all. Coverage only keeps the histogram and the navigation |
| Color by | What a read's colour encodes: strand, first-of-pair strand, pair orientation, insert size, unexpected pair, MAPQ, or nothing. Mate-derived modes are offered only when the window has mapped mates |
| Group by | Splits the pileup into labelled bands, each packed on its own — see below |
| Sort by | Which read wins a row when they compete: start position, mapping quality, insert size, strand or read length |
| Filter reads | A MAPQ floor and the flag exclusions (secondary, supplementary, duplicate) |
| Reference | Load a FASTA so mismatches are called against it instead of the MD tag |
| Insert-size band | The percentile band the insert-size colouring and grouping read, measured from this file rather than assumed |
Grouping — nine questions, one picture each
Grouping is how a pileup stops being a wall of reads. Each band is packed separately, captioned with its name and its read count, and separated by a rule.
| Group by | What the bands separate | The signal it exposes |
|---|---|---|
| Strand | Forward reads above, reverse below | Strand bias at a position: a variant supported by one strand only is usually an artefact |
| First-of-pair strand | The strand of read 1, carried onto both ends | The original fragment's strand — the readout a stranded RNA-seq library is judged by |
| Pair orientation | LR (expected), RL, RR, LL | RL is a duplication signature; RR and LL are inversion signatures |
| Insert size | Inside the band, smaller, larger, mate elsewhere | A deletion shows as a band of larger-than-expected inserts over its span |
| Mate reference | Which reference each mate landed on | Translocations, and contaminant reads whose mates are on another contig |
| Mapping quality | 0 · 1–9 · 10–29 · 30+ | A pile of MAPQ 0 is a repeat, not evidence |
| Duplicate flag | What the marker flagged | Whether your depth is real or the same fragment counted many times |
| Alignment kind | Primary · secondary · supplementary | A split read — the alignment-level signature of a structural event |
| No grouping | One packed stack | The default |
A read the grouping has no answer for — no mate, no mapped mate — gets its own trailing band rather than being folded in with the rest, because "unpaired" is not the same claim as "mate on this reference".
Sorting
Sorting is applied before the reads are packed, so it changes which read wins a row rather than reordering rows after the fact. Sort by insert size and the reads carrying a structural signal rise to the top of the stack; sort by mapping quality and the confident evidence reads first.
Algorithms you can choose
The pair-derived readouts — orientation classes and the insert-size band — follow IGV's own definitions, so a read flagged here is the read IGV flags. That matters because "wrong orientation" and "too large" are conventions rather than facts: which end counts as left, and what counts as too large, differ between browsers, and matching IGV means the comparison a reader will actually make comes out the same.
The insert-size band is measured from your own file (its percentiles), not assumed from a published fragment-length distribution, and the menu says so where it is set.
The science
A pileup is evidence, and the two questions it answers are how much and how consistent. Depth alone is a weak claim: twenty reads that all start at the same base are one PCR duplicate family, and the grouping by duplicate flag says so at a glance. Consistency is what the orientation and insert-size groupings measure — a variant supported only by reads whose mates are unhappy is usually a mapping artefact at a repeat boundary rather than a real allele.
The reference-vs-MD distinction matters more than it looks: most aligners do not write MD, so
before a reference is loaded a read with real mismatches can draw perfectly clean. The panel says
which evidence it is using, in the locus bar.
Limitations
- The window is sampled above a cap. Very deep windows draw a sample and say so; the count in the locus bar is always "drawn of total".
- Rows are capped. A pileup deeper than the drawn row limit says how many rows exist and draws the first of them.
- No mate line drawing. Pairs are grouped and coloured, but the connecting line between mates is not drawn; the insert-size grouping is the intended reading for that question.
- A SAM is read whole, so a large one costs memory a BAM's index would have saved.
Fragment analysis
Open a capillary fragment run (.fsa/.hid) and size its peaks against its own ladder: dye channels on an axis in bases, five sizing methods, and the ladder's own measured error beside every length.
Variant Calls
Open a VCF as a real variant table — typed, filtered and countable — rather than as text you scroll.