How do I get a sub-section of a BAM file?

There are two ways to get subsections of our BAM files.

The first is to use the Data Slicer tool from the Ensembl GRCh37 browser which is documented here. This tool gives you a web interface requesting the URL of any BAM file and the genomic location you wish to get a sub-slice for. This tool also works for VCF files.

The second it to use samtools on the command line, e.g

samtools view -h 17:7512445-7513455

Samtools supports streaming files and piping commands together both using local and remote files. You can get more help with samtools from the samtools help mailing list

Related questions: