[Bio] / FigKernelScripts / make_MPS_model.pl Repository:
ViewVC logotype

Diff of /FigKernelScripts/make_MPS_model.pl

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

revision 1.2, Fri Jul 20 15:05:09 2007 UTC revision 1.5, Fri Jul 27 18:54:34 2007 UTC
# Line 25  Line 25 
25      $fig = new FIGV;      $fig = new FIGV;
26  }  }
27  chomp $genome_id;  chomp $genome_id;
28  Scenario::set_fig($fig);  Scenario::set_fig($fig,$genome_id);
29  print STDERR "Creating SBML model for genome $genome_id\n" if($debug);  print STDERR "Creating SBML model for genome $genome_id\n" if($debug);
30  print STDERR "\tStage 1 - Loading Scenarios, model inputs and biomass\n" if($debug);  print STDERR "\tStage 1 - Loading Scenarios, model inputs and biomass\n" if($debug);
31  my @scenarios = @{Scenario->get_genome_scenarios($genome_id,1)};  my @scenarios = @{Scenario->get_genome_scenarios($genome_id,1)};
# Line 43  Line 43 
43  }  }
44  close(INPUTS);  close(INPUTS);
45  #we are going to load up the cofactor compounds into inputs as well  #we are going to load up the cofactor compounds into inputs as well
46  open(COFACT,$filebase."cofactors.txt")  open(COFACT,$filebase."secondary_compounds.txt")
47      or die("Failed to open ".$filebase."cofactors.txt");      or die("Failed to open ".$filebase."secondary_compounds.txt");
48  while(<COFACT>)  while(<COFACT>)
49  {  {
50      chomp;      chomp;
# Line 66  Line 66 
66  }  }
67  close(BIOMASS);  close(BIOMASS);
68    
69    #$biomass_cpds{"C00002"} = 1;
70    
71  open(IN,$filebase."scenarios_valid.txt");  open(IN,$filebase."scenarios_valid.txt");
72  my @lines = <IN>;  my @lines = <IN>;
73  chomp @lines;  chomp @lines;
# Line 117  Line 119 
119           } keys %products;           } keys %products;
120      }      }
121  }  }
122    #the ATP Synthase hack reaction
123    $core_metabolites{"C00009"} = 1;
124    $core_metabolites{"C00001"} = 1;
125    $core_metabolites{"C00008"} = 1;
126    $core_metabolites{"C00002"} = 1;
127    $reaction_reversible{"ATPSYN"} = 0;
128    $reaction_to_substrates{"ATPSYN"} = {};
129    $reaction_to_products{"ATPSYN"} = {};
130    $reaction_to_substrates{"ATPSYN"}->{"C00008"} = 1;
131    $reaction_to_substrates{"ATPSYN"}->{"C00009"} = 1;
132    $reaction_to_products{"ATPSYN"}->{"C00001"} = 1;
133    $reaction_to_products{"ATPSYN"}->{"C00002"} = 1;
134    #end hack
135    
136  open(OUT,">".$filebase.$genome_id.".mps");  open(OUT,">".$filebase.$genome_id.".mps");
137    
138  print OUT "NAME          test\n";  print OUT "NAME          test\n";
# Line 177  Line 193 
193  #scenario reactions  #scenario reactions
194  foreach my $rid (sort keys %reaction_to_substrates)  foreach my $rid (sort keys %reaction_to_substrates)
195  {  {
196    
197      foreach (sort keys %{$reaction_to_substrates{$rid}})      foreach (sort keys %{$reaction_to_substrates{$rid}})
198      {      {
199            if(!defined $reaction_to_products{$rid}->{$_})
200            {
201          print OUT "    $rid    $_             -$reaction_to_substrates{$rid}->{$_}\n";          print OUT "    $rid    $_             -$reaction_to_substrates{$rid}->{$_}\n";
202      }      }
203        }
204      foreach (sort keys %{$reaction_to_products{$rid}})      foreach (sort keys %{$reaction_to_products{$rid}})
205      {      {
206            if(!defined $reaction_to_substrates{$rid}->{$_})
207            {
208          print OUT "    $rid    $_              $reaction_to_products{$rid}->{$_}\n";          print OUT "    $rid    $_              $reaction_to_products{$rid}->{$_}\n";
209      }      }
210        }
211      push @all_rids, $rid;      push @all_rids, $rid;
212      if($reaction_reversible{$rid})      if($reaction_reversible{$rid})
213      {      {

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.5

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3