[Biopython-dev] [Bug 2840] When a record has been loaded from BioSQL, trying to save it to another database fails with loader db_loader.load_seqrecord in _load_reference

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Mon May 25 18:23:20 EDT 2009


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





------- Comment #1 from david.wyllie at ndm.ox.ac.uk  2009-05-25 18:23 EST -------
I have modified the dbtestcase.py script to show the contents of the reference
of the record downloaded from genbank, and from the record recovered from
BioSQL.

Here is a print out of the last two references before saving to BioSQL:

authors: Sugita,M., Sugiura,C., Arikawa,T. and Higuchi,M.
title: Molecular evidence of an rpoA gene in the basal moss chloroplast
genomes: rpoA is a useful molecular marker for phylogenetic analysis of mosses
journal: Hikobia 14, 171-175 (2004)
medline id: 
pubmed id: 
comment: 

location: [0:789]
authors: Sugita,M.
title: Direct Submission
journal: Submitted (25-DEC-2002) Mamoru Sugita, Nagoya University, Center for
Gene Research; Chikusa-ku, Nagoya, Aichi 464-8602, Japan
(E-mail:sugita at gene.nagoya-u.ac.jp, Tel:81-52-789-3080(ex.3080),
Fax:81-52-789-3080)
medline id: 
pubmed id: 
comment: 

--- note: no location in the first one; only a location in the last reference
(why? - should references have a location?  I suppose they might, if they
referred to a part of a chromosome?)

Now, after saving to BioSQL and recovering, all the records have a location,
but in some cases, it is [None:None]; here are the same two records.

location: [None:None]
authors: Sugita,M., Sugiura,C., Arikawa,T. and Higuchi,M.
title: Molecular evidence of an rpoA gene in the basal moss chloroplast
genomes: rpoA is a useful molecular marker for phylogenetic analysis of mosses
journal: Hikobia 14, 171-175 (2004)
medline id: 
pubmed id: 
comment: 

location: [0:789]
authors: Sugita,M.
title: Direct Submission
journal: Submitted (25-DEC-2002) Mamoru Sugita, Nagoya University, Center for
Gene Research; Chikusa-ku, Nagoya, Aichi 464-8602, Japan
(E-mail:sugita at gene.nagoya-u.ac.jp, Tel:81-52-789-3080(ex.3080),
Fax:81-52-789-3080)
medline id: 
pubmed id: 
comment: 


After this, the db.load method calls _load_reference.  

I think the problem is because the last line doesn't cope with none values.
If one edits 
_load_reference to put the last reference inside a test for the null condition

     if (start is not None and end is not None):        
            sql = "INSERT INTO bioentry_reference (bioentry_id, reference_id,"
\
                  " start_pos, end_pos, rank)" \
                  " VALUES (%s, %s, %s, %s, %s)"
            self.adaptor.execute(sql, (bioentry_id, reference_id,
                                       start, end, rank + 1))

Then the problem is solved, but I'm not sure how this fits in the bigger scheme
of things.

d


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