[BioPython] BioSQL.DBSeqRecord._get_keywords() / working with BioSQL

Brad Chapman chapmanb@arches.uga.edu
Tue, 28 May 2002 09:25:02 -0400


Hi Andreas;

> BioSQL.DBSeqRecord._get_keywords() is not working, because table 
> bioentry_keywords is not anymore.
> What was the supposed result of this function?

Yes, this is a leftover remnant from the first incarnation of the BioSQL
stuff. Right now the only things which "should work" is the information
which is stored in a Bio.SeqRecord object. Biopython unfortunately
doesn't currently have any standard way to store more complicated things
in BioSQL, like keywords and taxonomy stuff.

So, right now this is left alone and won't work.

> How can this be expressed with the new Ontology-based approach?

In terms of the SQL, most of the stuff you need is already in place. The
function _get_ontology_terms in BioSQL.BioSeq basically just needs to be
called with "keywords", similar to how it is used for _get_description
function.

The problem is that since the information is not currently loaded from
Biopython (due to the problems I listed above), so there really isn't
any keywords info to retrieve yet.

This is something that needs work.

> Second: Are there any tutorials about working with BioSQL?
> For example, how can I get a SeqRecord from the BioSQL.BioSeq?

Sadly, no. I think writing documentation is very important, but I
haven't had time to do it yet.

I'm not sure if I totally understand your question, but to get a
SeqRecord-like object (that implements the SeqRecord interface, but uses
the underlying database to get the information), you just need to do:

the_seq_record = db.lookup(accession = "X62281")

You can also retrieve by primary_id (ie. GI numbers) and display_id (ie.
the LOCUS name). 

The tests in Tests/test_BioSQL.py might be a good place to get an idea
of what is possible (and what works :-) with BioSQL.

I'm also happy to answer any questions here. Hope this helps.
Brad
-- 
PGP public key available from http://pgp.mit.edu/