I tried this command and got this error.
Failed to open HG002-HG003-HG004.jointVC.filter_Annotated.vcf: not compressed with bgzip
Any idea how to correct this?
I have a VCF file called HG002-HG003-HG004.jointVC.filter.vcf that consists of data from three patients. I am interested in isolating the genotypes for chr19 from patient HG002 only. Is there a way to do this using vcftools or alternative package? And can anyone recommend a manual or an example on how to accomplish this?
I tried this command and got this error.
Failed to open HG002-HG003-HG004.jointVC.filter_Annotated.vcf: not compressed with bgzip
Any idea how to correct this?
Hi,
You should compress and index your vcf file before
bgzip -c file.vcf > file.vcf.gz
tabix -p vcf file.vcf.gz
grep "HG002" HG002-HG003-HG004.jointVC.filter_Annotated.vcf #finds patient ID, for use with [--indv]
vcftools --vcf HG002-HG003-HG004.jointVC.filter_Annotated.vcf --chr 19 --indv Sample_Diag-excap51-HG002-EEogPU --out HG002-chr19.vcf --recode
Found that is this works to generate a file consisting of only chr19 coordinates from patient HG002
Use programs meant for handling VCF files whenever possible. Utilities like grep may miss subtle things.
Log in to answer this question.