This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Extract consensus sequence from alignment

I have a newly sequenced bacterial genome which is quite close to a reference genome. After the assembly, I wanted to check if I can obtain better results or longer contigs by performing an alignment on the reference genome.

I performed an alignment with bwa mem and created a sorted bam with samtools to visualize in Tablet.

bwa-0.7.12 mem -t 8 ref.fna read1.fq read2.fq > aln.sam
samtools-1.3.1 view -b aln.sam -t ref.fna -o aln.bam 
samtools-1.3.1 sort aln.bam -o aln.sorted.bam
samtools-1.3.1 index aln.sorted.bam

How can I extract the consensus sequence? My reference genome is a draft genome with around 20 contigs, so the extracted sequences should also be a multi fasta fie.

Thank you.

alignment

0 answers

No answers yet.

Log in to answer this question.