<p>Can anyone point me to a program [C/Python] that runs a Smith-Waterman pairwise local alignment but (unlike EMBOSS/water) has options for one or both of these:</p>

<ol>
<li><p>Return the best N hits of query sequence.</p></li>
<li><p>Extend the/each local alignment to produce the best full local alignment for the (much smaller) query sequence.</p></li>
</ol>

I like <a href="http://www.ebi.ac.uk/~guy/exonerate/">exonerate</a>, which can be run with the `affine:local` and `-n` options to get what you want. It is a nice tool that runs from the command line and does not need to format databases or further configurations

    $: exonerate -q querysequence.txt -t targetsequences.txt -m affine:local -n 3 # n=3 to get the 3 best alignments.