[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.31, Mon Feb 23 10:28:43 2009 UTC revision 1.32, Thu Apr 2 01:19:02 2009 UTC
# Line 36  Line 36 
36  package model;  package model;
37    
38  use strict;  use strict;
39    no warnings 'redefine';
40  use Scenario;  use Scenario;
41  use FIG;  use FIG;
42  use Subsystem;  use Subsystem;
43  use File::Path;  use File::Path;
44    
45  my $fig= new FIG;  my $fig = eval("FIG->new()"); ## So that this will compile properly on non-FIG systems!
46    
47  #global variables that make process_paths work  #global variables that make process_paths work
48  #These need to be cleared and reloaded frequently for process path and flux writing  #These need to be cleared and reloaded frequently for process path and flux writing
# Line 150  Line 151 
151      else      else
152      {      {
153          my %reactions_for_genome = get_reactions_for_genome_in_subsystem($genome,$ss_name);          my %reactions_for_genome = get_reactions_for_genome_in_subsystem($genome,$ss_name);
154          map { $ss_reactions{$_} = 1 } keys %reactions_for_genome if defined %reactions_for_genome;          map { $ss_reactions{$_} = 1 } keys %reactions_for_genome if keys %reactions_for_genome;
155      }      }
156    
157      map { $sc_inputs{$_} = 1 } @{$scenario_data->{inputs}};      map { $sc_inputs{$_} = 1 } @{$scenario_data->{inputs}};
# Line 735  Line 736 
736                  my $cpd = @{$substr}[0];                  my $cpd = @{$substr}[0];
737                  my $stoich = @{$substr}[1];                  my $stoich = @{$substr}[1];
738                  my $is_it_main = @{$substr}[2];                  my $is_it_main = @{$substr}[2];
739                  my $main = $is_it_main == 1 || @all_compounds_to_main{$cpd}; #main either way                  my $main = $is_it_main == 1 || $all_compounds_to_main{$cpd}; #main either way
740    
741                  if ($is_it_main == 2)                  if ($is_it_main == 2)
742                  {                  {
# Line 2777  Line 2778 
2778      else      else
2779      {      {
2780          my %reactions_for_genome = get_reactions_for_genome_in_subsystem($genome,$ss_name);          my %reactions_for_genome = get_reactions_for_genome_in_subsystem($genome,$ss_name);
2781          map { $ss_reactions{$_} = 1 } keys %reactions_for_genome if defined %reactions_for_genome;          map { $ss_reactions{$_} = 1 } keys %reactions_for_genome if keys %reactions_for_genome;
2782      }      }
2783    
2784      # 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
# Line 3341  Line 3342 
3342          print STDERR "Expanding $path \n" if $debug;          print STDERR "Expanding $path \n" if $debug;
3343          my @parts = split "/", $path;          my @parts = split "/", $path;
3344          shift @parts; # get ride of the first blank entry from /$genome          shift @parts; # get ride of the first blank entry from /$genome
3345          my $length =$length - scalar @parts;          $length =$length - scalar @parts;
3346          my $genome = shift @parts;          my $genome = shift @parts;
3347          $path = join "/" , @parts;          $path = join "/" , @parts;
3348          print STDERR "Length : $length Path: $path\n" if $debug;          print STDERR "Length : $length Path: $path\n" if $debug;
# Line 3798  Line 3799 
3799          my $subsystem = $fig->get_subsystem($subsystem_name);          my $subsystem = $fig->get_subsystem($subsystem_name);
3800          next if(!defined $subsystem);          next if(!defined $subsystem);
3801          my %reactions_for_ss = get_reactions_for_genome_in_subsystem($genome_id,$subsystem_name);          my %reactions_for_ss = get_reactions_for_genome_in_subsystem($genome_id,$subsystem_name);
3802          next if(!defined %reactions_for_ss);          next if(! keys %reactions_for_ss);
3803          foreach my $reaction (keys %reactions_for_ss)          foreach my $reaction (keys %reactions_for_ss)
3804          {          {
3805              if(defined $reaction_to_pegs{$reaction})              if(defined $reaction_to_pegs{$reaction})
# Line 3978  Line 3979 
3979      }      }
3980    
3981    
3982      %list_generated = {};      %list_generated = ();
3983    
3984      foreach (@scenarios)      foreach (@scenarios)
3985      {      {
# Line 4005  Line 4006 
4006      }      }
4007      print STDERR "Finished checking all scenarios\n" if($debug);      print STDERR "Finished checking all scenarios\n" if($debug);
4008    
4009      my %biomass_reached;      %biomass_reached = ();
4010    
4011      foreach my $found (keys %list_generated)      foreach my $found (keys %list_generated)
4012      {      {

Legend:
Removed from v.1.31  
changed lines
  Added in v.1.32

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3