Hello,

My question is - How many mismatches are allowed (on average/or hard limit) in a bowtie 2 alignment before it moves on to find a new home for a read. I know the we can control the number of mismatches allowed in the seed with -N option. And I know that with the -D option, I control the seed extension attempts that "fail".

So I guess my question now is, when does an extension "fail"? The manual says, when an extension does not yield a new best or a new second-best alignment, it fails.

I'm not able to map this definition to a number (of mismatches). I've re-read the method to calculate the alignment score many times now. Would two consecutive SNPs be allowed, or do two SNPs need to have a certain number of matched bases between them so that the overall alignment doesn't "fail"?

I think, in my naive way, I've explained the core issues of my question. I'll edit if it's not entirely clear.

Thanks,  
Ayush
<p><code>-D</code> and <code>-N</code> aren&#39;t directly related to the number of mismatches. An alignment fails, if it does not meet the <code>--score-min</code> criteria.</p>

<p>For global alignment costs are <code>--ma 0</code>, <code>--mm 2-6</code> - depending on base quality. Score is given by <code>--score-min L,-0.6,-0.6</code>. Given a 100 bp read the <code>--score-min</code> computes to -60. Given only high quality SNPs (<code>--mm 6</code>), an alignment can have up to 10 mismatches and still meet the score threshold. However, with 10 mismatches randomly distributed along the read, you will need sensistive seeding parameters to initialize the alignment in the first place.</p>

<p>To limit bowtie2 to 2 mismatches<em> per 100 bp</em> in global mode, you can set <code>--score-min L,0,-13</code>. To limit reads of <em>arbitrary length</em> to 2 mismatches, you can set <code>--score-min C,-13,0.</code></p>

<p>Given default gap costs (5,3), this would also allow 2 non-adjacent 1 bp gaps or one 3 bp gap in your alignment.</p>
