Genome Information From Bam
1
0
Entering edit mode
10.1 years ago
ChIP ▴ 600

Hi!

Is their a way to know the genome build(ie., hg18 or hg19) to which the BAM file is aligned, other than manual inspection.

Thank you

genomics chip-seq bam • 1.6k views
ADD COMMENT
1
Entering edit mode
10.0 years ago

get the dictionary in the sam header and test one chromosome

$ samtools view -H file.bam |\
 grep -E 'SN\:(chr)?22' |\
 awk '{if(index($0,"LN:51304566")!=0) printf("hg19\n"); else if(index($0,"LN:49691432")!=0) printf("hg18\n"); else printf("??\n");}'
hg19
ADD COMMENT

Login before adding your answer.

Traffic: 2689 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6