Replace SB flag by PASS in my VCF file
1
0
Entering edit mode
4 months ago
ManuelDB ▴ 110

My BAM files only have R1 reads and no strand bias should be assigned in my VCF files when calling variants with PISCES. However, PISCES flag SB in the annotation and occasionally (I don't know how) some variants are called with the SB flag in the INFO column.

I have discussed this issue with the main PISCES developer

https://github.com/tamsen/Pisces/issues/20

I deleted the SB annotation with bcftools. I have realised recently that I applied a filter to take PASS variants so this wrongly filters out SB variants that are not real SB variants, they are PASS (if only SB flag is in the INFO column).

So now the problem is that I need to replace SB by PASS. I was guessing that this should be a common task and that some well-known tool will handle this but I cannot see a way to do this in a simple way.

Do you know how can I identify variants with only the SB flag and replace this with PASS? There may be some variants with more than one flag (e.g. SB,q30) These should be ignored, I only care about SB variants because there are real PASS variants for me.

Do you know a way of doing this?

VCF • 400 views
ADD COMMENT
0
Entering edit mode

it's not clear whether the SB is in INFO, FORMAT or FILTER. Please provide an example.

ADD REPLY
0
Entering edit mode

yes, it is not clear, Sorry. It is in FILTER not in INFO. Apologies. See example

 #CHROM POS ID  REF ALT QUAL    FILTER  INFO    FORMAT  1109026781
chr17   43074430    .   CTT C   100 PASS    DP=1795 GT:GQ:AD:DP:VF:NL:SB    0/1:100:913,882:1795:0.491:20:-100.0000
chr17   43074486    .   C   A   94  SB  DP=1794 GT:GQ:AD:DP:VF:NL:SB    0/1:94:1743,50:1794:0.028:20:-0.3829
ADD REPLY
2
Entering edit mode
4 months ago
awk -F '\t' '($0 ~ /^#/ || $7!="SB") {print;next} {OFS="\t";$7="PASS";print;}'  input.vcf
ADD COMMENT
0
Entering edit mode

I will try tomorrow and give you feedback, a big thanks more likely as usual.

ADD REPLY

Login before adding your answer.

Traffic: 2305 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6