This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Allele frequency of a gene from a .bam file.

It is easy to get allele frequency for a site (mutation/snp etc.) from a bam file. How do we get the allele frequency of a gene (in some metric) from a .bam file, like dominant allele frequency of a gene, for instance? Any advice from population genetics people here? Thanks!

allele frequency

dominant allele frequency of a gene

I'm not sure if that even makes sense. Can you elaborate on what you mean?

I think I mean beta allele frequency like they compute in CNVs (FREEC, for instance).

2 answers

call the position of your gene with samtools http://www.htslib.org/workflow/

samtools mpileup -ugf ref.fa -r "chr1:1234-2345" your.bam | bcftools call -vm -o out.vcf

your should get the variants with the AF fields

Thank you Pierre. Yes, I get that we can get AF from variants. But I am looking at some metric for a region, in general, like beta allele frequency they compute when calling CNVs.

Hi,

For one chromosome, I ran the command: samtools mpileup -ugf GRCz10.fasta mutant_chr12.bam | bcftools call -vm -o chr12.mut.raw.vcf

I seem to have used the same options for mpileup and bcftools call, but I do not seem to get the AF field in my output vcf files. I do get the DP4 field nested in the info column, but is there a way to get a seperate column for AF or at least a seperate column for DP4 in the vcf file?

Thanks, Azman

Log in to answer this question.