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

\PYG{n}{name} \PYG{o}{=} \PYG{l+s+s2}{\PYGZdq{}Proux Fig 6\PYGZdq{}}
\PYG{n}{gd\PYGZus{}diagram} \PYG{o}{=} \PYG{n}{GenomeDiagram}\PYG{o}{.}\PYG{n}{Diagram}\PYG{p}{(}\PYG{n}{name}\PYG{p}{)}
\PYG{n}{max\PYGZus{}len} \PYG{o}{=} \PYG{l+m+mi}{0}
\PYG{k}{for} \PYG{n}{record}\PYG{p}{,} \PYG{n}{gene\PYGZus{}colors} \PYG{o+ow}{in} \PYG{n+nb}{zip}\PYG{p}{([}\PYG{n}{A\PYGZus{}rec}\PYG{p}{,} \PYG{n}{B\PYGZus{}rec}\PYG{p}{,} \PYG{n}{C\PYGZus{}rec}\PYG{p}{],} \PYG{p}{[}\PYG{n}{A\PYGZus{}colors}\PYG{p}{,} \PYG{n}{B\PYGZus{}colors}\PYG{p}{,} \PYG{n}{C\PYGZus{}colors}\PYG{p}{]):}
    \PYG{n}{max\PYGZus{}len} \PYG{o}{=} \PYG{n+nb}{max}\PYG{p}{(}\PYG{n}{max\PYGZus{}len}\PYG{p}{,} \PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{record}\PYG{p}{))}
    \PYG{n}{gd\PYGZus{}track\PYGZus{}for\PYGZus{}features} \PYG{o}{=} \PYG{n}{gd\PYGZus{}diagram}\PYG{o}{.}\PYG{n}{new\PYGZus{}track}\PYG{p}{(}
        \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{name}\PYG{o}{=}\PYG{n}{record}\PYG{o}{.}\PYG{n}{name}\PYG{p}{,} \PYG{n}{greytrack}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{,} \PYG{n}{start}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{end}\PYG{o}{=}\PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{record}\PYG{p}{)}
    \PYG{p}{)}
    \PYG{n}{gd\PYGZus{}feature\PYGZus{}set} \PYG{o}{=} \PYG{n}{gd\PYGZus{}track\PYGZus{}for\PYGZus{}features}\PYG{o}{.}\PYG{n}{new\PYGZus{}set}\PYG{p}{()}

    \PYG{n}{i} \PYG{o}{=} \PYG{l+m+mi}{0}
    \PYG{k}{for} \PYG{n}{feature} \PYG{o+ow}{in} \PYG{n}{record}\PYG{o}{.}\PYG{n}{features}\PYG{p}{:}
        \PYG{k}{if} \PYG{n}{feature}\PYG{o}{.}\PYG{n}{type} \PYG{o}{!=} \PYG{l+s+s2}{\PYGZdq{}gene\PYGZdq{}}\PYG{p}{:}
            \PYG{c+c1}{\PYGZsh{} Exclude this feature}
            \PYG{k}{continue}
        \PYG{n}{gd\PYGZus{}feature\PYGZus{}set}\PYG{o}{.}\PYG{n}{add\PYGZus{}feature}\PYG{p}{(}
            \PYG{n}{feature}\PYG{p}{,}
            \PYG{n}{sigil}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}ARROW\PYGZdq{}}\PYG{p}{,}
            \PYG{n}{color}\PYG{o}{=}\PYG{n}{gene\PYGZus{}colors}\PYG{p}{[}\PYG{n}{i}\PYG{p}{],}
            \PYG{n}{label}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{,}
            \PYG{n}{name}\PYG{o}{=}\PYG{n+nb}{str}\PYG{p}{(}\PYG{n}{i} \PYG{o}{+} \PYG{l+m+mi}{1}\PYG{p}{),}
            \PYG{n}{label\PYGZus{}position}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}start\PYGZdq{}}\PYG{p}{,}
            \PYG{n}{label\PYGZus{}size}\PYG{o}{=}\PYG{l+m+mi}{6}\PYG{p}{,}
            \PYG{n}{label\PYGZus{}angle}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{,}
        \PYG{p}{)}
        \PYG{n}{i} \PYG{o}{+=} \PYG{l+m+mi}{1}

\PYG{n}{gd\PYGZus{}diagram}\PYG{o}{.}\PYG{n}{draw}\PYG{p}{(}\PYG{n+nb}{format}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}linear\PYGZdq{}}\PYG{p}{,} \PYG{n}{pagesize}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}A4\PYGZdq{}}\PYG{p}{,} \PYG{n}{fragments}\PYG{o}{=}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{start}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{end}\PYG{o}{=}\PYG{n}{max\PYGZus{}len}\PYG{p}{)}
\PYG{n}{gd\PYGZus{}diagram}\PYG{o}{.}\PYG{n}{write}\PYG{p}{(}\PYG{n}{name} \PYG{o}{+} \PYG{l+s+s2}{\PYGZdq{}.pdf\PYGZdq{}}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}PDF\PYGZdq{}}\PYG{p}{)}
\PYG{n}{gd\PYGZus{}diagram}\PYG{o}{.}\PYG{n}{write}\PYG{p}{(}\PYG{n}{name} \PYG{o}{+} \PYG{l+s+s2}{\PYGZdq{}.eps\PYGZdq{}}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}EPS\PYGZdq{}}\PYG{p}{)}
\PYG{n}{gd\PYGZus{}diagram}\PYG{o}{.}\PYG{n}{write}\PYG{p}{(}\PYG{n}{name} \PYG{o}{+} \PYG{l+s+s2}{\PYGZdq{}.svg\PYGZdq{}}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}SVG\PYGZdq{}}\PYG{p}{)}
\end{Verbatim}
