Tutorials

Reading a VCF file column by column

What every VCF column means, how genotypes and INFO fields work, why multi-allelic sites need normalising and what a PASS filter does not prove.

A VCF file lists variants at positions along a reference genome. The header defines the reference and the format, and each data line describes one variant with its alleles, quality, filter status and optional annotations.

The header

Header lines start with ##. They record the file format version, the reference assembly, the contig lengths, the INFO and FORMAT field definitions, and any annotation software used. The single #CHROM line names the columns.

Read the header before the variants. It tells you which genome build the coordinates refer to and what each INFO key means. A VCF without a reference header is ambiguous, even if the chromosome names look familiar.

The eight fixed columns

  1. CHROM: chromosome or contig.
  2. POS: one-based position on the reference.
  3. ID: a database identifier or . when none.
  4. REF: the reference allele.
  5. ALT: one or more alternate alleles.
  6. QUAL: a phred-scaled quality score for the variant call.
  7. FILTER: PASS or a reason the call failed a filter.
  8. INFO: semicolon-separated key-value annotations.

After these come FORMAT and one column per sample. A sites-only VCF has no sample columns.

Genotypes and FORMAT

FORMAT names the per-sample fields, for example GT:AD:DP:GQ. Each sample then has values in that order. GT is the genotype, such as 0/1 or 1|1. AD is the allele depth, DP is total depth and GQ is genotype quality.

The separator matters. / means unphased, and | means phased. A missing value is .. A genotype of ./. means the sample was not called at that position, which is different from a homozygous reference 0/0.

INFO fields worth knowing

Common keys include DP (site depth), AF (allele frequency), AC (allele count), AN (allele number), MQ (mapping quality), QD (quality by depth) and FS (strand bias). An annotation tool may add CSQ, ANN or vep fields with predicted consequences.

The same key can mean different things in different pipelines. Read the header definition rather than assuming. A DP in INFO may be the total depth across samples, while a sample-level DP is that sample's depth.

Multi-allelic sites

A site can have more than one alternate allele, for example ALT=A,T. Some tools split these into separate lines (bcftools norm -m -), which makes comparison and annotation easier. Others keep them together. Decide on a representation and normalise before merging or comparing.

Left-aligning indels is also important. The same deletion can be written in more than one way, and two files that represent it differently will not match in a simple comparison.

FILTER and QUAL

PASS means the call passed the filters that were applied. It does not mean the variant is real. A low QUAL may still be a true variant in a difficult region, and a high QUAL may be a false call in a repeat.

The filter labels are pipeline-specific. A file may contain LowQual, QD2, SnpCluster or custom names. Read the header and the pipeline documentation. Do not compare QUAL values across callers as if they were on the same scale.

What a VCF does not contain

A VCF does not contain reads, alignment quality per read or phasing across the whole genome. It does not prove that a variant is somatic, germline or clinically meaningful. Those conclusions need the BAM, the sample design and external evidence.

A VCF also does not carry the full analysis history. Keep the command line, the reference checksum, the caller version and the filtering steps with the file.

A small worked example

Consider a line with CHROM=1, POS=1000, REF=A, ALT=G, QUAL=60, FILTER=PASS and a sample field GT:DP=0/1:30. Read it as: on chromosome 1 at one-based position 1000, the reference has A and the sample has one copy of G and one copy of A, with 30 reads at the site.

Now imagine a second file with the same variant written as POS=999 and an indel representation nearby. The two files may describe the same biological event, but they are not textually identical. Normalisation and a reference check are needed before a merge. This is why a VCF is a representation of evidence, not a universal truth.

Filtering and merging

A VCF can be filtered by quality, depth, genotype or annotation. Filtering is a decision, and the thresholds should be chosen before the analysis. A filter that removes 90 percent of the calls may remove the real signal along with the noise.

Merging VCFs requires the same reference, the same chromosome naming and a consistent representation of multi-allelic sites and indels. Normalise first, then merge, then check the sample columns. A merge that silently drops a sample is worse than a merge that fails.

Sample columns and cohort files

A multi-sample VCF stores one column per sample. The order of the samples is defined by the #CHROM line and must be preserved. A tool that reorders samples without updating the header can swap genotypes between individuals.

For a cohort, check the sample names against the sample sheet before any association analysis. A duplicated or missing sample is easier to catch at this stage than after a model has been fitted. Keep a mapping from the VCF sample name to the study identifier.

Key points

  • The header defines the reference and the field meanings.
  • POS is one-based; REF and ALT are alleles, not genotypes.
  • PASS is a filter status, not a truth claim.
  • Multi-allelic sites and indels need normalisation before comparison.
  • Keep the BAM and the methods with the VCF.

Common mistakes

  • Reading a VCF without checking the reference build.
  • Treating 0/0 and ./. as the same thing.
  • Comparing QUAL across different callers.
  • Merging VCFs with different multi-allelic representations.
  • Ignoring the difference between site depth and sample depth.

When to ask for help

If two VCFs will not merge, if a variant has an unexpected genotype, or if the annotation does not match the transcript you expect, ask before filtering further. You can order an analysis or read the variant annotation guide. The Variant workspace can inspect a VCF, and the variant calling pipeline overview covers the steps before it.

Sources and further reading

When to ask for help. If your data or design do not fit a tutorial, order an analysis and we will reply with a fixed price.

Written by the Solagene team for research and education. Found an error? Tell us and we will correct it.