\begin{Verbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{alignment} \PYG{o}{=} \PYG{n}{alignments}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{Bio.Align.substitution\PYGZus{}matrices} \PYG{k+kn}{import} \PYG{n}{Array}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{frequency} \PYG{o}{=} \PYG{n}{Array}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}ACGT\PYGZdq{}}\PYG{p}{,} \PYG{n}{dims}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k}{for} \PYG{p}{(}\PYG{n}{start1}\PYG{p}{,} \PYG{n}{end1}\PYG{p}{),} \PYG{p}{(}\PYG{n}{start2}\PYG{p}{,} \PYG{n}{end2}\PYG{p}{)} \PYG{o+ow}{in} \PYG{n+nb}{zip}\PYG{p}{(}\PYG{o}{*}\PYG{n}{alignment}\PYG{o}{.}\PYG{n}{aligned}\PYG{p}{):}
\PYG{g+gp}{... }    \PYG{n}{seq1} \PYG{o}{=} \PYG{n}{sequence1}\PYG{p}{[}\PYG{n}{start1}\PYG{p}{:}\PYG{n}{end1}\PYG{p}{]}
\PYG{g+gp}{... }    \PYG{n}{seq2} \PYG{o}{=} \PYG{n}{sequence2}\PYG{p}{[}\PYG{n}{start2}\PYG{p}{:}\PYG{n}{end2}\PYG{p}{]}
\PYG{g+gp}{... }    \PYG{k}{for} \PYG{n}{c1}\PYG{p}{,} \PYG{n}{c2} \PYG{o+ow}{in} \PYG{n+nb}{zip}\PYG{p}{(}\PYG{n}{seq1}\PYG{p}{,} \PYG{n}{seq2}\PYG{p}{):}
\PYG{g+gp}{... }        \PYG{n}{frequency}\PYG{p}{[}\PYG{n}{c1}\PYG{p}{,} \PYG{n}{c2}\PYG{p}{]} \PYG{o}{+=} \PYG{l+m+mi}{1}
\PYG{g+gp}{...}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{n}{frequency}\PYG{p}{)}
\PYG{g+go}{      A     C     G     T}
\PYG{g+go}{A 307.0  19.0  34.0  19.0}
\PYG{g+go}{C  15.0 280.0  25.0  29.0}
\PYG{g+go}{G  34.0  24.0 401.0  20.0}
\PYG{g+go}{T  24.0  36.0  20.0 228.0}
\PYG{g+go}{\PYGZlt{}BLANKLINE\PYGZgt{}}
\end{Verbatim}
