text: user6273: I have been using minimap2 for a few month now and I just found a script that follows these steps:
  minimap2 [-x preset] -d target.mmi target.fa
  minimap2 -a [-x preset] target.mmi query.fa > output.sam
  
  I have never seen this .mmi index before. I always used minimap2 directly like this:
  minimap2 -a [-x preset] target.fa query.fastq > output.sam
  
  So my question is why should I index my reference genome before mapping? Is it only for speed up? Will it up speed my code if I do it? Or it is already done without specifying it?
  
  user6955: If you don't provide an index, minimap2 will just generate the index on the fly (so, yes, it's done without specifying it). As such the mapping step will take longer. However, index generation is supposed to be very fast in minimap2 (a few minutes for the human genome), so it probably won't matter much.
  Doing it separately will therefore also not speed up your code unless you end up using the pre-generated index multiple times.
  
original_text: 6273: <p>I have been using minimap2 for a few month now and I just found a script that follows these steps:</p>
  <pre><code>minimap2 [-x preset] -d target.mmi target.fa
  minimap2 -a [-x preset] target.mmi query.fa &gt; output.sam
  </code></pre>
  <p>I have never seen this <code>.mmi</code> index before. I always used minimap2 directly like this:</p>
  <pre><code>minimap2 -a [-x preset] target.fa query.fastq &gt; output.sam
  </code></pre>
  <p>So my question is why should I index my reference genome before mapping? Is it only for speed up? Will it up speed my code if I do it? Or it is already done without specifying it?</p>
   6955: <p>If you don't provide an index, minimap2 will just generate the index on the fly (so, yes, it's done without specifying it). As such the mapping step will take longer. However, index generation is supposed to be very fast in minimap2 (a few minutes for the human genome), so it probably won't matter much.</p>
  
  <p>Doing it separately will therefore also not speed up your code unless you end up using the pre-generated index multiple times.</p>
  