Lesson 6 of 16 · 10 min
The bioinformatics file-format zoo
As you start doing bioinformatics, you will keep bumping into files with unfamiliar extensions like .fasta or .vcf. A file format is just an agreed-upon way of laying out information inside a file, so that both people and programs know where everything is. The good news is that almost all of these are plain text files you can open and read, so there is nothing scary hiding inside.
Tip: You do not need to memorize any of these formats right now. This lesson is a friendly walking tour so the names feel familiar later. You can always look up the fine details on the day you actually open one.
Sequences and reads
A sequence is simply the string of chemical letters that spells out a piece of DNA, RNA, or protein; for DNA those letters are A, C, G, and T, each standing for one nucleotide, the tiny building blocks of the molecule. FASTA files store these sequences: a header line that starts with a > gives the name, and the lines below hold the letters. You meet FASTA whenever you download a gene (a stretch of DNA that carries the instructions for one job), a whole genome (all of the DNA an organism has), or a protein to work with.
A read is one short stretch of sequence that a DNA sequencing machine produces as it reads a sample, and a single experiment can create millions of them. FASTQ files store these reads together with a quality score for every letter, which tells you how confident the machine was that it read that letter correctly. You meet FASTQ as the very first raw output that comes straight off a sequencing machine.
Alignments, variants, features
An alignment is the result of working out where each read best fits along a known reference sequence, which is a standard, agreed-upon genome used as a map to compare against. SAM files store these alignments as readable text, while BAM files hold exactly the same information packed down into a compressed form (called binary) that computers read quickly but people cannot open by eye. You meet SAM and BAM right after your reads have been mapped onto a reference.
A variant is a specific spot where your sample's DNA differs from the reference, for example a position that is a G in most people but an A in this sample. VCF, short for Variant Call Format, is a table that lists these differences, one variant per line, with its position and what changed. You meet VCF once a pipeline has compared your sample to the reference and pulled out the differences.
GFF and GTF files are annotation files: they describe where genes and other features sit along a genome, like labels on a map saying a gene starts here and ends there. BED files do a simpler version of the same job, listing plain genomic intervals as just a chromosome name with a start and an end position. You meet GFF, GTF, and BED whenever a tool needs to know which regions of the genome you care about.
head -n 2 genes.bedchr1 11873 14409 DDX11L1 0 +
chr1 14361 29370 WASH7P 0 -
Try it yourself: Without looking back, match each format to its job. The formats are FASTA, FASTQ, SAM/BAM, VCF, and GFF/GTF/BED. The jobs are: plain sequences; raw reads plus quality scores; reads aligned to a reference; the differences from a reference; and where genes and features sit. Then scroll up and check your answers against the sections above.