[Biocorba-l] Persistent IOR for the EMBL Biocorba server (fwd)
Brad Chapman
chapmanb@arches.uga.edu
Thu, 31 May 2001 17:08:38 -0400
--MjZB/X7cf2
Content-Type: text/plain; charset=us-ascii
Content-Description: message body text
Content-Transfer-Encoding: 7bit
[Ewan announces]
> Below is the URL location of a persistent (I believe in a sort of day-long
> persistence manner - alan can feel us in on the details) for the biocorba
> 0.2 IOR of the EMBL server.
Very cool! Thanks to Alan and Ewan for getting this together -- it's
very nice to have this "official" and everything.
> Brad - I'm happy to work with this on biopython as well
I had already done some work on this previously (with the temporary
IOR that Alan had for testing) so I real quick modified it to work off
the new server. Almost everything works great. The only
current issue, which I think was also a problem before, is that
calling sub_SeqFeatures on a SeqFeature object will cause the client
to lock -- as far as I can tell the server never returns. Under UNIX I
need to do the dreaded kill -9 to free my locked client.
Attached is a test script that demonstrates this problem. It uses
python and needs a python ORB to work, but doesn't require all of
biopython-corba. If you don't have/don't want to install python, I'm
sure it wouldn't be too hard to cook up the same example in perl or
java or (fill in your favorite language here).
Thanks again for the stable server -- looking forward to abusing, I
mean using, it :-).
Brad
--MjZB/X7cf2
Content-Type: text/plain
Content-Description: Demo client
Content-Disposition: inline;
filename="simple_embl.py"
Content-Transfer-Encoding: 7bit
#!/usr/bin/env python
"""A Simple EMBL client that demonstrates getting info from EMBL.
This client does not use any of the advanced features of biopython-corba.
"""
# -- imports
# standard modules
import urllib
import sys
# omniORB
try:
from omniORB import CORBA
except ImportError:
raise SystemExit("Problem importing the ORB. " +
"You need to have a python ORB implementation installed.")
# import the stubs
try:
import org.biocorba.seqcore
except ImportError:
raise SystemExit("Problem importing the CORBA Stubs. " +
"You need to compile the IDL files first.")
# -- constants
IOR_URL = "http://corba.ebi.ac.uk/IOR/EmblBiocorba_v0_2.IOR"
EMBL_NAME = "EMBL"
ACC_NUM = 'X55053'
# -- start the code
# retrieve the IOR of the CORBA server
print "Getting the IOR for the EMBL server..."
ior_handle = urllib.urlopen(IOR_URL)
embl_ior = ior_handle.read()
ior_handle.close()
print "Getting the EMBL database."
orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID)
embl_bioenv = orb.string_to_object(embl_ior)
embl_database = embl_bioenv.get_SeqDB_by_name(EMBL_NAME, 0)
print "Retrieving the entry: %s" % ACC_NUM
test_seq = embl_database.get_Seq(ACC_NUM, 0)
features_vector = test_seq.all_SeqFeatures(1)
features_iterator = features_vector.iterator()
test_feature = features_iterator.next()
print "Got feature that spans from %s to %s" % (test_feature.start(),
test_feature.end())
print "Locks up on this."
sub_features = test_feature.sub_SeqFeatures(1)
--MjZB/X7cf2--