Alright so I'll edit my question here since my other post got closed. After generating consensus sequences with bcftools and vcfutils I am unsure how to get sequences without IUPAC ambiguity. My code that works in generating sequences:
samtools mpileup -Q 20 -q 20 -d 5000 -uf ref.fa sorted.bam | \ bcftools call -c | \ vcfutils.pl vcf2fq -d 10 -Q 20 -l 1 > output_consensus.fq seqtk seq -a output_consensus.fq > output_consensus.fa
The alignment is filled with IUPAC codes but I need it to output the most called base per position or at least choose one of the bases if it happened that there was a 50/50 between bases. Using samtools and bcftools v 1.8.