[MOBY-l] Output of a service

Catherine Letondal letondal at pasteur.fr
Fri Mar 19 16:30:15 UTC 2004


Hi,

We have successfully done the demo (test_sequencetofasta) service and we have 
started to setup a first service 
(see http://bioweb.pasteur.fr/seqanal/interfaces/melting.html):

  my $reg = $C->registerService(
    serviceName  => 'Melting',
    authURI      => $authURI,
    contactEmail => $email,
    description  => "Melting: enthalpie, entropy and melting temperature (N. Le Novere)",
    URL          => $url,
    input        => [ ['', ["NucleotideSequence" => []]], ],
    output       => [ ['', ["text-plain" => []]], ],
    category     => "moby",
    serviceType  => "Analysis",
  );


We have troubles finding how to return the result.

The current code is:


sub Melting {
  my ($caller, $query) = @_;
  ### return $query; # echo back the input
  my $MOBY_RESPONSE = '';
  my @simples = MobyXmlObject->getMobySimples($query);
  foreach my $s (@simples) {
    my ($name, $ns, $id) = ($s->articleName(), $s->namespace(), $s->id());
    my $seq = '';
    my $len = '';
    foreach my $inc ($s->getIncludedObjects()) {
      $seq = $inc->valueTrimmed() if $inc->articleName() eq 'SequenceString';
      $len = $inc->valueTrimmed() if $inc->articleName() eq 'Length';
    }
    if ($seq) {
      #my $fasta = ">$id $ns length=$len\n" . &sixty_bustup($seq);
      open (MELTING, ****--smt that provde a text output--****) ;  
      my textresult = join("",<MELTING>);
      close (MELTING);
      $result = qq{
        <text-plain namespace='' id=''>
            <![CDATA[$textresult]]>
            </text-plain>
        };

    }
    else {
      $result = simpleResponse('', '');
    }
    $MOBY_RESPONSE .= simpleResponse($result, '');
  }
  return responseHeader . $MOBY_RESPONSE . responseFooter;
}


The "debug" step worked ok. Now, it is the ->execute() that returns... nothing.

We have looked at many sources of information on the biomoby.org Web site
and elsewhere:
	http://biomoby.org/SettingUpPerlServices.html
	http://biomoby.org/moby-live/Perl/scripts/Services/LocalServices.pm
	http://biomoby.org/moby-live/Perl/scripts/testMOBYCentral_v05.pl
as well as the papers, and the tutorials, but we haven't found yet where 
the XML description associated to an object is.
Our service returns a text-plain object (the output of a program).

I would have several questions:
1) Do we have to register a sub-class of text-plain or is it possible de use the 
text-plain object type? 
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? 
	- b) What kind of id also? (is there an id for an analysis?)

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?

I hope these are not too much FAQ, thanks in advance,

-- 
Catherine Letondal -- Pasteur Institute Computing Center



More information about the moby-l mailing list