How can I get an allele count table from a .vcf file?
What's the most efficient way to generate a table of allele counts from a .vcf file? Ideally columns Chrom, Position, ref counts, and alt counts, across all sites in a vcf file? I think what I'm looking for is basically CollectAllelicCounts from GATK but on a vcf rather than bam file. Thanks.
• 1,842 views
•
link
3 answers
$ bcftools stats in.vcf.gz | grep -wF ST
# ST, Substitution types:
# ST [2]id [3]type [4]count
ST 0 A>C 5
ST 0 A>G 5
ST 0 A>T 3
ST 0 C>A 5
ST 0 C>G 2
ST 0 C>T 0
ST 0 G>A 1
ST 0 G>C 4
ST 0 G>T 2
ST 0 T>A 4
ST 0 T>C 4
ST 0 T>G 5
• 0 views
•
link
With TileDB-VCF (where uri is a TileDB-VCF dataset)
tiledbvcf.read_allele_frequency(uri, region=None)
• 0 views
•
link
Log in to answer this question.