I am trying to convert a BAM file containing aligned reads into a consensus fasta in order to see directly the alignment on a long range sequence aligner.
samtools view -h -F 4 <align.bam> > <map.bam> samtools sort <map.bam> -o <mapsrt.bam> samtools mpileup -d8000 -uf <ref.fa> <mapsrt.bam>| bcftools view -cg - | vcfutils.pl vcf2fq > <file.fa>
but I got:
[mpileup] 1 samples in 1 input files Error: Could not parse --min-ac g Use of uninitialized value $l in numeric lt (<) at /usr/bin/vcfutils.pl line 566. Use of uninitialized value $l in numeric lt (<) at /usr/bin/vcfutils.pl line 566.
What might have happened? Are there other simple tools to create a consensus fasta? There are many options on internet, but only this one worked for me before...