[Bio] / FigKernelPackages / ServerThing.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/ServerThing.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.54, Tue Jul 13 18:49:09 2010 UTC revision 1.56, Thu Oct 14 17:28:49 2010 UTC
# Line 305  Line 305 
305      }      }
306  }  }
307    
308    =head3 ReadCountVector
309    
310        my $vector = ServerThing::ReadCountVector($qh, $field, $rawFlag);
311    
312    Extract a count vector from a query. The query can contain zero or more results,
313    and the vectors in the specified result field of the query must be concatenated
314    together in order. This method is optimized for the case (expected to be most
315    common) where there is only one result.
316    
317    =over 4
318    
319    =item qh
320    
321    Handle for the query from which results are to be extracted.
322    
323    =item field
324    
325    Name of the field containing the count vectors.
326    
327    =item rawFlag
328    
329    TRUE if the vector is to be returned as a raw string, FALSE if it is to be returned
330    as reference to a list of numbers.
331    
332    =item RETURN
333    
334    Returns the desired vector, either encoded as a string or as a reference to a list
335    of numbers.
336    
337    =back
338    
339    =cut
340    
341    sub ReadCountVector {
342        # Get the parameters.
343        my ($qh, $field, $rawFlag) = @_;
344        # Declare the return variable.
345        my $retVal;
346        # Loop through the query results.
347        while (my $resultRow = $qh->Fetch()) {
348            # Get this vector.
349            my ($levelVector) = $resultRow->Value($field, $rawFlag);
350            # Is this the first result?
351            if (! defined $retVal) {
352                # Yes. Assign the result directly.
353                $retVal = $levelVector;
354            } elsif ($rawFlag) {
355                # This is a second result and the vectors are coded as strings.
356                $retVal .= $levelVector;
357            } else {
358                # This is a second result and the vectors are coded as array references.
359                push @$retVal, @$levelVector;
360            }
361        }
362        # Return the result.
363        return $retVal;
364    }
365    
366    
367  =head2 Gene Correspondence File Methods  =head2 Gene Correspondence File Methods
368    
# Line 679  Line 737 
737  Returns TRUE if the first genome would be stored on the server as a target, FALSE if  Returns TRUE if the first genome would be stored on the server as a target, FALSE if
738  it would be stored as a source.  it would be stored as a source.
739    
740    =back
741    
742  =cut  =cut
743    
744  sub MustFlipGenomeIDs {  sub MustFlipGenomeIDs {

Legend:
Removed from v.1.54  
changed lines
  Added in v.1.56

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3