# Negative values with VCF filter tool

**URL:** <https://help.galaxyproject.org/t/negative-values-with-vcf-filter-tool/10717>\
**Category:** usegalaxy.eu support\
**Tags:** vcf-filter, tool-help, vcf\
**Created:** [August 31, 2023, 9:41am UTC](https://help.galaxyproject.org/t/negative-values-with-vcf-filter-tool/10717 "2023-08-31T09:41:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![giuliag89](https://avatars.discourse-cdn.com/v4/letter/g/a587f6/32.png) [@giuliag89](https://help.galaxyproject.org/u/giuliag89)\
**Post date:** [August 31, 2023, 9:41am UTC](https://help.galaxyproject.org/t/negative-values-with-vcf-filter-tool/10717/1 "2023-08-31T09:41:41Z")

</div>

Hello everyone,  
I used bctools mpileup and bcftools call on my bam file and I used VCFfilter tool to filter for QUAL and it worked.  
Now I want to filter for RPBZ in a range between -5 and +5.  
I tried to set the filtering value like this RPBZ \> -5 & RPBZ \< 5 but I got an error. I also tried to set just RPBZ \> -5 but again it turned into an error. Could the problem be the minus simbol?  
Can someone help me?

---

<div class="post-metadata">

**Author:** ![jennaj](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/jennaj/32/27_2.png) [@jennaj](https://help.galaxyproject.org/u/jennaj)\
**Post date:** [August 31, 2023, 6:41pm UTC](https://help.galaxyproject.org/t/negative-values-with-vcf-filter-tool/10717/2 "2023-08-31T18:41:15Z")

</div>

Welcome, @giuliag89

> [@giuliag89](#):
>
> Could the problem be the minus simbol?

Yes, probably.

Would you please copy/paste back a line from the VCF file that contains an example value you want to remove that is a negative value? Or even better, would you share the file itself in a history along with a failed query run? I’d like to see if there is a workaround, or maybe some other logical solution e.g. alternative tool. [Sharing your History](https://training.galaxyproject.org/training-material/faqs/galaxy/histories_sharing.html)

---

<div class="post-metadata">

**Author:** ![giuliag89](https://avatars.discourse-cdn.com/v4/letter/g/a587f6/32.png) [@giuliag89](https://help.galaxyproject.org/u/giuliag89)\
**Post date:** [September 2, 2023, 11:39am UTC](https://help.galaxyproject.org/t/negative-values-with-vcf-filter-tool/10717/3 "2023-09-02T11:39:31Z")

</div>

Hi Jennaj,  
this is the link of the history with the failed query runs:  
[url: https://usegalaxy.eu/u/giuliag89/h/run-sample-2-error](https://usegalaxy.eu/u/giuliag89/h/run-sample-2-error)

Thanks

---

<div class="post-metadata">

**Author:** ![jennaj](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/jennaj/32/27_2.png) [@jennaj](https://help.galaxyproject.org/u/jennaj)\
**Post date:** [September 5, 2023, 9:05pm UTC](https://help.galaxyproject.org/t/negative-values-with-vcf-filter-tool/10717/4 "2023-09-05T21:05:14Z")

</div>

Hi @giuliag89

The history isn’t shared anymore, or wasn’t fully shared originally.

You can just post back a few lines of the data. I’m more curious about how those are structured in the VCF text itself, but I guess you can also share the history if it shows how/where those values were introduced (which specific tool, which specific options).

---

<div class="post-metadata">

**Author:** ![giuliag89](https://avatars.discourse-cdn.com/v4/letter/g/a587f6/32.png) [@giuliag89](https://help.galaxyproject.org/u/giuliag89)\
**Post date:** [September 6, 2023, 7:51am UTC](https://help.galaxyproject.org/t/negative-values-with-vcf-filter-tool/10717/5 "2023-09-06T07:51:37Z")

</div>

Hi,  
I made the history shared again if you want have a look: [url: https://usegalaxy.eu/u/giuliag89/h/run-sample-2-error](https://usegalaxy.eu/u/giuliag89/h/run-sample-2-error)

Here few lines of the vcf file:

chr13 32906574 . T A 3.38992 . DP=3107;ADF=4,1516;ADR=1399,4;AD=1403,1520;DPR=1403,1520;VDB=0;SGB=-0.693147;RPBZ=-47.9879;MQBZ=0;MQSBZ=0;BQBZ=-47.5208;SCBZ=-1.58678;FS=0;MQ0F=0;AC=1;AN=2;DP4=4,1399,1528,5;MQ=59;PV4=0,0,1,0

chr13 32911888 . A G 222.411 . DP=3356;ADF=406,451;ADR=427,395;AD=833,846;DPR=833,846;VDB=0.370697;SGB=-0.693147;RPBZ=1.83679;MQBZ=0;MQSBZ=0;BQBZ=-1.47865;SCBZ=0.0797271;FS=0;MQ0F=0;AC=1;AN=2;DP4=406,427,453,395;MQ=60;PV4=0.0571422,0.00183936,1,0.0309689

chr13 32912299 . T C 222.404 . DP=3098;ADF=384,385;ADR=427,389;AD=811,774;DPR=811,774;VDB=0.426724;SGB=-0.693147;RPBZ=1.27188;MQBZ=-0.0428285;MQSBZ=-0.0406173;BQBZ=0.00843397;SCBZ=0.0198499;FS=0;MQ0F=0;AC=1;AN=2;DP4=384,427,385,389;MQ=59;PV4=0.365528,1,0.165837,1

chr13 32929387 . T C 228.425 . DP=1162;ADF=0,0;ADR=3,1156;AD=3,1156;DPR=3,1156;VDB=0;SGB=-0.693147;RPBZ=0.331772;MQBZ=0;BQBZ=1.63548;SCBZ=0.246328;FS=0;MQ0F=0;AC=2;AN=2;DP4=0,3,0,1159;MQ=60;PV4=1,1,1,1

Thank you

---

<div class="post-metadata">

**Author:** ![jennaj](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/jennaj/32/27_2.png) [@jennaj](https://help.galaxyproject.org/u/jennaj)\
**Post date:** [September 6, 2023, 5:12pm UTC](https://help.galaxyproject.org/t/negative-values-with-vcf-filter-tool/10717/6 "2023-09-06T17:12:52Z")

</div>

Hi @giuliag89

Great, thanks for sharing. The tool seems to be working correctly, and negative values are accepted.

Try removing the space between the `-` and `5`.

So this: `TERM > -5`  
instead of `TERM > - 5`

The two filters might need to be in separate filter blocks. I didn’t get any data passing through when combined on the same line. All filters in any single run are combined with a logical “AND” by default. Meaning, all need to be true for data to pass through. There is a toggle for an “OR” on the form too should you need that.

That should be enough so you can try different queries to see what filters for your purposes, without running into an error with the syntax adjusted a bit. I wasn’t sure if the compressed format was causing some random issue or not – but I didn’t find that to be actual (yea!). So using the current compressed format should be fine. I can see that you were testing that as well, or were converting to tabular format for another reason… You could output plain text VCF instead from BCFTools Call if you want to try using other tools to directly filter/query for any reason. BCFTools understands the compression, other tools may not.

Hope that helps!

---

<div class="post-metadata">

**Author:** ![jennaj](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/jennaj/32/27_2.png) [@jennaj](https://help.galaxyproject.org/u/jennaj)\
**Post date:** [May 13, 2024, 6:58pm UTC](https://help.galaxyproject.org/t/negative-values-with-vcf-filter-tool/10717/7 "2024-05-13T18:58:59Z")

</div>

**UPDATED usage help for negative values when using VCFFILTER**

> [@VCFfilter: can´t eliminate negative values](https://help.galaxyproject.org/t/vcffilter-can-t-eliminate-negative-values/12428/9):
>
> For context, please see this two line discussion from the vcffilter tool author: [vcffilter core dumped on negative values · Issue #249 · vcflib/vcflib · GitHub](https://github.com/vcflib/vcflib/issues/249)
> 
> That means the query you want would be one of these for a negative value:
> 
> > RPBZ \< 0 - 5  
> > RPBZ \> 0 - 5

An alternative tool is **SNPSIFT FILTER**
