SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
Filtering VCF file JadeB Bioinformatics 0 10-21-2014 03:57 AM
Vcf file filtering huma Asif Bioinformatics 0 08-18-2014 09:55 AM
No "0/0" (homozygous ref) genotypes in VCF file slp Bioinformatics 8 03-13-2013 06:05 PM
Filtering VCF variants based on sequencing coverage elfuser Bioinformatics 0 02-19-2013 07:59 PM
failed annotating the example vcf file in the installation folder of VCFtools jianfeng.mao Bioinformatics 0 01-06-2011 05:23 AM

Reply
 
Thread Tools
Old 06-03-2015, 06:04 AM   #1
Seqql
Junior Member
 
Location: Germany

Join Date: Sep 2014
Posts: 4
Default Filtering homozygous variants in vcf file with vcftools

Hi everybody,

I'm trying to modify a vcf file to keep only homozygous variants.
I've tried using vcftools, but i can't get the syntax right.

I thought using the "keep-filtered" option of vcftools should be the right approach. Also I'm trying to find homozygous variants by the "GT 1/1" tag.

I've tried
vcftools --keep-filtered GT:1/1 --vcf in.vcf --out out.vcf
but it kept none.

edit:
vcf file looks like this:
c130956_g1_i1 50 . A C 5.49 . DP=2;RPB=-9.668049e-01;AF1=0.5049;AC1=1;DP4=1,0,1,0;MQ=33;FQ=-10.5;PV4=1,1,1,1 GT:PL: DP:GQ 0/1:34,0,17:2:22
c130956_g1_i1 62 . T A 49 . DP=3;VDB=5.867524e-02;AF1=1;AC1=2;DP4=0,0,2,1;MQ=30;FQ=-36 GT:PL: DP:GQ 1/1:81,9,0:3:16




What is the right syntax here?

Last edited by Seqql; 06-03-2015 at 06:08 AM.
Seqql is offline   Reply With Quote
Old 06-03-2015, 06:14 AM   #2
lindenb
Senior Member
 
Location: France

Join Date: Apr 2010
Posts: 143
Default

--keep-filtered is for the FILTER column

to answer this, I would use my tool https://github.com/lindenb/jvarkit/wiki/VCFFilterJS


java -jar dist/vcffilterjs.jar -e 'variant.getGenotype(0).isHomVar()' file.vcf
lindenb is offline   Reply With Quote
Old 06-03-2015, 08:02 AM   #3
Seqql
Junior Member
 
Location: Germany

Join Date: Sep 2014
Posts: 4
Default

Thank you, this is looknig very promising.

I got the filtered vcf file, but i've run into a problem.
I can't load the file into IGV because of the FILTER field, values like "11,30" aren't accepted. Looks like IGV only accepts one number with/out dots ("11.30" is ok).

Is there any quick fix for this I could apply to the code? If not i may just delete the whole column.
Seqql is offline   Reply With Quote
Old 06-03-2015, 08:12 AM   #4
lindenb
Senior Member
 
Location: France

Join Date: Apr 2010
Posts: 143
Default

11,30 is generated by my program (?) If yes, this is a locale problem:
try to set the LANG variable


$ export LANG=en_US.UTF-8
$ echo $LANG
en_US.UTF-8




or/and (?) specify it on the command line:

java -Duser.language=en -Duser.country=US (...)

Last edited by lindenb; 06-03-2015 at 08:16 AM.
lindenb is offline   Reply With Quote
Old 06-03-2015, 10:06 AM   #5
Seqql
Junior Member
 
Location: Germany

Join Date: Sep 2014
Posts: 4
Default

Good thought, it worked.
Thanks for the help
Seqql is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 08:40 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO