[sympycore] r1204 committed - Fill reactions_info.

1 view
Skip to first unread message

codesite...@google.com

unread,
Apr 13, 2011, 5:32:35 AM4/13/11
to sympycor...@googlegroups.com
Revision: 1204
Author: pearu.peterson
Date: Wed Apr 13 02:31:36 2011
Log: Fill reactions_info.
http://code.google.com/p/sympycore/source/detail?r=1204

Modified:
/trunk/sympycore/physics/sysbio/io.py
/trunk/sympycore/physics/sysbio/steady_flux_analyzer.py
/trunk/sympycore/physics/sysbio/tests/test_steady_flux_analyzer.py

=======================================
--- /trunk/sympycore/physics/sysbio/io.py Wed Apr 13 01:50:45 2011
+++ /trunk/sympycore/physics/sysbio/io.py Wed Apr 13 02:31:36 2011
@@ -218,6 +218,7 @@
species_info = defaultdict(lambda:dict())
for line in text.splitlines():
line = line.strip()
+ if not line or line.startswith ('#'): continue
if ':' in line:
reaction_name, line = line.split (':',1)
reaction_name = reaction_name.strip()
@@ -309,6 +310,19 @@
matrix[specie_index, reaction_index2] = -coeff
matrix[specie_index, reaction_index] = coeff

- reactions_info[reaction_name]['reversible'] = reversible
+ if split_bidirectional_fluxes:
+ print 'TODO: fill reactions_info'
+ pass
+ else:
+ reactions_info[reaction_name]['reversible'] = reversible
+ reactions_info[reaction_name]['reactants'] = left_specie_names
+ reactions_info[reaction_name]['products'] = right_specie_names
+
+ if reversible:
+ reactions_info[reaction_name]['forward']
= 'f'+reaction_name
+ reactions_info[reaction_name]['reverse']
= 'r'+reaction_name
+ else:
+ reactions_info[reaction_name]['forward'] = reaction_name
+ reactions_info[reaction_name]['reverse'] = None

return matrix, species, reactions, species_info, reactions_info
=======================================
--- /trunk/sympycore/physics/sysbio/steady_flux_analyzer.py Fri Apr 8
03:37:08 2011
+++ /trunk/sympycore/physics/sysbio/steady_flux_analyzer.py Wed Apr 13
02:31:36 2011
@@ -112,6 +112,8 @@
@property
def reactions(self): return self.source_data[2]
@property
+ def reactions_info(self): return self.source_data[4]
+ @property
def stoichiometry(self):
if self._stoichiometry is None:
self._stoichiometry = Matrix(len (self.species), len
(self.reactions), self.source_data[0])
=======================================
--- /trunk/sympycore/physics/sysbio/tests/test_steady_flux_analyzer.py Wed
Apr 13 01:50:45 2011
+++ /trunk/sympycore/physics/sysbio/tests/test_steady_flux_analyzer.py Wed
Apr 13 02:31:36 2011
@@ -13,6 +13,7 @@
fluxes, indep_fluxes, kernel = network.get_kernel_GJE ()
variables = fluxes[network.rank:]
print network.label_matrix (kernel, ['%s='%f for f in fluxes],
variables)
+ print network.source_data

def test_example_yeast():
sbml_file = os.path.join (os.path.dirname
(__file__),'yeast_example.xml')

Reply all
Reply to author
Forward
0 new messages