[BioSQL-l] Question regarding updating records in a BioSQL database (under Python)

Peter Cock p.j.a.cock at googlemail.com
Tue Mar 12 20:58:07 UTC 2013


On Tuesday, March 12, 2013, Dan Tomso wrote:

> Hello all--
> This seems trivial, but I'm struggling with how to add SeqFeatures to a
> BioSQL DBSeqRecord object.
>
> I can update the object, but then I can't update the DB.  If I delete the
> original from the db, it kills the updated copy.  If I try to deep copy the
> original, I get lots of errors.  If I try to load the modified record
> without removing the original, I get a collision.
>
> I've tried also just updating the entry via the dictionary-like approach.
>
> Where am I going wrong?
>
> Thanks,
> Dan Tomso
>
>
Hi Dan,

It sounds like you are using Biopython, right? Clearly our
docs need a little more clarification - the dictionary like
interface (and the whole DBSeqRecord) uses a read only
lazy loading approach (for example neither the sequence
nor the features are loaded from the database into objects
in memory until accessed).

You could try creating a separate namespace (e.g. Old
and New) within the same database to allow you to
save the modified record into a new namespace and
so avoid the clashes... but basically the problem is you
are trying to do something the API was never designed
to cater to.

If you want to discuss possible enhancements, then
the Biopython-dev mailing list might be more relevant.

Regards,

Peter



More information about the BioSQL-l mailing list