[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Mon Jul 14 15:52:14 UTC 2003


mwilkinson
Mon Jul 14 11:52:14 EDT 2003
Update of /home/repository/moby/moby-live/Perl/MOBY
In directory pub.open-bio.org:/tmp/cvs-serv763/MOBY

Modified Files:
	CommonSubs.html CommonSubs.pm 
Log Message:
found documentation errors

moby-live/Perl/MOBY CommonSubs.html,1.1,1.2 CommonSubs.pm,1.2,1.3
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.html	2003/07/13 20:09:32	1.1
+++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.html	2003/07/14 15:52:14	1.2
@@ -18,6 +18,7 @@
 	<li><a href="#synopsis">SYNOPSIS</a></li>
 	<li><a href="#description">DESCRIPTION</a></li>
 	<li><a href="#authors">AUTHORS</a></li>
+	<li><a href="#methods">METHODS</a></li>
 	<ul>
 
 		<li><a href="#getsimplearticleids">getSimpleArticleIDs</a></li>
@@ -25,7 +26,7 @@
 		<li><a href="#simpleresponse">simpleResponse</a></li>
 		<li><a href="#responseheader">responseHeader</a></li>
 		<li><a href="#responsefooter">responseFooter</a></li>
-		<li><a href="#getsimplearticleobjects">getSimpleArticleObjects</a></li>
+		<li><a href="#getinputarticles">getInputArticles</a></li>
 		<li><a href="#getnodecontentwitharticle">getNodeContentWithArticle</a></li>
 	</ul>
 
@@ -43,9 +44,10 @@
 </p>
 <hr />
 <h1><a name="synopsis">SYNOPSIS</a></h1>
-<p>use MOBY::CommonSubs qw(:all);
-my @ids = getSimpleArticleIDs(``NCBI_gi'', \@SimpleArticles);
-my $ns = getSimpleArticleNamespaceURI($SimpleArticle);</p>
+<pre>
+ use MOBY::CommonSubs qw(:all);
+ my @ids = getSimpleArticleIDs(&quot;NCBI_gi&quot;, \@SimpleArticles);
+ my $ns = getSimpleArticleNamespaceURI($SimpleArticle);</pre>
 <p>
 </p>
 <hr />
@@ -62,6 +64,10 @@
 <p>BioMOBY Project:  <a href="http://www.biomoby.org">http://www.biomoby.org</a></p>
 <p>
 </p>
+<hr />
+<h1><a name="methods">METHODS</a></h1>
+<p>
+</p>
 <h2><a name="getsimplearticleids">getSimpleArticleIDs</a></h2>
 <pre>
  name     : getSimpleArticleIDs
@@ -131,7 +137,7 @@
      &lt;/moby:MOBY&gt;</pre>
 <p>
 </p>
-<h2><a name="getsimplearticleobjects">getSimpleArticleObjects</a></h2>
+<h2><a name="getinputarticles">getInputArticles</a></h2>
 <pre>
  name     : getInputArticles
  function : get the Simple/Collection articles for each input query, in order
@@ -174,6 +180,8 @@
  notes    : This was written for the purpose of getting the values of
             String, Integer, Float, Date_Time, and other such primitives.
             For example, in the following XML:
+             ...
+             ...
              &lt;moby:Query&gt;
                 &lt;queryInput&gt;
                     &lt;Simple&gt;
@@ -183,14 +191,21 @@
                       &lt;/Sequence&gt;
                     &lt;/Simple&gt;
                 &lt;/queryInput&gt;
-             &lt;/moby:Query&gt;</pre>
-<pre>
+             &lt;/moby:Query&gt;
+             ...
+             ...
+             
             would be analysed as follows:
-              use XML::DOM;
-              $p = new XML::DOM::Parser;
-              $dom = $p-&gt;parse($XML);
-              @sequence = getNodeContentWithArticle($dom, &quot;String&quot;, &quot;SequenceString&quot;);
-              print &quot;Sequence was $sequence[0]&quot;;</pre>
+              
+              my ($query) = @_;  # get the incoming MOBY query XML
+              my @queries = getInputArticles($query);  # returns DOM nodes
+              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;);
+                     print &quot;Sequence was &quot;.(join &quot;&quot;, @sequence).&quot;\n&quot;; # join all lines of string
+                 }   
+              }</pre>
 
 </body>
 

===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm	2003/07/13 20:10:20	1.2
+++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm	2003/07/14 15:52:14	1.3
@@ -11,9 +11,9 @@
 
 =head1 SYNOPSIS
 
-use MOBY::CommonSubs qw(:all);
-my @ids = getSimpleArticleIDs("NCBI_gi", \@SimpleArticles);
-my $ns = getSimpleArticleNamespaceURI($SimpleArticle);
+ use MOBY::CommonSubs qw(:all);
+ my @ids = getSimpleArticleIDs("NCBI_gi", \@SimpleArticles);
+ my $ns = getSimpleArticleNamespaceURI($SimpleArticle);
 
 
 =head1 DESCRIPTION
@@ -257,7 +257,7 @@
 
 
 
-=head2 getSimpleArticleObjects
+=head2 getInputArticles
 
  name     : getInputArticles
  function : get the Simple/Collection articles for each input query, in order
@@ -329,6 +329,8 @@
  notes    : This was written for the purpose of getting the values of
             String, Integer, Float, Date_Time, and other such primitives.
             For example, in the following XML:
+             ...
+             ...
              <moby:Query>
                 <queryInput>
                     <Simple>
@@ -339,13 +341,20 @@
                     </Simple>
                 </queryInput>
              </moby:Query>
-
+             ...
+             ...
+             
             would be analysed as follows:
-              use XML::DOM;
-              $p = new XML::DOM::Parser;
-              $dom = $p->parse($XML);
-              @sequence = getNodeContentWithArticle($dom, "String", "SequenceString");
-              print "Sequence was $sequence[0]";
+              
+              my ($query) = @_;  # get the incoming MOBY query XML
+              my @queries = getInputArticles($query);  # returns DOM nodes
+              foreach (@queries){
+                 my @inputs = @{$_}; #(may be more than one Simple/Collection input per query)
+                 foreach my $input(@inputs){
+                     @sequence = getNodeContentWithArticle($_, "String", "SequenceString");
+                     print "Sequence was ".(join "", @sequence)."\n"; # join all lines of string
+                 }   
+              }
 
 
 =cut




More information about the MOBY-guts mailing list