This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Problem after filtering vcf files

Hello everyone

I have a vcf file (snp) of 99 samples, after filtering with vcftools, the code is as follows:

vcftools --gzvcf my.vcf.gz \
        --maf 0.05 \
        --max-missing 0.8 \
        --recode \
        --out /group/zhougrp3/zhangyuan/haoli/sheep99_wgs_snp/99WGS_snp/filtered_output

A problem occurs: There seems to be a problem with a GT, as follows:

enter image description here

enter image description here

The first picture above is the original vcf file, and the second one is the filtered vcf file. I used a shell script to change the delimiter to make the difference more intuitive (the shell doesn't change the result, it's just easier to see).

As we can see, there is a GT here, transformed from the original .|. to . I would like to ask:

  1. Why does such a problem occur? Is my filter code used incorrectly?
  2. I want to use beagle to fill the filtered results. The "." in this place will have an error: ERROR: Missing one or both alleles for a genotype, how can I solve this error?

Any reply will be greatly appreciated

vcf snp vcftools

1 answer

vcftools is deprecated. Use bcftools.

bcftools view -i 'F_MISSING < 0.6'  --max-af '0.05' -O z -o out.vcf.gz my.vcf.gz

Log in to answer this question.