I have been looking to filter my vcf and get another vcf just with the heterozygous snp but as a vcf file
I found this
vcftools --gzvcf file.vcf.gz --extract-FORMAT-info GT | grep "0/1"
I thought maybe with --recode-vcf would keep my vcf format but it just make a text file and it doesn't appear only 0/1 I get something like this
CHROM POS 3_v1 chr1 68928 ./. chr1 871334 0/1 chr1 876499 1/1 chr1 883625 1/1 chr1 884091 1/1 chr1 887560 1/1 chr1 887694 0/2...............
Is possible what I want to do?and why I dont get just the 0/1??? O_O
Thanks a lot!!!!
Worked ^^ but just one extra question, is any reason why dissapear the head and info above using grep?
I used grep 0/1 02.vcf > 02out.vcf
because grep gives what you searched for...grep for #...headers will be printed.