\begin{Verbatim}[commandchars=\\\{\}]
\PYG{k+kn}{from} \PYG{n+nn}{Bio.SeqFeature} \PYG{k+kn}{import} \PYG{n}{SeqFeature}\PYG{p}{,} \PYG{n}{FeatureLocation}
\PYG{k+kn}{from} \PYG{n+nn}{Bio.Graphics} \PYG{k+kn}{import} \PYG{n}{GenomeDiagram}
\PYG{k+kn}{from} \PYG{n+nn}{reportlab.lib.units} \PYG{k+kn}{import} \PYG{n}{cm}

\PYG{n}{gdd} \PYG{o}{=} \PYG{n}{GenomeDiagram}\PYG{o}{.}\PYG{n}{Diagram}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}Test Diagram\PYGZdq{}}\PYG{p}{)}
\PYG{n}{gdt\PYGZus{}features} \PYG{o}{=} \PYG{n}{gdd}\PYG{o}{.}\PYG{n}{new\PYGZus{}track}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{greytrack}\PYG{o}{=}\PYG{k+kc}{False}\PYG{p}{)}
\PYG{n}{gds\PYGZus{}features} \PYG{o}{=} \PYG{n}{gdt\PYGZus{}features}\PYG{o}{.}\PYG{n}{new\PYGZus{}set}\PYG{p}{()}

\PYG{c+c1}{\PYGZsh{} Add three features to show the strand options,}
\PYG{n}{feature} \PYG{o}{=} \PYG{n}{SeqFeature}\PYG{p}{(}\PYG{n}{FeatureLocation}\PYG{p}{(}\PYG{l+m+mi}{25}\PYG{p}{,} \PYG{l+m+mi}{125}\PYG{p}{),} \PYG{n}{strand}\PYG{o}{=+}\PYG{l+m+mi}{1}\PYG{p}{)}
\PYG{n}{gds\PYGZus{}features}\PYG{o}{.}\PYG{n}{add\PYGZus{}feature}\PYG{p}{(}\PYG{n}{feature}\PYG{p}{,} \PYG{n}{name}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Forward\PYGZdq{}}\PYG{p}{,} \PYG{n}{label}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{)}
\PYG{n}{feature} \PYG{o}{=} \PYG{n}{SeqFeature}\PYG{p}{(}\PYG{n}{FeatureLocation}\PYG{p}{(}\PYG{l+m+mi}{150}\PYG{p}{,} \PYG{l+m+mi}{250}\PYG{p}{),} \PYG{n}{strand}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{)}
\PYG{n}{gds\PYGZus{}features}\PYG{o}{.}\PYG{n}{add\PYGZus{}feature}\PYG{p}{(}\PYG{n}{feature}\PYG{p}{,} \PYG{n}{name}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Strandless\PYGZdq{}}\PYG{p}{,} \PYG{n}{label}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{)}
\PYG{n}{feature} \PYG{o}{=} \PYG{n}{SeqFeature}\PYG{p}{(}\PYG{n}{FeatureLocation}\PYG{p}{(}\PYG{l+m+mi}{275}\PYG{p}{,} \PYG{l+m+mi}{375}\PYG{p}{),} \PYG{n}{strand}\PYG{o}{=\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{)}
\PYG{n}{gds\PYGZus{}features}\PYG{o}{.}\PYG{n}{add\PYGZus{}feature}\PYG{p}{(}\PYG{n}{feature}\PYG{p}{,} \PYG{n}{name}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Reverse\PYGZdq{}}\PYG{p}{,} \PYG{n}{label}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{)}

\PYG{n}{gdd}\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{p}{(}\PYG{l+m+mi}{15} \PYG{o}{*} \PYG{n}{cm}\PYG{p}{,} \PYG{l+m+mi}{4} \PYG{o}{*} \PYG{n}{cm}\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{l+m+mi}{400}\PYG{p}{)}
\PYG{n}{gdd}\PYG{o}{.}\PYG{n}{write}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}GD\PYGZus{}labels\PYGZus{}default.pdf\PYGZdq{}}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}pdf\PYGZdq{}}\PYG{p}{)}
\end{Verbatim}
