Each format isone step's output
The formats are not arbitrary. They form a chain, and knowing where you are in it tells you which tool comes next.
FASTQ — reads and per-base quality. The rawest thing you will normally handle.
SAM, BAM or CRAM — the same reads, now placed against a reference genome.
VCF, BED, GFF — statements about positions, small enough to open in a text editor.
FASTA and FASTQ,and the difference is quality
Two text formats that look almost identical. One carries confidence per base and the other does not.
FASTQ quality is a Phred score encoded as one printable character per base, so the quality line is always exactly as long as the sequence line. If those two lengths disagree, the file is truncated — a surprisingly common outcome of an interrupted download, and one that tools report in confusing ways.
SAM, BAM, CRAMhold where reads landed
Three encodings of one record type: this read, this position, this many mismatches, this confidence.
Plain text, one line per alignment. Readable, and far too large to keep.
The binary form, compressed and indexable. The working format for essentially everything.
Smaller again, stored as differences from a reference you must keep alongside it forever.
CRAM is worth knowing about specifically because of its catch. It stores differences against a reference rather than whole reads, which is why it is so much smaller — and why the file becomes unreadable if you lose the exact reference it was written against. Archive the reference with the data, or use BAM.
VCF, BED and GFFdescribe positions
Once the reads are placed, the remaining formats all say the same kind of thing: something is here, on this chromosome, between these coordinates.
The coordinate trap is worth committing to memory: BED is zero-based and half-open, while VCF, GFF and SAM are one-based and inclusive. A feature at BED chr1 100 200 is the same span as GFF chr1 101 200. Off-by-one errors between tools are almost always this, and nothing warns you.
SAMtools isalready built
Nothing here needs compiling. Pick a machine, and these two commands put it on there.
$ dxflow workflow create --identity samtools hub://samtools
$ dxflow workflow start samtools