Question: How to only show SNPs in vcf files
0
gravatar for Joe
9 weeks ago by
Joe30
USA
Joe30 wrote:

I have some vcf file generated by using GATK Unified Genotyper (--output_mode EMIT_ALL_SITES), it looks like

chr15 21138918 . C . 46.23 . . GT:DP 0/0:6

chr15 21138919 . C . 46.23 . . GT:DP 0/0:6

chr15 21138920 . T . 46.23 . . GT:DP 0/0:6

chr15 21138921 . C . 46.23 . . GT:DP 0/0:6

chr15 21138922 . A . 46.23 . . GT:DP 0/0:6

chr15 21138923 . A . 46.23 . . GT:DP 0/0:6

chr15 21138924 rs116806596 C T 173.84 . . GT:AD:DP:GQ:PL 1/1:0,6:6:18:202,18,0 chr15 21138925 . T . 43.23 . . GT:DP 0/0:6

chr15 21138926 . G . 46.23 . . GT:DP 0/0:6

chr15 21170494 . T . 34.23 . . GT:DP 0/0:5

chr15 21170495 . G . 34.23 . . GT:DP 0/0:5

chr15 21170496 . A . 34.23 . . GT:DP 0/0:5

My question is: Is there bcftools or vcftools could simply filter this vcf file to only show SNPs (eg, chr15 21138924 rs116806596 C T 173.84 . . GT:AD:DP:GQ:PL 1/1:0,6:6:18:202,18,0)?

I know that I can rerun GATK Unified Genotyper by using EMIT_VARIANTS_ONLY, but I have so many files, it is very time consuming.

Thanks.

snp gatk vcf • 177 views
ADD COMMENTlink modified 9 weeks ago by Pierre Lindenbaum96k • written 9 weeks ago by Joe30
1
java -jar  SnpSift.jar  filter --inverse  "( ALT = '.')" test.vcf.gz

Will work with vcf too. Last lines from output:

##SnpSiftVersion="SnpSift 4.3p (build 2017-06-06 09:55), by Pablo Cingolani"
##SnpSiftCmd=""
##FILTER=<ID=SnpSift,Description="SnpSift 4.3p (build 2017-06-06 09:55), by Pablo Cingolani, Expression used: ( ALT = '.')">
#CHROM  POS ID  REF ALT QUAL    FILTER  INFO    FORMAT  NA00001
chr15   21138924    rs116806596 C   T   173.84  .   .   GT:AD:DP:GQ:PL  1/1:0,6:6:18:202,18,0
ADD REPLYlink modified 8 weeks ago • written 8 weeks ago by cpad01121.7k

It works! Thanks a lot.

ADD REPLYlink written 7 weeks ago by Joe30
1
gravatar for Pierre Lindenbaum
9 weeks ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum96k wrote:
for F in *.vcf; do  awk  -F '\t' '($0 ~ /^#/ || $5!=".")' $F  > ${F}.2.vcf ; done
ADD COMMENTlink written 9 weeks ago by Pierre Lindenbaum96k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 614 users visited in the last hour