I'm following the workflow suggested by samtools here to produce a fasta with the consensus sequence.
https://samtools.github.io/bcftools/howtos/consensus-sequence.html
The workflow goes like this:
# call variants
bcftools mpileup -Ou -f reference.fa alignments.bam | bcftools call -mv -Oz -o calls.vcf.gz
bcftools index calls.vcf.gz
# normalize indels
bcftools norm -f reference.fa calls.vcf.gz -Ob -o calls.norm.bcf
# filter adjacent indels within 5bp
bcftools filter --IndelGap 5 calls.norm.bcf -Ob -o calls.norm.flt-indels.bcf
# apply variants to create consensus sequence
cat reference.fa | bcftools consensus calls.vcf.gz > consensus.fa
It's not clear to me if/where/how the calls.norm.flt-indels.bcf
file I've made is used by the final bcftools consensus
function??
Hi, did you find out the answer to this?
I am also unclear what this output is for