14
14
15
15
class MSATPCorrection :
16
16
17
- def __init__ (self , model , core_template , atp_medias ,compartment = "c0" , max_gapfilling = None , gapfilling_delta = 0 ):
17
+ def __init__ (self , model , core_template , atp_medias ,compartment = "c0" ,
18
+ max_gapfilling = None , gapfilling_delta = 0 , atp_hydrolysis_id = None ):
18
19
"""
19
20
20
21
:param model:
@@ -23,11 +24,15 @@ def __init__(self, model, core_template, atp_medias,compartment="c0", max_gapfil
23
24
:param atp_objective:
24
25
:param max_gapfilling:
25
26
:param gapfilling_delta:
27
+ :param atp_hydrolysis_id: ATP Hydrolysis reaction ID, if None it will perform a SEED reaction search
26
28
"""
27
29
self .model = model
28
30
self .compartment = compartment
29
- output = FBAHelper .add_atp_hydrolysis (self .model ,compartment )
30
- self .atp_hydrolysis = output ["reaction" ]
31
+ if atp_hydrolysis_id and atp_hydrolysis_id in self .model .reactions :
32
+ self .atp_hydrolysis = self .model .reactions .get_by_id (atp_hydrolysis_id )
33
+ else :
34
+ output = FBAHelper .add_atp_hydrolysis (self .model , compartment )
35
+ self .atp_hydrolysis = output ["reaction" ]
31
36
self .atp_medias = atp_medias
32
37
self .max_gapfilling = max_gapfilling
33
38
self .gapfilling_delta = gapfilling_delta
@@ -123,6 +128,8 @@ def evaluate_growth_media(self):
123
128
if solution .objective_value == 0 or solution .status != 'optimal' :
124
129
self .media_gapfill_stats [media ] = self .msgapfill .run_gapfilling (media , self .atp_hydrolysis .id )
125
130
#IF gapfilling fails - need to activate and penalize the noncore and try again
131
+ elif solution .objective_value > 0 or solution .status == 'optimal' :
132
+ self .media_gapfill_stats [media ] = {'reversed' : {}, 'new' : {}}
126
133
127
134
def determine_growth_media (self ):
128
135
"""
0 commit comments