Modified:
/trunk/sympycore/physics/sysbio/io.py
/trunk/sympycore/physics/sysbio/tests/test_steady_flux_analyzer.py
=======================================
--- /trunk/sympycore/physics/sysbio/io.py Fri Apr 8 01:57:00 2011
+++ /trunk/sympycore/physics/sysbio/io.py Wed Apr 13 01:50:45 2011
@@ -217,7 +217,15 @@
compartments = set()))
species_info = defaultdict(lambda:dict())
for line in text.splitlines():
- if not line.strip () or line.startswith ('#'): continue
+ line = line.strip()
+ if ':' in line:
+ reaction_name, line = line.split (':',1)
+ reaction_name = reaction_name.strip()
+ line = line.strip()
+ else:
+ reaction_name = None
+ if not line or line.startswith ('#'): continue
+
reversible = False
left, right = line.split ('=')
direction = '='
@@ -255,11 +263,17 @@
fname.append (name0)
if direction=='<':
- reaction_name = '_'.join(fname)
- reaction_name2 = '_'.join(rname)
+ if not reaction_name:
+ reaction_name = '_'.join(fname)
+ reaction_name2 = '_'.join(rname)
+ else:
+ reaction_name2 = 'r'+reaction_name
else:
- reaction_name2 = '_'.join(fname)
- reaction_name = '_'.join(rname)
+ if not reaction_name:
+ reaction_name2 = '_'.join(fname)
+ reaction_name = '_'.join(rname)
+ else:
+ reaction_name2 = 'r'+reaction_name
reactions.append (reaction_name)
reaction_index = reactions.index (reaction_name)
=======================================
--- /trunk/sympycore/physics/sysbio/tests/test_steady_flux_analyzer.py Tue
Apr 12 12:03:22 2011
+++ /trunk/sympycore/physics/sysbio/tests/test_steady_flux_analyzer.py Wed
Apr 13 01:50:45 2011
@@ -5,14 +5,14 @@
def test_sauro2004_fig3 ():
network = SteadyFluxAnalyzer('''\
-S1=>S2
-ES=>S1+E
+v1:S1=>S2
+v2:ES=>S1+E
E+S2=>ES
''')
#print network
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.label_matrix (kernel, ['%s='%f for f in fluxes],
variables)
def test_example_yeast():
sbml_file = os.path.join (os.path.dirname
(__file__),'yeast_example.xml')