Thanks for the suggestions! Definitely would want to try option 3. But do you know the command for me to do so? As I have about 2000 of these overlapping variant
Recently I ran into an issue with 'bcftools consensus' as I kept getting overlapped variant.
When I checked the vcf file, I noticed something like this.
So can anyone give some advice on this? Thanks.
Fyi, the command I've used was:
bcftools mpileup -Ou -f ref.fasta output.all.bam | bcftools call -Ou -mv | bcftools norm -f ref.fasta -m +any -Oz -o output.vcf.gz
tabix output.vcf.gz
bcftools consensus -f ref.fasta output.vcf.gz > output.consensus.fasta
1 answer
Since those 2 indels are overlapping (overlapping positions), bcf consensus cannot decide which one to use to reconstruct the fasta sequence.
One option is to parse the vcf before running consensus and treat the overlapping variants with one of the following criteria:
- Remove all the overlapping variants.
- Keep the first or last variant of the overlapping variants
- Keep the variant called with highest confidence of the overlapping variants.
I would recommend the option 3. For example, for the case you have posted, I would discard the first indel (position 2104), and keep the second (position 2105), since it has a higher IVD and IMF.
Log in to answer this question.