Skip to content

Commit a033c1b

Browse files
committed
added print flushs
1 parent 286acba commit a033c1b

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

meneco.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
# You should have received a copy of the GNU General Public License
1717
# along with meneco. If not, see <http://www.gnu.org/licenses/>.
1818
# -*- coding: utf-8 -*-
19-
from pyasp.asp import *
2019
import argparse
20+
import sys
21+
from pyasp.asp import *
2122
from __meneco__ import query, utils, sbml
2223

2324
if __name__ == '__main__':
@@ -45,21 +46,25 @@
4546
targets_sbml = args.targets
4647

4748
print 'Reading draft network from ',draft_sbml,'...',
49+
sys.stdout.flush()
4850
draftnet = sbml.readSBMLnetwork(draft_sbml, 'draft')
4951
print 'done.'
5052
#draftnet.to_file("draftnet.lp")
5153

5254
print 'Reading seeds from ',seeds_sbml,'...',
55+
sys.stdout.flush()
5356
seeds = sbml.readSBMLseeds(seeds_sbml)
5457
print 'done.'
5558
#seeds.to_file("seeds.lp")
5659

5760
print 'Reading targets from ',targets_sbml,'...',
61+
sys.stdout.flush()
5862
targets = sbml.readSBMLtargets(targets_sbml)
5963
print 'done.'
6064
#targets.to_file("targets.lp")
6165

6266
print '\nChecking draftnet for unproducible targets ...',
67+
sys.stdout.flush()
6368
model = query.get_unproducible(draftnet, targets, seeds)
6469
print 'done.'
6570
print ' ',len(model),'unproducible targets:'
@@ -71,6 +76,7 @@
7176
unproducible_targets = unproducible_targets.union(t)
7277

7378
print '\nReading repair network from ',repair_sbml,'...',
79+
sys.stdout.flush()
7480
repairnet = sbml.readSBMLnetwork(repair_sbml, 'repairnet')
7581
print 'done.'
7682
#repairnet.to_file("repairnet.lp")
@@ -79,6 +85,7 @@
7985
all_reactions = draftnet
8086
all_reactions = all_reactions.union(repairnet)
8187
print '\nChecking draftnet + repairnet for unproducible targets ...',
88+
sys.stdout.flush()
8289
model = query.get_unproducible(all_reactions, seeds, targets)
8390
print 'done.'
8491
print ' still',len(model),'unproducible targets:'
@@ -105,6 +112,7 @@
105112
single_target = TermSet()
106113
single_target.add(t)
107114
print '\nComputing essential reactions for',t,'...',
115+
sys.stdout.flush()
108116
essentials = query.get_intersection_of_completions(draftnet, repairnet, seeds, single_target)
109117
print 'done.'
110118
print ' ',len(essentials), 'essential reactions found:'
@@ -124,24 +132,28 @@
124132
#seeds.to_file("seeds.lp")
125133

126134
print '\nComputing one minimal completion to produce all targets ...',
135+
sys.stdout.flush()
127136
models = query.get_minimal_completion_size(draftnet, repairnet, seeds, reconstructable_targets)
128137
print 'done.'
129138
optimum = models[0].score[0]
130139
utils.print_met(models[0].to_list())
131140

132141

133142
print '\nComputing common reactions in all completion with size',optimum,'...',
143+
sys.stdout.flush()
134144
model = query.get_intersection_of_optimal_completions(draftnet, repairnet, seeds, reconstructable_targets, optimum)
135145
print 'done.'
136146
utils.print_met(model.to_list())
137147

138148
print '\nComputing union of reactions from all completion with size',optimum,'...',
149+
sys.stdout.flush()
139150
model = query.get_union_of_optimal_completions(draftnet, repairnet, seeds, reconstructable_targets, optimum)
140151
print 'done.'
141152
utils.print_met(model.to_list())
142153

143154
if args.enumerate :
144155
print '\nComputing all completions with size',optimum,'...',
156+
sys.stdout.flush()
145157
models = query.get_optimal_completions(draftnet, repairnet, seeds, reconstructable_targets, optimum)
146158
print 'done.'
147159
count = 1

0 commit comments

Comments
 (0)