FW: [MOBY-dev] gbrowse_moby and bioMoby Python webservices

Yan Wong ywong at infobiogen.fr
Mon Dec 13 09:43:46 UTC 2004


You should have:

-Output query name should be the same as Input query name:
 (Input : I have 'query1' as name for the query and I get '9054'?)

-You seems to send a collection of identifiers, so you should return a 
collection of objects. With the Python API, just put your set of objects 
in a tuple:

('collectionName' , [object1, object2, object3, etc..])

the mobyContent will serialize the collection into this:

<moby:collection moby:articleName='collectionName'>
  <moby:simple>
     <moby:object ...
  <...
</moby:collection>

-you return an object with namespace=WatDB inside the content. maybe is 
it better to put it in a cross reference:
o=MobyObject(namespace='PO_acc', id='118')
o._cross=[MobyObject(namespace='WatDB', id='118'] ( don' forget the [] 
because it is a set of objects)

or use the MobyXref object to build a Xref object (defined in the Moby-s 
v0.8 API)
from bioMoby import MobyXref

xref=MobyXref("EMBL","X1112345", "www.illuminae.com","getEMBLRecord", 
"IEA", transform")
see help(MobyXref) for details.

or you want to return an object with WatDB namespace and id:

o=MobyObject(namespace='WatDB', id='118')

In all case, you must register WatDB as a namespace in the bioMoby 
directory:

 >>> from bioMoby import Namespace
 >>> watdb=Namespace(namespaceType="WatDB", 
contact="contact at host.domain", authURI="host.domain", description=" a 
small description of this object")

If you want to register on another central than bioMoby:
 >>> from bioMoby import Central
 >>> newCentral=Central(url="URL_of_another_bioMoby_directory", 
ns="http://another_namespace")
(see help(Central) for the other instanciation parameters)

 >>> watdb.central=newCentral

and then register your new object:
 >>> result=watdb.register()

and see if it is successful:
 >>> print result

Adamse, Paulien wrote:

>-----Original Message-----
>From: Adamse, Paulien 
>Sent: vrijdag 10 december 2004 16:14
>To: 'Core developer announcements'
>Subject: RE: [MOBY-dev] gbrowse_moby and bioMoby Python webservices
>
>Now the Python API has been fixed I get some results with my service.
>Great! But the output is not what it should be. Anybody got an idea what
>is wrong with it? At the moment the "content" also contains the result,
>but it should be visible for Namespace and Id as well.
>
>The function is called getWAtDBIdByPOAcc
>The function can be called with namespace PO_acc    id 9054
>
>I could realy use some feedback.
>
>Thanks in advance
>(and have a nice weekend...)
>
>
>Paulien Adamse
>
>-----Original Message-----
>From: moby-dev-bounces at portal.open-bio.org
>[mailto:moby-dev-bounces at portal.open-bio.org] On Behalf Of Fiers, Mark
>Sent: vrijdag 10 december 2004 15:29
>To: Core developer announcements
>Subject: Re: [MOBY-dev] gbrowse_moby and bioMoby Python webservices
>
>Thank you very much!!!!!
>
>It almost works. I had to make one small change (after some searching);
>The Body class you've written is identified by a getattr in the module
>in question. This does not work since the <body> tag send by
>gbrowse_moby is in lowercase. I've worked aroud this by changing 'class
>Body:' to 'class body:'.  (is it possible to define __getattr__() on
>module level??? That would be a nice way to circumvent this problem)
>
>Concerning Mark's question if gbrowse_moby sends incorrectly formatted
>messages? The <body> tag is as far as I understand not a valid soap tag
>and apparantly also not part of bioMoby XML. So, I would say that it is
>still open for discussion, I'm not an expert on the subject.
>
>Cheers
>Mark
>
>
>
>
>Yan Wong wrote:
>
>  
>
>>I've solved the problem and posted corrections to the CVS.
>>
>>See changelog for listed modifications.
>>
>>Here are the following steps to do to update your bioMoby Python 
>>server API:
>>
>>In your bioMoby python package directory:
>>
>>-First update your ZSI library with the ZSI library provided by this
>>package:
>>cd packages
>>tar jxvf ZSI-1.5.0-patched-2
>>cd ZSI-1.5.0-patched-2
>>python setup.py install (with your fancy options if you have)
>>
>>-Update your bioMoby Python library
>>python setup.py install  (with options)
>>
>>-Update your scripts by applying the rules:
>>however, you'll have to change some things in your script:
>>
>>BEFORE:
>>
>>from ZSI import dispatch
>>dispatch.AsCGI()
>>
>>NOW:
>>
>>from ZSI import dispatch
>>from bioMoby.webservice import TCBioMoby
>>
>>dispatch.AsCGI(typesmodule=TCBioMoby)
>>
>>or with mod_python:
>>
>>dispatch.AsHandler(modules=myModule,), request=req,
>>typesmodule=TCBioMoby)
>>
>>TCBioMoby contains a class that serialize/deserialize the content 
>>inside the tag Body  into a MobyContent Object.
>>
>>This will allow a Python webservice to deal with gbrowse_moby.
>>
>>
>>_______________________________________________
>>MOBY-dev mailing list
>>MOBY-dev at biomoby.org
>>http://www.biomoby.org/mailman/listinfo/moby-dev
>>
>>    
>>
>
>_______________________________________________
>MOBY-dev mailing list
>MOBY-dev at biomoby.org
>http://www.biomoby.org/mailman/listinfo/moby-dev
>
>
>
>_______________________________________________
>MOBY-dev mailing list
>MOBY-dev at biomoby.org
>http://www.biomoby.org/mailman/listinfo/moby-dev
>
>  
>





More information about the MOBY-dev mailing list