[Biopython-dev] [Bug 2833] Features insertion on previous bioentry_id

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Fri May 22 08:41:39 UTC 2009


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





------- Comment #13 from andrea at biodec.com  2009-05-22 04:41 EST -------
(In reply to comment #12)
> After deleting the RULES in the BioSQL schema, all the new unittests pass.
> 
> (All the RULES can be deleted as they are all there to circumvent the problem
> in Bioperl-db described by Hilmar Lapp on the biopython-dev list:
> 
> http://lists.open-bio.org/pipermail/biopython-dev/2009-May/006084.html
> 
> See also the comment in the schema.)
> 
> C.

I've deleted the two rules, 
rule_bioentry_i1
rule_bioentry_i2

and then i run the tests:
Make sure can't import records with same ID (in one go). ... ok
Make sure can't import records with same ID (in steps). ... ok
Make sure can't import records with same ID (in steps with commit). ... ok
Make sure can't import a single record twice (in one go). ... ok
Make sure can't import a single record twice (in steps). ... ok
Make sure can't import a single record twice (in steps with commit). ... ok
Make sure all records are correctly loaded. ... ok
Make sure can't reimport existing records. ... ok
Indepth check that SeqFeatures are transmitted through the db. ... ok
Load SeqRecord objects into a BioSQL database. ... ok
Get a list of all items in the database. ... ok
Test retrieval of items using various ids. ... ok
Check can add DBSeq objects together. ... ok
Check can turn a DBSeq object into a Seq or MutableSeq. ... ok
Make sure Seqs from BioSQL implement the right interface. ... ok
Check SeqFeatures of a sequence. ... ok
Make sure SeqRecords from BioSQL implement the right interface. ... ok
Check that slices of sequences are retrieved properly. ... ok

----------------------------------------------------------------------
Ran 18 tests in 58.371s

OK

with pythhon2.4, python2.5, psycopg, psycopg2.
Everything seems to be ok. I don't know which other possible effects could be
triggered by this deletion. But i think it should be inserted as soon as
possbile into the BioSQL Schema/PostGreSQL (updating also the Test BioSQL
schema/PostGreSQL).


After removing the rules i've run my own tests:
.....
>>> ## LOAD INTO DB
>>> db.load([s1])
1
>>> db.load([s2])
1
>>> db.load([s3])
Traceback (most recent call last):
  File "<console>", line 1, in ?
  File "../BioSQL/BioSeqDatabase.py", line 442, in load
  File "../BioSQL/Loader.py", line 50, in load_seqrecord
  File "../BioSQL/Loader.py", line 550, in _load_bioentry_table
  File "../BioSQL/BioSeqDatabase.py", line 301, in execute
IntegrityError: duplicate key value violates unique constraint
"bioentry_accession_key"

And i've got the error, that is what it is expected as a normal behaviour.
So now i've only to trap the exception or pre-check duplications.

Many Thanks
Andrea


-- 
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