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

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Fri Jan 16 19:12:28 UTC 2009


------- Comment #2 from stephen at blackrim.net  2009-01-16 14:12 EST -------
Hi Peter,
Thanks for the quick reply. I will try to answer everything here. So I just
reran the BioSQL tests and I get 
test_BioSQL ... ok
test_BioSQL_SeqIO ... ok

so seems like everything there is fine (and I did configure the test for
postgres with the psycopg2 driver). I am downloading from the NCBI ftp and it
happens not only with all the files but also with the example on the biopython
biosql wiki page. Specifically with this example:
from Bio import Entrez
from Bio import SeqIO
from BioSQL import BioSeqDatabase
server = BioSeqDatabase.open_database(driver="psycopg2", ...)
db = server["plants"]
handle = Entrez.efetch(db="nuccore", id="6273291,6273290,6273289",
db.load(SeqIO.parse(handle, "genbank"))

I get the same error:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.5/site-packages/BioSQL/BioSeqDatabase.py", line 420,
in load
  File "/Library/Python/2.5/site-packages/BioSQL/Loader.py", line 50, in
    self._load_seqfeature(seq_feature, seq_feature_num, bioentry_id)
  File "/Library/Python/2.5/site-packages/BioSQL/Loader.py", line 508, in
    self._load_seqfeature_qualifiers(feature.qualifiers, seqfeature_id)
  File "/Library/Python/2.5/site-packages/BioSQL/Loader.py", line 607, in
  File "/Library/Python/2.5/site-packages/BioSQL/Loader.py", line 645, in
    self._get_seqfeature_dbxref(seqfeature_id, dbxref_id, rank+1)
  File "/Library/Python/2.5/site-packages/BioSQL/Loader.py", line 679, in
  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...

Thanks for any help. 

(In reply to comment #1)
> Hi Stephen,
> Does this happen for all the files you've tried, or just one or two?  If its
> the later it may be something funny about the file and how its been parsed. 
> I'm guessing you downloaded the GenBank files from
> ftp://ftp.ncbi.nih.gov/genbank/ so could you tell us one which is failing.
> Have you tried running the Biopython unit tests - in particular the two for
> BioSQL?  I presume you installed Biopython from source on your Mac, so you
> should have all the files present.  You'll need to edit the file
> Tests/setup_BioSQL.py to point to a suitable postgresql test database.
> P.S. As you are using Bio.SeqIO to parse the GenBank file, you don't need to
> import Bio.GenBank (first line of code snippet).

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