[Biojava-l] GetBioentryID() in BioSQLSequence

Mayank Thanawala mthanawala@diadexus.com
Wed, 4 Sep 2002 13:22:58 -0700


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