Welcome to the Genome Toolbox! I am glad you navigated to the blog and hope you find the contents useful and insightful for your genomic needs. If you find any of the entries particularly helpful, be sure to click the +1 button on the bottom of the post and share with your colleagues. Your input is encouraged, so if you have comments or are aware of more efficient tools not included in a post, I would love to hear from you. Enjoy your time browsing through the Toolbox.

Thursday, June 20, 2013

Does BAM File Use Hg18 or HG19 Coordinates?

How do you tell which coordinates are used in a .bam file?  Well, its pretty easy.  Just pull the .bam file header up using Samtools

samtools view -H filename.bam
view raw bam_header.sh hosted with ❤ by GitHub

Then check out the rows that begin with @SQ followed by SN:chr## and LN:########.  Compare the lengths of a few of the chromosomes to the below list of lengths.  Whichever list the lengths match will indicate which coordinates are being used in the .bam file.

Chromosome hg18 Length hg19 Length
chr1 247249719 249250621
chr2 242951149 243199373
chr3 199501827 198022430
chr4 191273063 191154276
chr5 180857866 180915260
chr6 170899992 171115067
chr7 158821424 159138663
chr8 146274826 146364022
chr9 140273252 141213431
chr10 135374737 135534747
chr11 134452384 135006516
chr12 132349534 133851895
chr13 114142980 115169878
chr14 106368585 107349540
chr15 100338915 102531392
chr16 88827254 90354753
chr17 78774742 81195210
chr18 76117153 78077248
chr19 63811651 59128983
chr20 62435964 63025520
chr21 46944323 48129895
chr22 49691432 51304566
chrX 154913754 155270560
chrY 57772954 59373566
chrM 16571 16569
view raw gistfile1.txt hosted with ❤ by GitHub

Hope this is helpful in determining which coordinates are used in your .bam files.

No comments:

Post a Comment