Question: Genome Information From Bam
0
gravatar for ChIP
5.2 years ago by
ChIP500
Netherlands
ChIP500 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.1k views
ADD COMMENTlink modified 5.2 years ago by Pierre Lindenbaum120k • written 5.2 years ago by ChIP500
1
gravatar for Pierre Lindenbaum
5.2 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum120k 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 written 5.2 years ago by Pierre Lindenbaum120k
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: 1536 users visited in the last hour