FW: [MOBY] [MOBY-l] Output of a service
Catherine Letondal
letondal at pasteur.fr
Sat Mar 20 16:28:35 UTC 2004
Vijay Narayanasamy wrote:
>
Thanks for forwarding Marks' answer!
>
> -----Original Message-----
> From: Mark Wilkinson [mailto:markw at illuminae.com]
> Sent: Friday, March 19, 2004 11:12 AM
> To: Catherine Letondal
> Cc: mobyl
> Subject: Re: [MOBY] [MOBY-l] Output of a service
>
> Hi Catherine!
>
> Congratulations on your first service :-)
>
> A few comments, and answers to your questions:
>
>
> > serviceType => "Analysis",
>
> please feel free to register a more descriptive service type that
> inherits from "Analysis" - e.g. melting_point_determination ISA Analysis
>
> ... though if we were to do it right, it should probably have a bit more
> granularity than that... something like:
>
> Nucleotide_Sequence_Analysis
> DNA_Sequence_Analysis
> Physical ( Structural... Chemical... Functional...)
> Melting_Point
>
We prefer to do it right. Are there already some sub-classes planned for
analysis services? I know people working on ontologies of bioinformatics
tools, they have probably some good ideas?
So, we have to register new service types, anyway.
I guess I have tu use registerServiceType in MOBY::Client::Central?
what is the Relationships like in:
$c->registerServiceType (
serviceType => $serviceType
description => "human readable description"
Relationships => {$relationshipType1 => \@services,
$relationshipType2 => \@services}
contactEmail => "your at email.address.here"
authURI => "your.authority.info"
);
?
>
> > my @simples = MobyXmlObject->getMobySimples($query);
>
> I see you are using Ken's code to get the Simples. This is fine, but I
> don't think his code has been updated with the recent API changes that
> require the inputs to be enumerated. Ken? Also, Ken, perhaps you could
> migrate these routines into the CommonSubs.pm module (or simply add your
> module in the CVS) to make it easier for all of us to keep the code
> up-to-date with API changes.
>
> Catherine - you wont *break* anything by being non-compliant in this
> way, since these API changes were all backward-compatible, however you
> wont be 100% compliant... which is a shame for your first service :-)
Again, I really wish to start with the right code, but are there some
examples I can copy?
>
> > <text-plain namespace='' id=''>
> > <![CDATA[$textresult]]>
> > </text-plain>
>
> You should probably register an object that inherits from text-formatted
> (rather than text-plain) and give it the name of your analysis program
> e.g. as we have done with NCBI_Blast_Text and NCBI_Blast_XML.
Ok.
>
>
> > $MOBY_RESPONSE .= simpleResponse($result, '');
>
> simpleResponse now takes three arguments, the third one being the
> enumerated identity of the query to which you are responding (see
> above). Again, you wont *break* anything by doing it this way, but...
What is the second argument? Do you have an example?
> > return responseHeader . $MOBY_RESPONSE . responseFooter;
>
> responseHeader also takes arguments. At a minimum, it takes your
> authority, but it can also be used to provide serviceNotes.
>
> responseHeader('bioweb.pasteur.fr');
>
> or
>
> responseHeader(
> -authority => 'bioweb.pasteur.fr',
> -note => 'software version xxx');
>
> something like that...
Ok.
>
> > The "debug" step worked ok. Now, it is the ->execute() that returns...
> nothing.
>
> Unfortunately, I don't see your service in the registry, so you must
> have it in some private registry? If I could see it, I could help you
> debug it...
We used the register, execute, deregister script (and we first make
some tries on an internal host), but we will quickly turn to bioweb.pasteur.fr.
>
> > the XML description associated to an object is.
>
> Ken has this tool in his "encyclopedia":
>
> http://plantsp.sdsc.edu/cgi-bin/MOBY/MOBY_display_object_xml.cgi?obj=PutYourObjectHere
Very convenient!! But when calling:
http://plantsp.sdsc.edu/cgi-bin/MOBY/MOBY_display_object_xml.cgi?text-plain
or:
http://plantsp.sdsc.edu/cgi-bin/MOBY/MOBY_display_object_xml.cgi?NucleotideSequence
I just get:
<Object namespace='' id='' articleName=''>
</Object>
?
>
> > 1) Do we have to register a sub-class of text-plain or is it possible de
> use the
> > text-plain object type?
>
> You can output text-plain if you wish, but it is better "semantically"
> to create a specific object type for a specific data type, as this will
> help people to e.g. create parsers for your output (parsing "plain-text"
> would be meaningless... ;-) )
Ok.
>
> > 2) If we have to register a new object type :
> > - a) What kind of namespace would you use for such a new object type
> then?
>
> you don't register namespaces together with objects - the two things are
> independent. What you would do is to take the namespace/id from the
> incoming request object and use that as the namespace/id of your
> outgoing plain-text (or whatever) object. The way to think of MOBY
> Analysis services is that they take incoming data and output a different
> representation of the same data, hence the output has the same
> namespace/ID as the input (in most cases...)
Ok. So the sequence been passed to the service *must* have an id?
>
>
> > 3) Once you know what type of object you have to return, how do you
> provide it
> > as a return value of your service? In raw XML?
>
> Your service code is ~perfect as far as I can see, so I am not sure why
> you are not getting any output from it... Your interpretation of the
> spec seems to be 100% correct!
>
> yes, when using the simpleResponse subroutine you do exactly as you say
> - you give it raw XML, and it will build the response for you.
>
> > I hope these are not too much FAQ, thanks in advance,
>
> I'm sorry that I wasn't able to solve your exact problem... if you
> register your service in the public registry I will play with it today
> and we should have it fixed up right away!
>
I have an additional question. When calling a service asking for several
parameters, you put them in different articles, right?
>From the perldoc:
$Service->execute(XMLinputlist => [
['sequence', '<Object namespace="blah" id="123"/>'
],
['anotherparam', '<Object namespace="blah" id="234"/>'
]
]);
Object1 and Object1 could be 2 parameters to the service?
Or:
my $result = $S->execute(
XMLinputlist => [
['sequence', qq{<moby:NucleotideSequence namespace='' id=''>
<moby:Integer namespace='' id='' articleName='Length'>19</moby:Integer>
<moby:String namespace='' id='' articleName='SequenceString'>acggtagctaggtaccc
at</moby:String>
</moby:NucleotideSequence>}],
['anotherparam', qq{<moby:Integer namespace='' id='' articleName='AnotherParam'>4</moby:Integer>}]
]
) ;
Thanks a lot for your advices.
--
Catherine Letondal -- Pasteur Institute Computing Center
More information about the moby-l
mailing list