Question: Genotype concordance for vcf.gz
0
gravatar for catarinaglmg
6 months ago by
catarinaglmg10
catarinaglmg10 wrote:

Hi! Does anyone know any tool that allows to compare genotypes between two compressed vcf files (.vcf.gz)? (Or any ideas how can I do it without decompressing?)

Thanks!

ADD COMMENTlink written 6 months ago by catarinaglmg10
0
gravatar for Kevin Blighe
6 months ago by
Kevin Blighe65k
Kevin Blighe65k wrote:

How do you want to compare them? - you can potentially just do it via BCFtools and / or indexed awk arrays, but please tell us what you want to do.

ADD COMMENTlink written 6 months ago by Kevin Blighe65k

I want to confirm if the genotypes are the same in my original vcf file versus the same annotated file. I'm also not entirely sure if they both are sorted (which can be a potential comparison problem for some tools). I just want to check that I didn't lose information in the process. (In a multisample file)

Thanks!

ADD REPLYlink modified 6 months ago • written 6 months ago by catarinaglmg10
1

I see... I would do the following:

  1. Sort the VCFs via bcftools sort
  2. Split multi-alleles, left-align indels, and check variants against reference genome ( see here: A: Merging vcf files (intersection and union) )
  3. Set the ID field in each to a unique identifier (e.g. CHR:POS:VAR:REF via bcftools annotate -x ID -I +'%CHROM:%POS:%REF:%ALT')
  4. Compare the IDs in each file. I would use AWK indexed arrays.
ADD REPLYlink modified 5 months ago • written 6 months ago by Kevin Blighe65k
1

Thanks Kevin! I solved it with bcftools sort - there's no need to uncompress to sort files - and then bcftools stats -v to compare between files

ADD REPLYlink written 5 months ago by catarinaglmg10

Great - thanks! I was not aware of BCFtools stats.

ADD REPLYlink written 5 months ago by Kevin Blighe65k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1565 users visited in the last hour