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?
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?
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
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.
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
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 asbcftools view -f PASS file.vcf.gz
?No. Re-Read my answer.
Got it! Thank you!