[BioPython] BioSQL problems on load

Daniel Tomso dtomso at athenixcorp.com
Thu Dec 20 20:08:47 UTC 2007


Hi-

This is possibly a simple configuration problem, but I'm having some
problems loading files into BioSQL.

 

Here's the code I'm using:

 

from BioSQL import BioSeqDatabase

from Bio import SeqIO

import sys

 

sfilename = sys.argv[1]

 

server = BioSeqDatabase.open_database(driver = 'MySQLdb',

                                      user = 'pythonapi',

                                      passwd = 'xxxxxxx',

                                      host = 'localhost',

                                      db = 'bioseqdb',

                                      )

contigdb = server.new_database('test')

sfile = open(sfilename, 'rU')

contigdb.load(SeqIO.parse(sfile, 'genbank'))

sfile.close()

 

And here's the error message:

 

/usr/lib/python2.5/site-packages/Bio/crc.py:5: DeprecationWarning:
Bio.crc is deprecated; use crc32 and crc64 in Bio.SeqUtils.CheckSum
instead

  warnings.warn("Bio.crc is deprecated; use crc32 and crc64 in
Bio.SeqUtils.CheckSum instead", DeprecationWarning)

Traceback (most recent call last):

  File "biosql_driver.py", line 26, in <module>

    contigdb.load(SeqIO.parse(sfile, 'genbank'))

  File
"/home/dtomso/repository/biopython/build/lib.linux-i686-2.5/BioSQL/BioSe
qDatabase.py", line 412, in load

    db_loader.load_seqrecord(cur_record)

  File "/usr/lib/python2.5/site-packages/BioSQL/Loader.py", line 30, in
load_seqrecord

    bioentry_id = self._load_bioentry_table(record)

  File "/usr/lib/python2.5/site-packages/BioSQL/Loader.py", line 253, in
_load_bioentry_table

    version))

  File
"/home/dtomso/repository/biopython/build/lib.linux-i686-2.5/BioSQL/BioSe
qDatabase.py", line 277, in execute

    self.cursor.execute(sql, args or ())

  File "/usr/lib/python2.5/site-packages/MySQLdb/cursors.py", line 149,
in execute

    query = query % db.literal(args)

TypeError: not all arguments converted during string formatting

 

 

This happens with standard genbank and fasta files pulled off of NCBI.
Any suggestions?

 

There's another issue regarding standard parsing of accession numbers to
get version IDs (the code doesn't like non-NCBI fasta headers, e.g.
those produced by phrap), but that is pretty minor and doesn't seem to
be related to this.

 

Thanks for any ideas!

Dan Tomso

 

----------------------------------------

Daniel J. Tomso

Senior Scientist
Athenix Corporation

PO Box 110347

Research Triangle Park, NC  27709

----------------------------------------

919.328.4122

dtomso at athenixcorp.com

www.athenixcorp.com

----------------------------------------

Disclaimer: This message (including any attachments) may contain
confidential or privileged information and is intended only for the use
of the addressee named above. If you are not the intended recipient of
this message, you are hereby notified that you must not use, copy,
disclose or take any action based on this message or information herein.
If you have received this message in error, please advise the sender
immediately and erase all copies of this message and any related
attachments.  Thank you.

 





More information about the Biopython mailing list