[Biopython-dev] [Bug 2734] New: db.load problem with postgresql and psycopg2

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Thu Jan 15 23:55:14 UTC 2009


http://bugzilla.open-bio.org/show_bug.cgi?id=2734

           Summary: db.load problem with postgresql and psycopg2
           Product: Biopython
           Version: 1.49
          Platform: Macintosh
        OS/Version: Mac OS
            Status: NEW
          Severity: normal
          Priority: P2
         Component: BioSQL
        AssignedTo: biopython-dev at biopython.org
        ReportedBy: stephen at blackrim.net


I have a simple script to load sequences into a postgresql database using the
biosql schema and biopython db.load function. 

here is the script :

from Bio import GenBank
from Bio import SeqIO
from BioSQL import BioSeqDatabase
server = BioSeqDatabase.open_database(driver="psycopg2", user=...)
db = server["plants"]
for i in range(37):
        handle = open("PLN/gbpln"+str(i+1)+".seq", "r")
        db.load(SeqIO.parse(handle,"genbank"))
        handle.close()
        print str(i+1)
server.adaptor.commit()

there is an error with the output and here it is with some of the psycopg2
debug info:

asis_dealloc: deleted asis object at 0x52350, refcnt = 0
psyco_curs_execute: cvt->refcnt = 1
curs_execute: pg connection at 0x8d0c00 OK
pq_begin: pgconn = 0x8d0c00, isolevel = 1, status = 2
pq_begin: transaction in progress
pq_execute: executing SYNC query:
   SELECT seqfeature_id, dbxref_id FROM seqfeature_dbxref WHERE seqfeature_id =
"3" AND dbxref_id = "6"
pq_execute: entering syncronous DBAPI compatibility mode
pq_fetch: pgstatus = PGRES_FATAL_ERROR
pq_fetch: uh-oh, something FAILED
pq_fetch: fetching done; check for critical errors
psyco_curs_execute: res = -1, pgres = 0x0
Traceback (most recent call last):
 File "add_seqs_subdb2 2.py", line 9, in <module>
   db.load(SeqIO.parse(handle,"genbank"))
 File "/Library/Python/2.5/site-packages/BioSQL/BioSeqDatabase.py", line 420,
in load
   db_loader.load_seqrecord(cur_record)
 File "/Library/Python/2.5/site-packages/BioSQL/Loader.py", line 50, in
load_seqrecord
   self._load_seqfeature(seq_feature, seq_feature_num, bioentry_id)
 File "/Library/Python/2.5/site-packages/BioSQL/Loader.py", line 508, in
_load_seqfeature
   self._load_seqfeature_qualifiers(feature.qualifiers, seqfeature_id)
 File "/Library/Python/2.5/site-packages/BioSQL/Loader.py", line 607, in
_load_seqfeature_qualifiers
   seqfeature_id)
 File "/Library/Python/2.5/site-packages/BioSQL/Loader.py", line 645, in
_load_seqfeature_dbxref
   self._get_seqfeature_dbxref(seqfeature_id, dbxref_id, rank+1)
 File "/Library/Python/2.5/site-packages/BioSQL/Loader.py", line 679, in
_get_seqfeature_dbxref
   dbxref_id))
 File "/Library/Python/2.5/site-packages/BioSQL/BioSeqDatabase.py", line 295,
in execute_and_fetch_col0
   self.cursor.execute(sql, args or ())
psycopg2.ProgrammingError: column "3" does not exist
LINE 1: ...f_id FROM seqfeature_dbxref WHERE seqfeature_id = "3" AND db...

it seems like there could be some issues with the double quotes but i am not
sure where that is being called. i am using postgresql 8.2.


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Biopython-dev mailing list