What is the difference between `view` and `annotate` in bcftools?
2
0
Entering edit mode
21 months ago
DS ▴ 70

I am wondering what is the difference between view and annotate in bcftools?

Example:

bcftools annotate -x FILTER/PASS file.vcf.gz

VS

bcftools view -f PASS file.vcf.gz

maybe in terms of speed, memory... etc?

bcftools • 1.9k views
ADD COMMENT
2
Entering edit mode
21 months ago

most bcftools commands have the -e and -i options to select some variants. bcftools view have more options for filtering "-m, -M , --types , etc..` . The main goal of bcftools annotate is to remove/add information from a VCF input.

bcftools annotate -x FILTER/PASS file.vcf.gz

you're NOT filtrering out any variant here, you're just removing the information FILTER/PASS from the variant

bcftools view -f PASS file.vcf.gz

here you DO filter out variants that don't have the FILTER=PASS

ADD COMMENT
0
Entering edit mode

but if I do bcftools annotate -x ^FILTER/PASS file.vcf.gz, which is removing all information other than FILTER=PASS, is it the same as bcftools view -f PASS file.vcf.gz ?

ADD REPLY
0
Entering edit mode

No. Re-Read my answer.

ADD REPLY
0
Entering edit mode

Got it! Thank you!

ADD REPLY
0
Entering edit mode
21 months ago
tothepoint ▴ 940

The view command is used to filter, subset, and convert VCF/BCF files, while the annotate command is used to add information to VCF/BCF files.

ADD COMMENT
0
Entering edit mode

but can i use the annotate command for filtering? Is there any advantage or disadvantage with the annotate over view? Thanks!

ADD REPLY

Login before adding your answer.

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