[BioPython] Loading keywords into database

Andreas Kuntzagk andreas.kuntzagk@mdc-berlin.de
Tue, 04 Jun 2002 18:37:21 +0200


Hi,

> This looks right in principle . My only suggestions are that you can 
> save the call to "fetch_seqid_by_display_id" by just making the 
> function look like:
> 
> def _load_bioentry_keyword(self, bioentry_id, keywords)
> 
> Then you can call it from load_seqrecord with:
> 
> keywords = record.annotations.get("keywords", [])
> self._load_bioentry_keywords(bioentry_id, keywords)

You are right. I didn't use the _load_bioentry_keyword from load_seqrecord but 
from a separate script. (The records where already in the database) So i didn't
have the bioentry_id and had to fetch it anyway. Btw: wouldn't be there better 
places for fetch_seqid_by_display_id then the Adaptor class?

> This is all just semantics, but you are spot on with your use of the
> ontology stuff (based on my limited knowledge, of course :-).

>>I also noticed that the Loader could be more robust. It chokes if an entry 
>>is already in the Database. Not good, if i bulk-load from a file, it crashes 
>>somehow in the middle and i want to start again.
> 
> 
> Yup, it pretty much assumes you are loading a new record in. I know this
> isn't very good and it could definitely use a lot of work to make it
> robust. The stuff that's there is pretty basic.

Maybe i will try to work on this.

> The dev list is the best place to send code (and probably to talk about
> more code-specific things like this). I'm happy to check in diffs that
> you send me on BioSQL (especially those with corresponding tests :-).

Ok, the next development-questions go to the devel list.

> Jeff doles out CVS write accounts, so the other option is to beg him for
> one of those :-).

Maybe i wait till i really understand the internals of biopython.

Thanx, Andreas