[Biojava-l] GetBioentryID() in BioSQLSequence

Matthew Pocock matthew_pocock@yahoo.co.uk
Thu, 05 Sep 2002 10:22:53 +0100


Hi Mayank,

The bioentry id is not exposed in the api. This is because we were 
thinking of the id as being analogus to a pointer. I've modified 
BioSQLSequenceAnnotation so that it will always have a property called 
"bioentry_id" with the value bein an Integer object equal to the id. 
I've checked this into cvs. So, to get the id you do something like:

   BioSQLSequenceDB seqDB = getBioSQLHandler();
   Sequence seq = seqDB.getSequence(...);
   Integer id = (Integer) seq.getAnnotation().getProperty("bioentry_id");

Does this do what you want?

Matthew

Mayank Thanawala wrote:
> Hi,
> 
> I'm hoping this is a less stupid question than it seems like, but after
> checking out the archives and the docs, I still have to ask -- I
> appreciate any and all assistance!
> 
> I am trying to get the bioentryID of a sequence I have stored in a
> database that follows the BioSQL schema.  BioSQLSequence, which is what
> gets returned from BioSQLSequenceDB.getSequence(...).  But
> BioSQLSequence is protected, which means I can't instantiate a
> BioSQLSequence from the outside -- i.e., I cannot say
> 
>   BioSQLSequenceDB seqDB = getBioSQLHandler();
>   BioSQLSequence seq = seqDB.getSequence(...);
> 
> I must instead say
> 
>   BioSQLSequenceDB seqDB = getBioSQLHandler();
>   Sequence seq = seqDB.getSequence(...);
> 
> and now, seq.getBioentryID() doesn't make sense because seq is compiled
> as a general Sequence, not a specific BioSQLSequence.
> 
> I also cannot say 
> 
>   BioSQLSequenceDB seqDB = getBioSQLHandler();
>   BioSQLSequenceI seq = seqDB.getSequence(...);
> 
> because the interface BioSQLSequenceI is also protected.
> 
> So, short of writing some SQL to query based on the accession and take
> the best guess, how do I go about getting the bioentryID of a sequence?
> 
> Thank you!
> Mayank
> _______________________________________________
> Biojava-l mailing list  -  Biojava-l@biojava.org
> http://biojava.org/mailman/listinfo/biojava-l
> 


-- 
BioJava Consulting LTD - Support and training for BioJava
http://www.biojava.co.uk

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com