[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.69, Fri Jun 23 01:34:42 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      }      }
392      # Close the SELECT tag.      # Close the SELECT tag.
393      $retVal .= "</select>\n";      $retVal .= "</select>\n";
# Line 836  Line 837 
837    
838  =over 4  =over 4
839    
840  =genomeID  =item genomeID
841    
842  ID of the genome whose feature count is desired.  ID of the genome whose feature count is desired.
843    
# Line 857  Line 858 
858      my ($self, $genomeID, $type) = @_;      my ($self, $genomeID, $type) = @_;
859      # Compute the count.      # Compute the count.
860      my $retVal = $self->GetCount(['HasFeature', 'Feature'],      my $retVal = $self->GetCount(['HasFeature', 'Feature'],
861                                  "HasFeature(from-link) = ? AND Feature(type) = ?",                                  "HasFeature(from-link) = ? AND Feature(feature-type) = ?",
862                                  [$genomeID, $type]);                                  [$genomeID, $type]);
863      # Return the result.      # Return the result.
864      return $retVal;      return $retVal;
# Line 899  Line 900 
900      # Loop through the annotations.      # Loop through the annotations.
901      while (my $data = $query->Fetch) {      while (my $data = $query->Fetch) {
902          # Get the feature ID and annotation text.          # Get the feature ID and annotation text.
903          my ($fid, $annotation) = $data->Values(['HasFeature(from-link)',          my ($fid, $annotation) = $data->Values(['HasFeature(to-link)',
904                                                  'Annotation(text)']);                                                  'Annotation(annotation)']);
905          # 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
906          # 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
907          # not this is an assignment.          # not this is an assignment.
908          my ($user, $assignment) = $self->_ParseAssignment('fig', $annotation);          my ($user, $assignment) = _ParseAssignment('fig', $annotation);
909          if ($user) {          if ($user) {
910              # 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
911              # 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.69

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3