Before you start
- A look at Sequences: FASTA and FASTQ gives helpful context, but is not required.
- Any term new? The Glossary has it.
Learning objectives
By the end of this lesson you will be able to: tell apart the common bioinformatics file formats including FASTA, FASTQ, SAM, BAM, VCF, BED, and GFF or GTF, and know at a glance what kind of data each one holds.
Beyond FASTA and FASTQ, a handful of other text formats show up constantly in genomics. Each one exists to answer a single, specific question. Learn the question, and the format makes sense. Here's the whole family.
SAM / BAM Where did each read map?
After you sequence a sample, you have millions of short reads. The next step is figuring out where in the genome each read came from - that's alignment. The result is stored as SAM (Sequence Alignment/Map), a text table with one row per alignment (usually one per read; unmapped reads are kept too) showing which chromosome and position it matched.
# one read's row, heavily simplified (real SAM has 11 fixed columns: # QNAME FLAG RNAME POS MAPQ CIGAR RNEXT PNEXT TLEN SEQ QUAL) read1 chr7 55019021 ATGCGTACGT... 60
BAM is simply the compressed, binary version of SAM - same information, far smaller and faster for computers to read. You'll almost always store BAM and convert to readable SAM only when you need to look.
Why two versions?
A human sequencing run produces hundreds of millions of alignments. As plain-text SAM that's enormous; BAM squeezes it down. Rule of thumb: SAM = readable, BAM = efficient. The samtools program converts between them.
VCF How does this genome differ?
Once reads are aligned, you can ask: where does this individual's DNA differ from the reference? Each difference is a variant, and they're stored in a VCF (Variant Call Format) file - one row per variant, giving its position and what changed.
#CHROM POS ID REF ALT QUAL FILTER INFO chr11 5227002 . T A 99 PASS . chr7 117559590 . G C 87 PASS . # GRCh38 coordinates; the first row is the sickle-cell change in HBB (rs334), # the second is illustrative. Real VCFs then add FORMAT and one column per sample.
That first row reads: on chromosome 11, position 5,227,002, the reference has a T and an A was observed instead (the per-sample columns, left out here, say which samples carry it). VCF is how genetic differences - including disease-causing mutations - are recorded and shared.
GFF / GTF Where are the genes?
A genome is just a long string of letters; GFF (Generic Feature Format) and its close cousin GTF are the annotation - the map that says "a gene starts here, an exon is there." Each row describes one feature: its type, chromosome, and start/end coordinates.
chr7 havana gene 55019017 55211628 . + ...EGFR
chr7 havana exon 55019017 55019365 . + ...
This is what lets a tool say "this variant falls inside the EGFR gene." GTF is a close relative of the older GFF2, required to carry gene_id and transcript_id for every feature, and is used a lot in RNA-seq; GFF3 is the current GFF version.
BED Which regions am I interested in?
BED is the simplest of all: a plain list of genomic intervals - chromosome, start, end - often with a name. It's the universal way to say "look at just these stretches of the genome."
# chrom start(0-based) end name (no header line in a real BED file)
chr7 55019016 55211628 EGFR
chr11 5225463 5227071 HBB
Decode the jargon: 0-based vs 1-based
A famous trap: BED counts positions from 0, while VCF and GFF count from 1. So the same base can have two different numbers depending on the format: compare the EGFR start in the GFF (55019017) with the BED (55019016). BED ends are not shifted, because BED intervals are half-open (the end base is not included). It catches everyone once; BAM and Python also count from 0, but among the text files you read by eye, BED is the odd one out.
Your quick reference
| FASTA | Sequences (genes, genomes, proteins) - header + sequence. |
| FASTQ | Raw sequencing reads with quality scores. |
| SAM / BAM | Where each read aligned to the genome (BAM = compressed). |
| VCF | Variants - how a genome differs from the reference. |
| GFF / GTF | Annotation - where genes, exons, and other features are. |
| BED | A simple list of genomic regions of interest. |
You don't need to memorize the exact columns - you'll look those up forever, and that's normal. What matters is recognizing each format on sight and knowing the question it answers. That alone puts you ahead of most beginners.
Check your understanding
Sources & further reading
- Li H, Handsaker B, Wysoker A, et al. The Sequence Alignment/Map format and SAMtools. Bioinformatics 25: 2078-2079, 2009. doi:10.1093/bioinformatics/btp352
- Danecek P, Auton A, Abecasis G, et al. The variant call format and VCFtools. Bioinformatics 27: 2156-2158, 2011. doi:10.1093/bioinformatics/btr330
- Danecek P, Bonfield JK, Liddle J, et al. Twelve years of SAMtools and BCFtools. GigaScience 10: giab008, 2021. doi:10.1093/gigascience/giab008
Official specifications and documentation:
SAM, VCF and BED specifications (hts-specs): samtools.github.io.
UCSC Genome Browser data file formats (BED, GFF/GTF): genome.ucsc.edu.
GFF3 specification, Sequence Ontology: github.com.
Last reviewed: October 2026.
