I need to get the allele depth and read depth from a vcf file, sometimes it can look like this:
GT:AD:AF:DP:F1R2:F2R1:FAD:SB 0/1:25,13:0.348:38:7,2:7,5:14,7:12,13,7,6
But sometimes they look like this:
DP:FDP:SDP:SUBDP:AU:CU:GU:TU 35:1:0:0:0,0:0,0:34,35:0,0 35:0:0:0:0,0:2,2:31,31:2,2
And ocassionally there are multiple alleles for the same position.
Are there R tools that help with extracting this information? I am using readVcf from the Bioconductor VariantAnnotation package, but I still need to do extra steps to compare both cases above, and I think there migth be more situations depending on the variant caller that creates the vcf file. I can do the work but I was wondering if anyone uses another package to extract allele depth for each variant from a vcf file.
Thank you in advance.
bcftools query -f '[%CHROM %POS %REF %ALT %SAMPLE %GT %AD\n]'