Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-09-19T22:53:25.017Z
Answers.Text: This is good if the user has Illumina, that isn't clear (though it is implied by using pilon).
Answers.UserDisplayName: Maximilian Press
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-09-19T15:51:27.023Z
Answers.LastActivityDate: 2022-09-19T15:51:27.023Z
Answers.UserDisplayName: user172818
Body: <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>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-09-19T22:54:04.390Z
Comments.Text: 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.
Comments.UserDisplayName: Maximilian Press
Tags: <sam><sequence-analysis><assembly><conversion><genome-index>
Title: need bam file for pilon
ThreadText: # 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 username_2 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).  
  
  ---
  
  