[Bio] / Sprout / Sprout.pm Repository:
ViewVC logotype

Diff of /Sprout/Sprout.pm

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

revision 1.63, Sun Jun 18 07:03:00 2006 UTC revision 1.70, Fri Jun 23 19:08:58 2006 UTC
# Line 375  Line 375 
375      # Get the genomes.      # Get the genomes.
376      my @genomes = $self->GetAll(['Genome'], $filterString, $params, ['Genome(id)',      my @genomes = $self->GetAll(['Genome'], $filterString, $params, ['Genome(id)',
377                                                                       'Genome(genus)',                                                                       'Genome(genus)',
378                                                                       'Genome(species)']);                                                                       'Genome(species)',
379                                                                         'Genome(unique-characterization)']);
380      # Sort them by name.      # Sort them by name.
381      my @sorted = sort { lc("$a->[1] $a->[2]") cmp lc("$b->[1] $b->[2]") } @genomes;      my @sorted = sort { lc("$a->[1] $a->[2]") cmp lc("$b->[1] $b->[2]") } @genomes;
382      # Loop through the genomes, creating the option tags.      # Loop through the genomes, creating the option tags.
383      for my $genomeData (@sorted) {      for my $genomeData (@sorted) {
384          # Get the data for this genome.          # Get the data for this genome.
385          my ($genomeID, $genus, $species) = @{$genomeData};          my ($genomeID, $genus, $species, $strain) = @{$genomeData};
386          # Get the contig count.          # Get the contig count.
387          my $count = $self->ContigCount($genomeID);          my $count = $self->ContigCount($genomeID);
388          my $counting = ($count == 1 ? "contig" : "contigs");          my $counting = ($count == 1 ? "contig" : "contigs");
389          # Build the option tag.          # Build the option tag.
390          $retVal .= "<option value=\"$genomeID\">$genus $species ($genomeID) [$count $counting]</option>\n";          $retVal .= "<option value=\"$genomeID\">$genus $species $strain ($genomeID) [$count $counting]</option>\n";
391            Trace("Option tag built for $genomeID: $genus $species $strain.") if T(3);
392      }      }
393      # Close the SELECT tag.      # Close the SELECT tag.
394      $retVal .= "</select>\n";      $retVal .= "</select>\n";
# Line 836  Line 838 
838    
839  =over 4  =over 4
840    
841  =genomeID  =item genomeID
842    
843  ID of the genome whose feature count is desired.  ID of the genome whose feature count is desired.
844    
# Line 857  Line 859 
859      my ($self, $genomeID, $type) = @_;      my ($self, $genomeID, $type) = @_;
860      # Compute the count.      # Compute the count.
861      my $retVal = $self->GetCount(['HasFeature', 'Feature'],      my $retVal = $self->GetCount(['HasFeature', 'Feature'],
862                                  "HasFeature(from-link) = ? AND Feature(type) = ?",                                  "HasFeature(from-link) = ? AND Feature(feature-type) = ?",
863                                  [$genomeID, $type]);                                  [$genomeID, $type]);
864      # Return the result.      # Return the result.
865      return $retVal;      return $retVal;
# Line 899  Line 901 
901      # Loop through the annotations.      # Loop through the annotations.
902      while (my $data = $query->Fetch) {      while (my $data = $query->Fetch) {
903          # Get the feature ID and annotation text.          # Get the feature ID and annotation text.
904          my ($fid, $annotation) = $data->Values(['HasFeature(from-link)',          my ($fid, $annotation) = $data->Values(['HasFeature(to-link)',
905                                                  'Annotation(text)']);                                                  'Annotation(annotation)']);
906          # Check to see if this is an assignment. Note that the user really          # Check to see if this is an assignment. Note that the user really
907          # doesn't matter to us, other than we use it to determine whether or          # doesn't matter to us, other than we use it to determine whether or
908          # not this is an assignment.          # not this is an assignment.
909          my ($user, $assignment) = $self->_ParseAssignment('fig', $annotation);          my ($user, $assignment) = _ParseAssignment('fig', $annotation);
910          if ($user) {          if ($user) {
911              # Here it's an assignment. We put it in the return hash, overwriting              # Here it's an assignment. We put it in the return hash, overwriting
912              # any older assignment that might be present.              # any older assignment that might be present.

Legend:
Removed from v.1.63  
changed lines
  Added in v.1.70

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3