Hi, I would like to compare the vcf files of two groups (50 samples - vcf files per group) and generate a report of comparison between these groups. The result would be the SNV and the frequency of the individual variant in each group. any idea what might be the most suitable tool?
many thanks.
2 answers
This sort of basic genotype query can be done efficiently with plink 1.9 or 2.0 (https://www.cog-genomics.org/plink2 ). "plink2 --vcf [VCF filename] --keep [list of sample IDs in one group] --freq" dumps all variant frequencies for one group, and --extract/--write-snplist can be used with the built-in variant filtering options to select the variants you're interested in.
As a general rule, when you only care about the genotype calls and not about other fields like genotype quality, read depth, etc., plink2 is very likely to be far more efficient than general-purpose VCF-handling tools (especially if you convert the VCF to plink2-format first).
If you're only interested in shared variant sites between the populations, bedtools intersect (https://bedtools.readthedocs.io/en/latest/) would help you find those shared ones and you could query their genotypes and frequencies in the populations with bcftools (https://samtools.github.io/bcftools/bcftools.html).
If you're also interested in population specific variants, I would suggest to do a joint variant call with all individuals from all populations. Individuals could be labeled to retain their memberships to populations. The VCF file from the joint call could be queried in any way you like. I'd recommend the BGT tool (https://github.com/lh3/bgt) for such tasks.
Log in to answer this question.
many thanks for all the suggestions. :)