<p>Run a short-read mapper. For example:</p>
<pre><code>bwa index assembled.fasta
bwa mem -pt16 assembled.fasta read1.fq.gz read2.fq.gz \
  | samtools sort -m4G -@4 -o align.bam -
</code></pre>

CC BY-SA 4.0
2022-09-19T22:53:25.017Z
This is good if the user has Illumina, that isn't clear (though it is implied by using pilon).
Maximilian Press
CC BY-SA 4.0
2022-09-19T15:51:27.023Z
2022-09-19T15:51:27.023Z
user172818
<p>I just ran an assembly on yeast genomes using Flye and I want to polish those assemblies with Pilon but it requires a sorted BAM file.</p>
<p>How do I make a BAM file of the resulting assembled.fasta?</p>

CC BY-SA 4.0
2022-09-19T22:54:04.390Z
What reads do you have? Only long read or short read or whatever? You need to align the starting reads to your assembly and then supply _that_ bam, as implied by the user172818 answer.
Maximilian Press
<sam><sequence-analysis><assembly><conversion><genome-index>
need bam file for pilon
# need bam file for pilon

(Asked by: username_0 on 2022-09-16)

I just ran an assembly on yeast genomes using Flye and I want to polish those assemblies with Pilon but it requires a sorted BAM file.

How do I make a BAM file of the resulting assembled.fasta?

**Tags:** sam, sequence-analysis, assembly, conversion, genome-index
> **Comments:**
> **username_1**: What reads do you have? Only long read or short read or whatever? You need to align the starting reads to your assembly and then supply _that_ bam, as implied by the user172818 answer.  

---

## 1 answers

### Answer by username_2 on 2022-09-19. Score: 2

Run a short-read mapper. For example:
bwa index assembled.fasta
bwa mem -pt16 assembled.fasta read1.fq.gz read2.fq.gz \
  | samtools sort -m4G -@4 -o align.bam -

> **Comments:**
> **username_1**: This is good if the user has Illumina, that isn't clear (though it is implied by using pilon).  

---

