[BioSQL-l] python

christen christen at unice.fr
Mon Dec 8 08:57:32 EST 2003


Hi there

I am a new comer to python and biosql

I have tried to get working biosql under mysql and python as ewplained in
Basic BioSQL with Biopoython
I have donwloaded the latest version of both, and tried the example with
cor6_6.gb

then I got numerous problems

I fixed the first one by changing line 104 in cursors from
            if args is None:
to :
            if args is None or args=='':

then in Loader, in def _load_reference(self, reference, rank, bioentry_id):,
i made the following changes (in particular replaced JOIN by INNER JOIN)
if reference.medline_id:
            sql="SELECT reference_id" \
                "  FROM reference INNER JOIN dbxref ON reference .dbxref_id
= dbxref.dbxref_id" \
                " WHERE ((dbname = 'MEDLINE') AND (accession = %s))"
            refs =
self.adaptor.execute_and_fetch_col0(sql,reference.medline_id)


Now, I have one more pb:

Traceback (most recent call last):
  File "C:\Python23\RC_databases\rc_BioSQL_GenBank.py", line 21,
in -toplevel-
    db.load(iterator)
  File "C:\Python23\lib\site-packages\BioSQL\BioSeqDatabase.py", line 343,
in load
    db_loader.load_seqrecord(cur_record)
  File "C:\Python23\lib\site-packages\BioSQL\Loader.py", line 46, in
load_seqrecord
    self._load_seqfeature(seq_feature, seq_feature_num, bioentry_id)
  File "C:\Python23\lib\site-packages\BioSQL\Loader.py", line 366, in
_load_seqfeature
    self._load_seqfeature_locations(feature, seqfeature_id)
  File "C:\Python23\lib\site-packages\BioSQL\Loader.py", line 409, in
_load_seqfeature_locations
    self._insert_seqfeature_location(feature, 1, seqfeature_id)
  File "C:\Python23\lib\site-packages\BioSQL\Loader.py", line 430, in
_insert_seqfeature_location
    self.adaptor.execute(sql, (seqfeature_id, start, end, strand, rank))
  File "C:\Python23\lib\site-packages\BioSQL\BioSeqDatabase.py", line 223,
in execute
    self.cursor.execute(sql, args)
  File "C:\Python23\lib\site-packages\MySQLdb\cursors.py", line 95, in
execute
    return self._execute(query, args)
  File "C:\Python23\lib\site-packages\MySQLdb\cursors.py", line 119, in
_execute
    self.errorhandler(self, exc, value)
  File "C:\Python23\Lib\site-packages\MySQLdb\connections.py", line 33, in
defaulterrorhandler
    raise errorclass, errorvalue
OperationalError: (1048, "Le champ 'strand' ne peut \xeatre vide (null)")


I am for the time being only trying some quick and dirty (like modification
of cursor instead of loader I guess...) changes  to try to get it working
My questions are :
Is there somebody else having trouble, or do you I miss something ?
If I did it right, Is there somebody else trying to fix these problems ?
If things need some help, it would be very nice to have some clear
description of biosql structure. I have not been able to find it. Somebody
could help ?

thanks in advance





Richard CHRISTEN
Champion de saut en largeur
UMR6543 CNRS - Université de Nice Sophia Antipolis

Centre de Biochimie
Parc Valrose
06108 Nice cedex2

tel  33 - 492 076 947
fax 33 - 492 076 408



More information about the BioSQL-l mailing list