[Bio] / FigKernelPackages / model.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/model.pm

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

revision 1.3, Thu May 17 16:51:43 2007 UTC revision 1.4, Fri May 18 16:57:26 2007 UTC
# Line 113  Line 113 
113    
114  }  }
115    
   
   
   
116  sub process_init  sub process_init
117  {  {
118      my ($ss_name,$scenario_name,$genome,$assembly) = @_;      my ($ss_name,$scenario_name,$genome,$assembly) = @_;
# Line 127  Line 124 
124      }      }
125      print STDERR "\nSubsystem : ".$ss_name." Scenario: $scenario_name \n" if $debug;      print STDERR "\nSubsystem : ".$ss_name." Scenario: $scenario_name \n" if $debug;
126      my $subsystem = $fig->get_subsystem($ss_name);      my $subsystem = $fig->get_subsystem($ss_name);
     my @roles = $subsystem->get_roles;  
     my %hope_reactions = %{$subsystem->get_hope_reactions};  
127      my $scenario_data = &get_scenario($subsystem,$scenario_name);      my $scenario_data = &get_scenario($subsystem,$scenario_name);
128    
129      #load the other arrays      #load the other arrays
130      my %ss_reactions;      my %ss_reactions;
131    
132      my $valid_genome = 0;      if ($genome eq "All")
     #determine if this genome has this subsystem  
     my @genome_array = $subsystem->get_genomes();  
     foreach my $organ (@genome_array)  
133      {      {
134          if($organ eq $genome || $genome eq "All" )          my %all_reactions = %{$subsystem->get_hope_reactions};
135            foreach my $role (keys %all_reactions)
136          {          {
137              $valid_genome = 1;              map { $ss_reactions{$_} = 1 } @{$all_reactions{$role}};
             last;  
138          }          }
139      }      }
140        else
     foreach my $role (@roles)  
     {  
         if ($valid_genome && defined $hope_reactions{$role} &&  
             ($genome eq "All" || $subsystem->get_pegs_from_cell($genome,$role) > 0))  
141          {          {
142              map { $ss_reactions{$_} = 1 } @{$hope_reactions{$role}};          my $reactions_for_genome = $subsystem->get_hope_reactions_for_genome($genome);
143          }          map { $ss_reactions{$_} = 1 } @{$reactions_for_genome} if defined $reactions_for_genome;
144      }      }
145    
146      map { $sc_inputs{$_} = 1 } @{$scenario_data->{inputs}};      map { $sc_inputs{$_} = 1 } @{$scenario_data->{inputs}};
147    
148      foreach my $list (@{$scenario_data->{outputs}})      foreach my $list (@{$scenario_data->{outputs}})
# Line 2713  Line 2703 
2703      my @additional_reactions = @{$subsystem->get_hope_additional_reactions($scenario_name)};      my @additional_reactions = @{$subsystem->get_hope_additional_reactions($scenario_name)};
2704      my %additional_reactions;      my %additional_reactions;
2705      map { $additional_reactions{$_} = 1 } @additional_reactions;      map { $additional_reactions{$_} = 1 } @additional_reactions;
     my @roles = $subsystem->get_roles;  
     my %hope_reactions = %{$subsystem->get_hope_reactions};  
   
     my $valid_genome = 0;  
     #determine if this genome has this subsystem  
     my @genome_array = $subsystem->get_genomes();  
     foreach my $organ (@genome_array)  
     {  
         if($organ eq $genome || $genome eq "All" )  
         {  
             $valid_genome = 1;  
             last;  
         }  
     }  
2706    
2707      my %ss_reactions;      my %ss_reactions;
2708    
2709      foreach my $role (@roles)      if ($genome eq "All")
2710      {      {
2711          if ($valid_genome && defined $hope_reactions{$role} &&          my %all_reactions = %{$subsystem->get_hope_reactions};
2712              ($genome eq "All" || $subsystem->get_pegs_from_cell($genome,$role) > 0))          foreach my $role (keys %all_reactions)
2713          {          {
2714              map { $ss_reactions{$_} = 1 } @{$hope_reactions{$role}};              map { $ss_reactions{$_} = 1 } @{$all_reactions{$role}};
2715            }
2716          }          }
2717        else
2718        {
2719            my $reactions_for_genome = $subsystem->get_hope_reactions_for_genome($genome);
2720            map { $ss_reactions{$_} = 1 } @{$reactions_for_genome} if defined $reactions_for_genome;
2721      }      }
2722    
2723      # first find paths in the All directory that should be valid for the genome      # first find paths in the All directory that should be valid for the genome

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3