B allele frequency (BAF)
2
0
Entering edit mode
3.6 years ago
rthapa ▴ 90

Hi, I want to calculate B allele frequency from a vcf file. I found that vcftools can be used to estimate allele frequency of REF allele and ALT allele. I wonder if vcftools could also estimate B allele frequency. Are there other tools that we could use for calculation BAF from vcf file?

Thanks

snp • 4.1k views
ADD COMMENT
0
Entering edit mode

B allele frequency, like from a illumina genotyping array?

ADD REPLY
0
Entering edit mode

Not from Illumina genotyping array but from vcf file generated from NGS data.

ADD REPLY
0
Entering edit mode
3.6 years ago

There is a same question being answered:It seems that if you have a vcf file and AD in your GT field, it is an easy calculation. Calculate the b allele frequency from a VCF file .

A paper describing an R package that can do that : https://www.sciencedirect.com/science/article/pii/S1525157817301666

ADD COMMENT
0
Entering edit mode
3.6 years ago
bernatgel ★ 3.4k

If you are using R, you can take a look at the CopyNumberPlots Bioconductor package. Its focused on generating plots of BAF, LRR and copy-number segments from SNP-array and NGS, but it has a handy function to compute the BAF from a VCF where it will autodetect the presence of AD, GT and other formats for the allele depth. Just bear in mind that you need to set mirror.baf to false, since it will flip half of the allele frequencies to mimic the effect of the B-allele definition in Illumina arrays.

Using

loadSNPDataFromVCF(vcf.file = "Your.vcf", genome="hg19", mirror.baf = FALSE)

you'll get a GRanges with the position and identifiers of your variants and their B-allele frequency ready to use.

ADD COMMENT
0
Entering edit mode

Thanks a lot but the genome I am using is not the human genome.

ADD REPLY
0
Entering edit mode

It should work with other genomes too. And I'm pretty sure it should be possible for it to work with unknown and custom genomes too.

ADD REPLY

Login before adding your answer.

Traffic: 1431 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