B allele frequency (BAF)
2
0
Entering edit mode
16 months ago
rthapa ▴ 50

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 • 1.6k views
0
Entering edit mode

B allele frequency, like from a illumina genotyping array?

0
Entering edit mode

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

0
Entering edit mode
16 months 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

0
Entering edit mode
16 months ago
bernatgel ★ 3.2k

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.

0
Entering edit mode

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

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.