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

Diff of /Sprout/SearchHelper.pm

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

revision 1.35, Mon Jul 16 20:53:11 2007 UTC revision 1.36, Wed Jul 25 16:21:21 2007 UTC
# Line 789  Line 789 
789      my $cache = $self->{orgs};      my $cache = $self->{orgs};
790      if (exists $cache->{$genomeID}) {      if (exists $cache->{$genomeID}) {
791          ($orgName, $group, $domain) = @{$cache->{$genomeID}};          ($orgName, $group, $domain) = @{$cache->{$genomeID}};
792            Trace("Cached organism $genomeID has group \"$group\".") if T(4);
793      } else {      } else {
794          # Here we have to use the database.          # Here we have to use the database.
795          my $sprout = $self->DB();          my $sprout = $self->DB();
796          my ($genus, $species, $strain, $group, $taxonomy) = $sprout->GetEntityValues('Genome', $genomeID,          my ($genus, $species, $strain, $newGroup, $taxonomy) = $sprout->GetEntityValues('Genome', $genomeID,
797                                                                  ['Genome(genus)', 'Genome(species)',                                                                  ['Genome(genus)', 'Genome(species)',
798                                                                   'Genome(unique-characterization)',                                                                   'Genome(unique-characterization)',
799                                                                   'Genome(primary-group)',                                                                   'Genome(primary-group)',
800                                                                   'Genome(taxonomy)']);                                                                   'Genome(taxonomy)']);
801          # Format and cache the name and display group.          # Format and cache the name and display group.
802          ($orgName, $group, $domain) = $self->SaveOrganismData($group, $genomeID, $genus, $species,          Trace("Caching organism $genomeID with group \"$newGroup\".") if T(4);
803            ($orgName, $group, $domain) = $self->SaveOrganismData($newGroup, $genomeID, $genus, $species,
804                                                                $strain, $taxonomy);                                                                $strain, $taxonomy);
805            Trace("Returning group $group.") if T(4);
806      }      }
807      # Return the result.      # Return the result.
808      return ($orgName, $group, $domain);      return ($orgName, $group, $domain);
# Line 2180  Line 2183 
2183    
2184  =head3 SaveOrganismData  =head3 SaveOrganismData
2185    
2186  C<< my ($name, $displayGroup) = $shelp->SaveOrganismData($group, $genomeID, $genus, $species, $strain, $taxonomy); >>  C<< my ($name, $displayGroup, $domain) = $shelp->SaveOrganismData($group, $genomeID, $genus, $species, $strain, $taxonomy); >>
2187    
2188  Format the name of an organism and the display version of its group name. The incoming  Format the name of an organism and the display version of its group name. The incoming
2189  data should be the relevant fields from the B<Genome> record in the database. The  data should be the relevant fields from the B<Genome> record in the database. The
# Line 2241  Line 2244 
2244          # Compute the display group. This is currently the same as the incoming group          # Compute the display group. This is currently the same as the incoming group
2245          # name unless it's the supporting group, which is nulled out.          # name unless it's the supporting group, which is nulled out.
2246          $displayGroup = ($group eq $FIG_Config::otherGroup ? "" : $group);          $displayGroup = ($group eq $FIG_Config::otherGroup ? "" : $group);
2247            Trace("Group = $displayGroup, translated from \"$group\".") if T(4);
2248      }      }
2249      # Compute the domain from the taxonomy.      # Compute the domain from the taxonomy.
2250      my ($domain) = split /\s*;\s*/, $taxonomy, 2;      my ($domain) = split /\s*;\s*/, $taxonomy, 2;

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.36

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3