Question: How to filter INFO on a vcf file with bcftools
0
gravatar for borarc3
5 weeks ago by
borarc30
borarc30 wrote:

Hello,

I want to filter a vcf file by eliminating all the SNPs which have INFO <= 0.4.

In the shell, I therefore enter the following command : bcftools filter -e 'INFO<=0.4' myfile.vcf.gz The command runs for a veeeeeeery long time and, at the end, the file remains exactly the same. I have the feeling that it just reads all my file but nothing is filtered.

How could I modify my command to get a real filtering ? Thanks for any help.

info imputation bcftools vcf • 145 views
ADD COMMENTlink modified 4 days ago by biotechdiya30 • written 5 weeks ago by borarc30

what is the definition in the header of this 'INFO' field ?

bcftools view --header-only input.vcf | grep "ID=INFO"
ADD REPLYlink written 5 weeks ago by Pierre Lindenbaum129k

I get this :

INFO=<ID=INFO,Number=1,Type=Float,Description="IMPUTE2 info score">
ADD REPLYlink modified 4 days ago by RamRS28k • written 5 weeks ago by borarc30

So, is it uppercase INFO or lowercase info ??

ADD REPLYlink written 5 weeks ago by Pierre Lindenbaum129k

I have paste the response as I got it. But clearly it is uppercase because if I try to enter the command with 'info', I get : Error: the tag "info" is not defined in the VCF header.

ADD REPLYlink written 5 weeks ago by borarc30

Hi,

I am trying to filter all SVTYPE=BND variants and this is what i tried

bcftools query -i SVTYPE!="BND" wgs_HG001-lumpy.vcf.gz -f "%CHROM\t%POS0\t%END\t%SVTYPE\n" wgs_HG001-lumpy.vcf.gz >nobnd_wgs_HG001-lumpy.vcf.gz
[filter.c:1379 filters_init1] Error: the tag "INFO/BND" is not defined in the VCF header.

I could do it through grep -v but I am seeing if I could use bcftools

ADD REPLYlink modified 4 days ago by RamRS28k • written 4 days ago by biotechdiya30

Please do not add answers unless they actually do answer the question. Just in case, try surrounding your expression in quotes: -i 'SVTYPE!="BND"'. Also, if SVTYPE is an INFO field, use -i 'INFO/SVTYPE!="BND"'.

ADD REPLYlink modified 4 days ago • written 4 days ago by RamRS28k
1
gravatar for Pierre Lindenbaum
5 weeks ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum129k wrote:
bcftools filter -e 'INFO/info<=0.4' myfile.vcf.gz
ADD COMMENTlink written 5 weeks ago by Pierre Lindenbaum129k
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: 738 users visited in the last hour