[Bio] / Sprout / NewStuffCheck.pl Repository:
ViewVC logotype

Diff of /Sprout/NewStuffCheck.pl

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

revision 1.6, Thu Aug 24 17:30:38 2006 UTC revision 1.7, Thu Aug 24 17:56:21 2006 UTC
# Line 80  Line 80 
80      my $newSprout = SFXlate->new_sprout_only();      my $newSprout = SFXlate->new_sprout_only();
81      # Get its genomes in alphabetical order.      # Get its genomes in alphabetical order.
82      my @newGenomes = GetGenes($newSprout);      my @newGenomes = GetGenes($newSprout);
83      # Compare the two gene lists.      # Compare the two genomes lists.
84      my ($insertedGenomes, $deletedGenomes) = Tracer::CompareLists(\@newGenomes, \@oldGenomes);      my ($insertedGenomes, $deletedGenomes) = Tracer::CompareLists(\@newGenomes, \@oldGenomes);
85        # Add feature counts to the new genomes.
86        for my $insertedGenome (@{$insertedGenomes}) {
87            my $genomeID = $insertedGenome->[0];
88            # For a new genome, display the feature count.
89            my $count = $newSprout->GetCount(['HasFeature'], "HasFeature(from-link) = ?",
90                                             [$genomeID]);
91            my $suffix = ($count == 1 ? " one feature" : "$count features");
92            $insertedGenome->[1] .= "($suffix)";
93        }
94      # Display the lists.      # Display the lists.
95      ShowLists(! $options->{summary},      ShowLists(! $options->{summary},
96                'New Genomes'     => $insertedGenomes,                'New Genomes'     => $insertedGenomes,
# Line 103  Line 112 
112          # Get the ID and name.          # Get the ID and name.
113          my ($genomeID, $genomeName) = @{$genome};          my ($genomeID, $genomeName) = @{$genome};
114          Trace("Processing $genomeID.") if T(3);          Trace("Processing $genomeID.") if T(3);
115          if ($skipGenes{$genomeID}) {          # Only process the common genes.
116              # For a new          if (! $skipGenes{$genomeID}) {
         } else {  
117              # Get the new and old features. This will be very stressful to the machine,              # Get the new and old features. This will be very stressful to the machine,
118              # because there are lots of features.              # because there are lots of features.
119              my @oldFeatures = GetFeatures($oldSprout, $genomeID);              my @oldFeatures = GetFeatures($oldSprout, $genomeID);
# Line 272  Line 280 
280          my $listSize = scalar @{$list};          my $listSize = scalar @{$list};
281          # Only proceed if the list is nonempty.          # Only proceed if the list is nonempty.
282          if ($listSize > 0) {          if ($listSize > 0) {
283              my $header;              my $header = ShowHeader($listName, $listSize);
             if ($listSize == 1) {  
                 $header = "*** $listName: one entry";  
             } else {  
                 $header = "*** $listName: $listSize entries";  
             }  
284              print "$header\n";              print "$header\n";
285              Trace($header) if T(3);              Trace($header) if T(3);
286              # If we're at trace level 3, display the list.              # If we're at trace level 3, display the list.
# Line 300  Line 303 
303      }      }
304  }  }
305    
306    =head3 ShowHeader
307    
308    C<< my $header = ShowHeader($name, $count); >>
309    
310    Return a list header for a list of the specified length.
311    
312    =over 4
313    
314    =item name
315    
316    Name of the list.
317    
318    =item count
319    
320    Number of entries in the list.
321    
322    =item RETURN
323    
324    Returns a list header that shows the name of the list and the number of entries.
325    
326    =back
327    
328    =cut
329    
330    sub ShowHeader {
331        # Get the parameters.
332        my ($name, $count) = @_;
333        # Declare the return variable.
334        my $retVal;
335        if ($count == 0) {
336            $retVal = "*** $name: none";
337        } elsif ($count == 1) {
338            $retVal = "*** $name: one";
339        } else {
340            $retVal = "*** $name: $count";
341        }
342        # Return the result.
343        return $retVal;
344    }
345    
346  1;  1;

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3