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

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Mon Jun 1 23:08:06 UTC 2009


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





------- Comment #16 from cymon.cox at gmail.com  2009-06-01 19:08 EST -------
(In reply to comment #15)

> @@ -439,5 +449,14 @@ class BioSeqDatabase:
>          num_records = 0
>          for cur_record in record_iterator :
>              num_records += 1
> +            if self.postgres_rules_present:
> +                self.adaptor.execute("SELECT count(bioentry_id) FROM
> bioentry")
> +                curr_val = self.adaptor.cursor.fetchone()[0]
>              db_loader.load_seqrecord(cur_record)
> +            if self.postgres_rules_present:
> +                self.adaptor.execute("SELECT count(bioentry_id) FROM
> bioentry")
> +                after_val = self.adaptor.cursor.fetchone()[0]
> +                if curr_val == after_val:
> +                    raise self.adaptor.conn.IntegrityError("Duplicate record " 
> +                        "detected: record has not been inserted")
>          return num_records

Actually, I dont think this is going to solve the original problem because the
SeqFeatures of the second record will still be inserted over the first record,
before the IntegrityError is raised.

So the check needs to surround line 50 in Loader.py:

bioentry_id = self._load_bioentry_table(record)

which means passing a passing a postgres_rules_present parameter to
Loader.load_seqrecord().

C.


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