samtools / bcftools

This is the official development repository for BCFtools. See installation instructions and other documentation here http://samtools.github.io/bcftools/howtos/install.html
http://samtools.github.io/bcftools/
Other
649 stars 240 forks source link

Quick Question - Bcftools Consensus for Indels #2026

Open NicMAlexandre opened 10 months ago

NicMAlexandre commented 10 months ago

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 commented 10 months ago

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