thebench.bio #1 Ecosystem for the Bio-Tech Industry
All NGS questions

Question 13 of 20 Fundamentals Concept

What do the FASTQ, BAM and VCF files in an NGS pipeline each contain?

Short answer

FASTQ holds raw reads with a quality score per base. BAM, the binary form of SAM, holds those reads aligned to a reference with positions, flags and mapping quality. VCF holds the variant calls made from the alignments, with genotypes and quality fields.

Why

Each format is the output of one stage, and knowing what each keeps tells you where to look when something goes wrong. A FASTQ record has four lines: a name, the sequence, a separator and an ASCII string encoding each base's Phred quality, as described in the FASTQ format paper by Cock and colleagues. Aligning reads produces SAM, a text format, or BAM, its compressed binary form.

The SAM specification defines fields such as the reference name and position, a bitwise FLAG that marks things like paired, unmapped, secondary or duplicate reads, the CIGAR string describing matches, insertions and deletions, and MAPQ, the mapping quality. Variant calling then writes a VCF. Each line gives a chromosome, position, reference and alternate alleles, a QUAL score, a FILTER field that reads PASS when the call clears the filters, an INFO column and per-sample fields such as genotype (GT), genotype quality (GQ) and depth (DP).

When a call looks wrong, go back a stage: view the BAM at that position, and if the reads look strange, check the FASTQ quality and adapters.

A strong answer covers

  • FASTQ: sequence plus per-base quality
  • SAM and BAM: alignment position, FLAG, CIGAR and MAPQ
  • VCF: variant, QUAL, FILTER and per-sample genotype fields
  • Debug a call by moving back through the stages

Common mistakes

  • Treating a VCF without its BAM as enough evidence to judge a doubtful call
  • Ignoring the FILTER column and using every row as a confident call
  • Assuming duplicate reads are removed from a BAM rather than flagged