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

Diff of /Sprout/SproutSubsys.pm

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

revision 1.14, Tue Apr 29 20:56:39 2008 UTC revision 1.17, Tue Sep 9 00:27:25 2008 UTC
# Line 556  Line 556 
556      return $retVal;      return $retVal;
557  }  }
558    
559    
560    =head3 get_hope_reactions_for_genome
561    
562        my %ss_reactions = $subsys->get_hope_reactions_for_genome($genome);
563    
564    This method returns a hash that maps reactions to the pegs that catalyze
565    them for the specified genome. For each role in the subsystem, the pegs
566    are computed, and these are attached to the reactions for the role.
567    
568    =over 4
569    
570    =item genome
571    
572    ID of the genome whose reactions are to be put into the hash.
573    
574    =item RETURN
575    
576    Returns a hash mapping reactions in the subsystem to pegs in the
577    specified genome, or C<undef> if the genome is not found in the
578    subsystem.
579    
580    =back
581    
582    =cut
583    
584    sub get_hope_reactions_for_genome {
585        my($self, $genome) = @_;
586        my $index = $self->{genome_index}->{$genome};
587        if (defined $index) {
588            my @roles = $self->get_roles;
589            my %hope_reactions = $self->get_hope_reactions;
590    
591            my %ss_reactions;
592    
593            foreach my $role (@roles)
594            {
595                my @peg_list = $self->get_pegs_from_cell($genome,$role);
596    
597                if (defined $hope_reactions{$role} && scalar @peg_list > 0)
598    
599                {
600                    foreach my $reaction (@{$hope_reactions{$role}})
601                    {
602                        push @{$ss_reactions{$reaction}}, @peg_list;
603                    }
604                }
605            }
606    
607            return %ss_reactions;
608        }
609        else {
610            return undef;
611        }
612    }
613    
614    
615    =head3 get_hope_additional_reactions
616    
617        my %ss_reactions = $subsys->get_hope_additional_reactions($scenario_name);
618    
619    Return a list of the additional reactions for the specified scenario.
620    
621    =over 4
622    
623    =item scenario_name
624    
625    Name of the scenario whose additional reactions are desired.
626    
627    =item RETURN
628    
629    Returns a list of the additional reactions attached to the named scenario.
630    
631    =back
632    
633    =cut
634    
635    sub get_hope_additional_reactions
636    {
637        my($self,$scenario_name) = @_;
638        Trace("Hope additional reactions not available in NMPDR.") if T(0);  ##HACK
639        my @retVal;
640        return @retVal;
641    }
642    
643    
644  =head3 get_hope_reactions  =head3 get_hope_reactions
645    
646      my %reactionHash = $subsys->get_hope_reactions();      my %reactionHash = $subsys->get_hope_reactions();
# Line 573  Line 658 
658      my $retVal = $self->{hopeReactions};      my $retVal = $self->{hopeReactions};
659      if (! defined($retVal)) {      if (! defined($retVal)) {
660          # They do not exist, so we must create them.          # They do not exist, so we must create them.
661          $retVal = FIGRules::GetHopeReactions($self, $self->{dir});          $retVal = FIGRules::GetHopeReactions($self, $self->{dir}); ##HACK
662          # Insure we have it if we need it again.          # Insure we have it if we need it again.
663          $self->{hopeReactions} = $retVal;          $self->{hopeReactions} = $retVal;
664      }      }
# Line 968  Line 1053 
1053    my $image_map = $self->get_diagram_html_file($id);    my $image_map = $self->get_diagram_html_file($id);
1054    if ($image_map) {    if ($image_map) {
1055      Trace("Image map found for diagram $id at $image_map.") if T(3);      Trace("Image map found for diagram $id at $image_map.") if T(3);
1056      open(IN, "$image_map") or Confess("Unable to open file $image_map.");      Open(\*IN, "<$image_map");
1057      my $header = <IN>;      my $header = <IN>;
1058      close(IN);      close(IN);
1059    

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.17

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3