bcftools icon indicating copy to clipboard operation
bcftools copied to clipboard

Quick Question - Bcftools Consensus for Indels

Open NicMAlexandre opened this issue 1 year ago • 1 comments

Hello,

Let's say I want to call a consensus with two conditions:

  1. Don't assume reference when variant is missing, print N.
  2. At heterozygous sites, print the longer allele, if they are the same length, print the ALT

bcftools consensus -f Reference.fasta Filt.vcf.gz --absent N -H LA > consensus.fasta

An example site would look like this:

SUPER_1 168991 . T TAGAAG

But I get errors saying that I have "overlapping variants". In this case, will bcftools incorporate TAGAAG as the call?

NicMAlexandre avatar Oct 25 '23 23:10 NicMAlexandre

The goal is to print the insertion as the call in the consensus in this case. I should note that the reference is a different species, so there are expected to be many indels which are informative. I can normalize this vcf like so: but I'm unsure if this will print the insertions and deletions like I want in the consensus:

bcftools norm --atom-overlaps '*' -f Reference.fasta -m +any Filt.vcf.gz -O z -o Normalized.vcf.gz

NicMAlexandre avatar Oct 25 '23 23:10 NicMAlexandre