Question: How to only show SNPs in vcf files
0
gravatar for Joe
11 days ago by
Joe20
USA
Joe20 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 • 104 views
ADD COMMENTlink modified 11 days ago by Pierre Lindenbaum95k • written 11 days ago by Joe20
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 10 days ago • written 10 days ago by cpad01121.0k
1
gravatar for Pierre Lindenbaum
11 days ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum95k wrote:
for F in *.vcf; do  awk  -F '\t' '($0 ~ /^#/ || $5!=".")' $F  > ${F}.2.vcf ; done
ADD COMMENTlink written 11 days ago by Pierre Lindenbaum95k
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: 667 users visited in the last hour