[BioSQL-l] Problem with example in python_biosql_basic.txt

Robert Roth robert.roth at home.se
Fri Sep 12 04:47:03 EDT 2003


Hi,

I am completly new to Biopython and BioSQL so my problems might arise from something trivial that I have missed. After installing MySQL, Biopython, MySQLdb and BioSQL I loaded the scheme for BioSQL into the database and everything is in place. The machine is running WinXP and python 2.3.

But when I try to follow the simple example in the documentation for using Biopython with BioSQL that is described in 
biosql/biosql-schema/doc/python_biosql_basic.txt it chokes (see below).

-----
>>> import MySQLdb
>>> from BioSQL import BioSeqDatabase
>>> server = BioSeqDatabase.open_database(driver = "MySQLdb", user = "test", passwd = "biopython", host = "localhost", db = "bioseqdb")
>>> db = server.new_database("cold")
>>> from Bio import GenBank
>>> parser = GenBank.FeatureParser()
>>> iterator = GenBank.Iterator(open("cor6_6.gb"), parser)
>>> db.load(iterator)

Traceback (most recent call last):
  File "<pyshell#26>", line 1, in -toplevel-
    db.load(iterator)
  File "E:\Python23\lib\site-packages\BioSQL\BioSeqDatabase.py", line 337, in load
    db_loader.load_seqrecord(cur_record)
  File "E:\Python23\lib\site-packages\BioSQL\Loader.py", line 30, in load_seqrecord
    bioentry_id = self._load_bioentry_table(record)
  File "E:\Python23\lib\site-packages\BioSQL\Loader.py", line 173, in _load_bioentry_table
    taxon_id = self._get_taxon_id(record)
  File "E:\Python23\lib\site-packages\BioSQL\Loader.py", line 107, in _get_taxon_id
    taxa = self.adaptor.execute_and_fetchall(sql, (binomial, variant))
  File "E:\Python23\lib\site-packages\BioSQL\BioSeqDatabase.py", line 236, in execute_and_fetchall
    self.cursor.execute(sql, args)
  File "E:\Python23\lib\site-packages\MySQLdb\cursors.py", line 95, in execute
    return self._execute(query, args)
  File "E:\Python23\lib\site-packages\MySQLdb\cursors.py", line 114, in _execute
    self.errorhandler(self, exc, value)
  File "E:\Python23\lib\site-packages\MySQLdb\connections.py", line 33, in defaulterrorhandler
    raise errorclass, errorvalue
OperationalError: (1054, "Unknown column 'binomial' in 'where clause'")

-----

>From loader.py
-----
        if binomial and variant:
            sql = "SELECT taxon_id FROM taxon WHERE binomial = %s" \
                  " AND variant = %s"
            taxa = self.adaptor.execute_and_fetchall(sql, (binomial, variant))
            if taxa:
                return taxa[0][0]
-----

When looking at Loader.py there is a call to MySQL (snippet above). 
But when I look at the ERD for BioSQL I cant find either binomial or variant in the taxon table. Am I completely of here (as I said I'm a complete newbie) or is this the reason its choking?
Any help on what is going wrong would be greatly appreciated.

Thanks in advance,
Robert



        




More information about the BioSQL-l mailing list