This is a test version of Biostars. For the public version, visit https://www.biostars.org.
how to extract variants from the vcf.gz files linked below?

I have tried several commands to extract the variant (non-homozygous) genotype from the two vcf.gz files found below, but no variant genotypes are coming up. The output for the commands below areal 0, with no variant information under the columns of the outputted vcf data. Does anyone know how to properly extract all variant genotypes (1/0, 0/1,11)?

  1. remove homozygous ref genotype from multi-sample vcf

-bcftools view -i 'GT[*]="alt"' LUD.TH179.PASS.dbsnp_cosmic.vcf.gz | less -SN

2.extracting heterozygous snp from a vcf file

  • vcftools --gzvcf LUD.TH179.PASS.dbsnp_cosmic.vcf.gz --extract-FORMAT-info GT | grep "0/1"
  1. ID heterozygous variants in VCF file using vcftools
  • vcftools --gzvcf LUD.TH179.PASS.dbsnp_cosmic.vcf.gz --het
  • output(cat out.het)
    • INDV O(HOM) E(HOM) N_SITES F (EMPTY)

vcf files: (https://zenodo.org/records/6558593, LUD.TH179.PASS.dbsnp_cosmic.vcf.gz and LUD.TH238.PASS.dbsnp_cosmic.vcf.gz).

vcftools bcf vcf bcftools

1 answer

If you have single sample VCFs, you could exclude hom-ref sites with this command:

bcftools view -e 'GT="ref"'

Thank you, if you try to do it on the files provided, do you see any variant alleles?

I'm not familiar with scAllele, but I think LUD.TH179.PASS.dbsnp_cosmic.vcf.gz is some kind of annotation VCF that is supposed to accompany the other vcf files in that directory. It does seem to be completely full of './.' GT calls?

thanks for confirming! I was assuming as such too

Log in to answer this question.