[Biopython] build problem on Ubuntu

Peter Cock p.j.a.cock at googlemail.com
Wed Jul 10 22:06:05 UTC 2013


On Wed, Jul 10, 2013 at 8:51 PM, Alan McKay <alan.mckay at gmail.com> wrote:
> Hi folks,
>
> Ubuntu 13.04 and just did "apt-get -y upgrade"
> Python 2.7.4
> biopython-1.61
>
> root at ofreezertest:~/ofreeze/biopython-1.61# dpkg --list | grep -i ncbi
> ii  libncbi6:amd64                     6.1.20120620-2
>  amd64        NCBI libraries for biology applications
> ii  libvibrant6a:amd64                 6.1.20120620-2
>  amd64        NCBI libraries for graphic biology applications
> ii  ncbi-blast+                        2.2.27-3
>  amd64        next generation suite of BLAST sequence search tools
> ii  ncbi-blast+-legacy                 2.2.27-3
>  all          NCBI Blast legacy call script
> ii  ncbi-data                          6.1.20120620-2
>  all          Platform-independent data for the NCBI toolkit
> ii  ncbi-epcr                          2.3.12-1-1
>  amd64        Tool to test a DNA sequence for the presence of sequence
> tagged sites
> ii  ncbi-rrna-data                     6.1.20120620-2
>  all          large rRNA BLAST databases distributed with the NCBI
> toolkit
> ii  ncbi-tools-bin                     6.1.20120620-2
>  amd64        NCBI libraries for biology applications (text-based
> utilities)
> ii  ncbi-tools-x11                     6.1.20120620-2
>  amd64        NCBI libraries for biology applications (X-based
> utilities)
> root at ofreezertest:~/ofreeze/biopython-1.61#
>
>
> I do the :
> python setup.py build
>
> and then the
> python setup.py test
>
> It starts going through a bunch of tests - most are ok some are not
> but no big deal until a whole bunch of these :
>
> Bio.PDB.Polypeptide docstring test ... ok
> Bio.PDB.Selection docstring test ... ok
> ======================================================================
> ERROR: test_write_multiple_from_blastxml
> (test_SearchIO_write.BlastXmlWriteCases)
> Test blast-xml writing from blast-xml, BLAST 2.2.26+, multiple queries
> (xml_2226_blastp_001.xml)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "test_SearchIO_write.py", line 55, in test_write_multiple_from_blastxml
>     self.parse_write_and_compare(source, self.fmt, self.out, self.fmt)
>   File "test_SearchIO_write.py", line 27, in parse_write_and_compare
>     SearchIO.write(source_qresults, out_file, out_format, **kwargs)
>   File "/root/ofreeze/biopython-1.61/build/lib.linux-x86_64-2.7/Bio/SearchIO/__init__.py",
> line 610, in write
>     writer.write_file(qresults)
>   File "/root/ofreeze/biopython-1.61/build/lib.linux-x86_64-2.7/Bio/SearchIO/BlastIO/blast_xml.py",
> line 695, in write_file
>     xml.startDocument()
>   File "/root/ofreeze/biopython-1.61/build/lib.linux-x86_64-2.7/Bio/SearchIO/BlastIO/blast_xml.py",
> line 612, in startDocument
>     self.write('<?xml version="1.0"?>\n'
>   File "/usr/lib/python2.7/xml/sax/saxutils.py", line 103, in write
>     super(UnbufferedTextIOWrapper, self).write(s)
> TypeError: must be unicode, not str
>
> ======================================================================
> ERROR: test_write_single_from_blastxml (test_SearchIO_write.BlastXmlWriteCases)
> Test blast-xml writing from blast-xml, BLAST 2.2.26+, single query
> (xml_2226_blastp_004.xml)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "test_SearchIO_write.py", line 49, in test_write_single_from_blastxml
>     self.parse_write_and_compare(source, self.fmt, self.out, self.fmt)
>   File "test_SearchIO_write.py", line 27, in parse_write_and_compare
>     SearchIO.write(source_qresults, out_file, out_format, **kwargs)
>   File "/root/ofreeze/biopython-1.61/build/lib.linux-x86_64-2.7/Bio/SearchIO/__init__.py",
> line 610, in write
>     writer.write_file(qresults)
>   File "/root/ofreeze/biopython-1.61/build/lib.linux-x86_64-2.7/Bio/SearchIO/BlastIO/blast_xml.py",
> line 695, in write_file
>     xml.startDocument()
>   File "/root/ofreeze/biopython-1.61/build/lib.linux-x86_64-2.7/Bio/SearchIO/BlastIO/blast_xml.py",
> line 612, in startDocument
>     self.write('<?xml version="1.0"?>\n'
>   File "/usr/lib/python2.7/xml/sax/saxutils.py", line 103, in write
>     super(UnbufferedTextIOWrapper, self).write(s)
> TypeError: must be unicode, not str
>

Hi Alan,

This was a minor regression in Python 2.7.4 (it worked in 2.7.3),
for which we have a workaround in the next release of Biopython:
http://lists.open-bio.org/pipermail/biopython-dev/2013-April/010505.html

Given we plan to release Biopython 1.62 soon (this month),
you could just try the latest version from the Git repository...
or wait.

Or, you could try applying this change to Biopython 1.61 instead?
https://github.com/biopython/biopython/commit/3c9de1510fd1e9da23e96d8f9213a7e86873e3f6

(If that reply was too technical, please let me know)

Regards,

Peter



More information about the Biopython mailing list