[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Mon Jul 14 16:00:29 UTC 2003


mwilkinson
Mon Jul 14 12:00:29 EDT 2003
Update of /home/repository/moby/moby-live/Perl/MOBY
In directory pub.open-bio.org:/tmp/cvs-serv887/MOBY

Modified Files:
	CommonSubs.html 
Log Message:
Added an example of a complete MOBY service to act as a template.  THIS HAS NOT YET BEEN TESTED

moby-live/Perl/MOBY CommonSubs.html,1.2,1.3
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.html	2003/07/14 15:52:14	1.2
+++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.html	2003/07/14 16:00:28	1.3
@@ -48,6 +48,25 @@
  use MOBY::CommonSubs qw(:all);
  my @ids = getSimpleArticleIDs("NCBI_gi", \@SimpleArticles);
  my $ns = getSimpleArticleNamespaceURI($SimpleArticle);</pre>
+<p>A COMPLETE EXAMPLE OF A SIMPLE MOBY SERVICE</p>
+<pre>
+ sub myServiceName {
+   my ($caller, $query) = @_;  # get the incoming MOBY query XML
+   my @queries = getInputArticles($query);  # returns DOM nodes
+   my $MOBY_RESPONSE = &quot;&quot;;  # set empty response
+ 
+   foreach (@queries){
+     my @inputs = @{$_}; #(may be more than one Simple/Collection input per query)
+     foreach my $input(@inputs){
+        @sequence = getNodeContentWithArticle($_, &quot;String&quot;, &quot;SequenceString&quot;);
+        my $sequence = join &quot;&quot;, @sequence; # join all lines of string
+        # print STDERR &quot;Analyzing $sequence\n&quot;; 
+        my $result = &amp;_AnalyzeString($sequence);  # do your analysis
+        $MOBY_RESPONSE .= simpleResponse($result, &quot;outputArticlename&quot;);
+     }
+   }
+   return responseHeader . $MOBY_RESPONSE . responseFooter;
+ }</pre>
 <p>
 </p>
 <hr />




More information about the MOBY-guts mailing list