\begin{Verbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{Bio} \PYG{k+kn}{import} \PYG{n}{Align}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{aligner} \PYG{o}{=} \PYG{n}{Align}\PYG{o}{.}\PYG{n}{PairwiseAligner}\PYG{p}{()}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k}{def} \PYG{n+nf}{my\PYGZus{}gap\PYGZus{}score\PYGZus{}function}\PYG{p}{(}\PYG{n}{start}\PYG{p}{,} \PYG{n}{length}\PYG{p}{):}
\PYG{g+gp}{... }    \PYG{k}{if} \PYG{n}{start}\PYG{o}{==}\PYG{l+m+mi}{2}\PYG{p}{:}
\PYG{g+gp}{... }        \PYG{k}{return} \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1000}
\PYG{g+gp}{... }    \PYG{k}{else}\PYG{p}{:}
\PYG{g+gp}{... }        \PYG{k}{return} \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1} \PYG{o}{*} \PYG{n}{length}
\PYG{g+gp}{...}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{aligner}\PYG{o}{.}\PYG{n}{query\PYGZus{}gap\PYGZus{}score} \PYG{o}{=} \PYG{n}{my\PYGZus{}gap\PYGZus{}score\PYGZus{}function}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{alignments} \PYG{o}{=} \PYG{n}{aligner}\PYG{o}{.}\PYG{n}{align}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}AACTT\PYGZdq{}}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}AATT\PYGZdq{}}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k}{for} \PYG{n}{alignment} \PYG{o+ow}{in} \PYG{n}{alignments}\PYG{p}{:}
\PYG{g+gp}{... }    \PYG{k}{print}\PYG{p}{(}\PYG{n}{alignment}\PYG{p}{)}
\PYG{g+gp}{...}
\PYG{g+go}{AACTT}
\PYG{g+go}{\PYGZhy{}|.||}
\PYG{g+go}{\PYGZhy{}AATT}
\PYG{g+go}{\PYGZlt{}BLANKLINE\PYGZgt{}}
\PYG{g+go}{AACTT}
\PYG{g+go}{|\PYGZhy{}.||}
\PYG{g+go}{A\PYGZhy{}ATT}
\PYG{g+go}{\PYGZlt{}BLANKLINE\PYGZgt{}}
\PYG{g+go}{AACTT}
\PYG{g+go}{||.\PYGZhy{}|}
\PYG{g+go}{AAT\PYGZhy{}T}
\PYG{g+go}{\PYGZlt{}BLANKLINE\PYGZgt{}}
\PYG{g+go}{AACTT}
\PYG{g+go}{||.|\PYGZhy{}}
\PYG{g+go}{AATT\PYGZhy{}}
\PYG{g+go}{\PYGZlt{}BLANKLINE\PYGZgt{}}
\end{Verbatim}
