Annotating VCF and filtering via annotation
0
0
Entering edit mode
14 months ago

Hello,

This is probably a trivial question but it took me some time to figure out ways which are not pretty and sometimes produce errors so I’m looking for help here… I have 2 vcf files and I want to annotate one with another. The fields in both vcfs are similar but I have different coverage in the second vcf and I want to add this coverage to the 1st vcf while not loosing current dp value for vcf1.

I managed to do it in a way that I did copy the info field from 2nd vcf into the 1st one

bcftools annotate --set-id +'%INFO' file2.vcf.gz > newfile2.vcf

and then

bcftools annotate -a newfile2.vcf.gz -c +.ID file1.vcf.gz > result.vcf

Now I would like to filter via DP from info field but I have no idea how :)

Probably there is an easier solution to this problem…

I would strongly need help here

SNP VCF • 536 views
ADD COMMENT
0
Entering edit mode

If you want to just remove the lines you can use expressions like -i 'FORMAT/DP>20' with the view command. If you want to tag them you can use the filter command with soft filter parameter.

ADD REPLY

Login before adding your answer.

Traffic: 2031 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