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

\PYG{c+c1}{\PYGZsh{} Imagine that you have loaded rec, as per the code snippet above...}

\PYG{n}{rec}\PYG{o}{.}\PYG{n}{remove\PYGZus{}population}\PYG{p}{(}\PYG{n}{pos}\PYG{p}{)}
\PYG{c+c1}{\PYGZsh{} Removes a population from a record, pos is the population position in}
\PYG{c+c1}{\PYGZsh{} rec.populations, remember that it starts on position 0.}
\PYG{c+c1}{\PYGZsh{} rec is altered.}

\PYG{n}{rec}\PYG{o}{.}\PYG{n}{remove\PYGZus{}locus\PYGZus{}by\PYGZus{}position}\PYG{p}{(}\PYG{n}{pos}\PYG{p}{)}
\PYG{c+c1}{\PYGZsh{} Removes a locus by its position, pos is the locus position in}
\PYG{c+c1}{\PYGZsh{}  rec.loci\PYGZus{}list, remember that it starts on position 0.}
\PYG{c+c1}{\PYGZsh{}  rec is altered.}

\PYG{n}{rec}\PYG{o}{.}\PYG{n}{remove\PYGZus{}locus\PYGZus{}by\PYGZus{}name}\PYG{p}{(}\PYG{n}{name}\PYG{p}{)}
\PYG{c+c1}{\PYGZsh{} Removes a locus by its name, name is the locus name as in}
\PYG{c+c1}{\PYGZsh{} rec.loci\PYGZus{}list. If the name doesn\PYGZsq{}t exist the function fails}
\PYG{c+c1}{\PYGZsh{} silently.}
\PYG{c+c1}{\PYGZsh{} rec is altered.}

\PYG{n}{rec\PYGZus{}loci} \PYG{o}{=} \PYG{n}{rec}\PYG{o}{.}\PYG{n}{split\PYGZus{}in\PYGZus{}loci}\PYG{p}{()}
\PYG{c+c1}{\PYGZsh{} Splits a record in loci, that is, for each loci, it creates a new}
\PYG{c+c1}{\PYGZsh{} record, with a single loci and all populations.}
\PYG{c+c1}{\PYGZsh{} The result is returned in a dictionary, being each key the locus name.}
\PYG{c+c1}{\PYGZsh{} The value is the GenePop record.}
\PYG{c+c1}{\PYGZsh{} rec is not altered.}

\PYG{n}{rec\PYGZus{}pops} \PYG{o}{=} \PYG{n}{rec}\PYG{o}{.}\PYG{n}{split\PYGZus{}in\PYGZus{}pops}\PYG{p}{(}\PYG{n}{pop\PYGZus{}names}\PYG{p}{)}
\PYG{c+c1}{\PYGZsh{} Splits a record in populations, that is, for each population, it creates}
\PYG{c+c1}{\PYGZsh{} a new record, with a single population and all loci.}
\PYG{c+c1}{\PYGZsh{} The result is returned in a dictionary, being each key}
\PYG{c+c1}{\PYGZsh{} the population name. As population names are not available in GenePop,}
\PYG{c+c1}{\PYGZsh{} they are passed in array (pop\PYGZus{}names).}
\PYG{c+c1}{\PYGZsh{} The value of each dictionary entry is the GenePop record.}
\PYG{c+c1}{\PYGZsh{} rec is not altered.}
\end{Verbatim}
