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 read showing which chromosome and position it matched.
# one read's row (simplified): name, position, sequence...
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
chr11 5227002 . T A 99
chr7 117559590 . G C 87
That first row reads: on chromosome 11, position 5,227,002, the reference has a T but this sample has an A. 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 (General 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 slightly stricter flavor of GFF used a lot in RNA-seq.
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 end name
chr7 55019017 55211628 EGFR
chr11 5225464 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. It catches everyone once; just remember BED is the zero-based oddball.
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
samtools program converts between them.