Entering edit mode
15 months ago
marongiu.luigi
▴
730
Hello, I have aligned some files against a reference genome with BMA-MEM, deduplicated and sorted with sambamba to generate a AlnSrtDedSrt.bam file.
The question is: how can I generate a consensus fasta file?
I have this fragment of code:
$ bcftools mpileup -Ou -f {ref}.fa AlnSrtDedSrt.bam | bcftools call -Ou -mv | bcftools norm -f {ref}.fa -Oz -o {input}.vcf.gz
$ tabix {input}.vcf.gz
$ bcftools consensus -f {ref}.fa {input}.vcf.gz > {out}.fa
where {ref}.fa
is the reference file.
Is the code correct?
The main problem is how to make the {input}.vcf.gz
file. Any tips?
Thank you
First command in your code is creating the VCF file.
Covered in: Generating consensus sequence from bam file