Thanks, I'm try that. However, bcftools is probably looking for a tag just like I am. It would be great to know what it's looking for when doing the filtering. Also, is there a particular reason you like bcftools instead of vcftools, just curious.
Hello,
I'm trying to switch to using the Phase 3 1000 genomes data from Phase I. In phase I, there was a indicator that said the variant type, so you could for example filter out SNPs easily with a grep command. However, they remove the below from Phase 3.
- VT=SNP, indicates the variant is a snp.
- VT=INDEL, indicates the variant is an indel,
- VT=SV, indicates the variant is a deletion.
Anyone know if there's an easy way to filter out the SNPs? Is there another indicator in the file that I'm missing?
Thanks!
1 answer
bcftools allows you to filter variants by type using option -v, --types snps|indels|mnps|other (comma-separated list of variant types to select), plus it generates perfectly well-formed vcf output files. for this last reason, and for its great performance (latest HTSlib 1.1 core works like a charm), I would definitely recommend it instead of grep for parsing vcf files. as easy as this simple command:
bcftools view -v snps all.variants.vcf > snps.only.vcf
bcftools is faster. it is even stated in the vcftools Perl tools and API page, and roughly described on a small section of the vcftools site.
Log in to answer this question.
help us, where is the VCF please?
Here's phase I
ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/release/20110521
and here's phase 3
ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/release/20130502/
Thanks
Look for
TYPEtag.I don't think there's a tag like that in these files.
Strangely, there isn't such "TYPE" tag on latest 1000genomes phase3 data (well, it is on the X chromosome).
If you are still willing to build a grep-like query:
I would go for perl though: