\begin{Verbatim}[commandchars=\\\{\}]
\PYG{k+kn}{from} \PYG{n+nn}{Bio} \PYG{k+kn}{import} \PYG{n}{SeqIO}
\PYG{k+kn}{from} \PYG{n+nn}{Bio.SeqIO.QualityIO} \PYG{k+kn}{import} \PYG{n}{PairedFastaQualIterator}

\PYG{k}{with} \PYG{n+nb}{open}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}example.fasta\PYGZdq{}}\PYG{p}{)} \PYG{k}{as} \PYG{n}{f\PYGZus{}handle}\PYG{p}{,} \PYG{n+nb}{open}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}example.qual\PYGZdq{}}\PYG{p}{)} \PYG{k}{as} \PYG{n}{q\PYGZus{}handle}\PYG{p}{:}
    \PYG{n}{records} \PYG{o}{=} \PYG{n}{PairedFastaQualIterator}\PYG{p}{(}\PYG{n}{f\PYGZus{}handle}\PYG{p}{,} \PYG{n}{q\PYGZus{}handle}\PYG{p}{)}
    \PYG{n}{count} \PYG{o}{=} \PYG{n}{SeqIO}\PYG{o}{.}\PYG{n}{write}\PYG{p}{(}\PYG{n}{records}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}temp.fastq\PYGZdq{}}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}fastq\PYGZdq{}}\PYG{p}{)}
\PYG{k}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}Converted }\PYG{l+s+si}{\PYGZpc{}i}\PYG{l+s+s2}{ records\PYGZdq{}} \PYG{o}{\PYGZpc{}} \PYG{n}{count}\PYG{p}{)}
\end{Verbatim}
