\begin{Verbatim}[commandchars=\\\{\}]
\PYG{k+kn}{from} \PYG{n+nn}{Bio} \PYG{k+kn}{import} \PYG{n}{AlignIO}

\PYG{n}{alignment} \PYG{o}{=} \PYG{n}{AlignIO}\PYG{o}{.}\PYG{n}{read}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}PF05371\PYGZus{}seed.sth\PYGZdq{}}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}stockholm\PYGZdq{}}\PYG{p}{)}
\PYG{n}{name\PYGZus{}mapping} \PYG{o}{=} \PYG{p}{\PYGZob{}\PYGZcb{}}
\PYG{k}{for} \PYG{n}{i}\PYG{p}{,} \PYG{n}{record} \PYG{o+ow}{in} \PYG{n+nb}{enumerate}\PYG{p}{(}\PYG{n}{alignment}\PYG{p}{):}
    \PYG{n}{name\PYGZus{}mapping}\PYG{p}{[}\PYG{n}{i}\PYG{p}{]} \PYG{o}{=} \PYG{n}{record}\PYG{o}{.}\PYG{n}{id}
    \PYG{n}{record}\PYG{o}{.}\PYG{n}{id} \PYG{o}{=} \PYG{l+s+s2}{\PYGZdq{}seq}\PYG{l+s+si}{\PYGZpc{}i}\PYG{l+s+s2}{\PYGZdq{}} \PYG{o}{\PYGZpc{}} \PYG{n}{i}
\PYG{k}{print}\PYG{p}{(}\PYG{n}{name\PYGZus{}mapping}\PYG{p}{)}

\PYG{n}{AlignIO}\PYG{o}{.}\PYG{n}{write}\PYG{p}{([}\PYG{n}{alignment}\PYG{p}{],} \PYG{l+s+s2}{\PYGZdq{}PF05371\PYGZus{}seed.phy\PYGZdq{}}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}phylip\PYGZdq{}}\PYG{p}{)}
\end{Verbatim}
