Question: Genome Information From Bam
0
gravatar for ChIP
5.8 years ago by
ChIP550
Netherlands
ChIP550 wrote:

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

bam chip-seq genomics • 1.2k views
ADD COMMENTlink modified 5.8 years ago by Pierre Lindenbaum125k • written 5.8 years ago by ChIP550
1
gravatar for Pierre Lindenbaum
5.8 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum125k wrote:

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 COMMENTlink modified 3 months ago by RamRS25k • written 5.8 years ago by Pierre Lindenbaum125k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1483 users visited in the last hour