Skip to content

Latest commit

 

History

History
21 lines (17 loc) · 431 Bytes

BAM_operations.md

File metadata and controls

21 lines (17 loc) · 431 Bytes

Some common operations to look at BAM file headers using samtools:

View the header

samtools view -H $MYBAMFILE

Get ReadGroup (RG) info from the header

samtools view -H $MYBAMFILE | grep "^@RG"

Get only sample (SM) info from the header

samtools view -H $MYBAMFILE | grep "SM"

Look at a small portion of the reads, by region mapped to, for example

samtools view $MYBAMFILE chr19:10000000-10000000