This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to filter vcf file by MAF using bcftools?

I saw this thread (https://github.com/samtools/bcftools/issues/357) and it seems sometimes bcftools recomputes MAF and sometimes it takes it from INFO. Which one is recommended to use and how is this calculation different than what stated on INFO?

Also, what is the difference between:

bcftools view -q 0.01:minor data.vcf.gz -Ov -o out.vcf
bcftools view -i 'MAF > 0.01' data.vcf.gz -Ov -o out.vcf
bcftools isec -e'MAF<0.01'  data.vcf.gz -Ov -o out.vcf

Thank you!

bcftools vcf

Thank you! Do you know when isec options should be used? What is the difference between just using view or isec?

  • isec option is used to find overlapping variants in different vcf files.
  • view option in used to subset, filter and convert VCF and BCF files

IMO that cheat sheet is quite confusing. The official manual is a lot clearer. OP needs to read the freaking manual, especially if they can't even tell isec and view apart.

0 answers

No answers yet.

Log in to answer this question.