This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Does vcf-consensus support indels?

Does anyone know if the tool vcf-consensus supports indels insertion in the consensus sequence?

Thanks

consensus vcf-consensus

It supports only SNVs and deletions. Not insertions

1 answer

Not sure about vcftools-consensus but indels are taken into account with "bcftools consensus" and is probably faster than vcftools:

bcftools consensus --fasta-ref <reference.fasta> <file.vcf.b.gz> --sample <IND> -o <output_consensus.fasta>

See docs: https://samtools.github.io/bcftools/bcftools.html

Hi! For some reason when I try bcf consensus, indels are not taken into account. When i do samtools mpileup and bcftools call to create a vcf file, it will annotate indels but with a 0/0 genotype. I think that has to do with bcftools consensus not including indels it in the consensus seq. Have you noticed this before? Thanks

This is my pipeline:

bbmap.sh index ref.fasta

bbmap.sh ref='ref.fasta' in='sample.fasta' out='output.sam'

samtools view -bS output.sam > output.bam

samtools sort output.bam > sorted.bam

samtools index sorted.bam

samtools mpileup -uf SA05sequence.fasta sorted.bam | bcftools call -c > vars.vcf

bgzip -c vars.vcf vars.vcf.gz

tabix -p vcf vars.vcf.gz

bcftools consensus --fasta-ref ref.fasta vars.vcf.gz -o consensus.fasta

Log in to answer this question.