@@ -77,11 +77,11 @@ def build_package(self, parameters):
77
77
newrxns = []
78
78
class_coef = {"rna" : {}, "dna" : {}, "protein" : {}, "energy" : {}}
79
79
refcpd = {
80
- "cpd00001" : None ,
81
- "cpd00009" : None ,
82
- "cpd00012" : None ,
83
- "cpd00067" : None ,
84
- "cpd00002" : None ,
80
+ "cpd00001" : None , # Water
81
+ "cpd00009" : None , # Orthophosphate
82
+ "cpd00012" : None , # Pyrophosphate
83
+ "cpd00067" : None , # Proton
84
+ "cpd00002" : None , # ATP
85
85
}
86
86
# Finding all reference compounds in the model
87
87
msid_hash = self .modelutl .msid_hash ()
@@ -94,10 +94,10 @@ def build_package(self, parameters):
94
94
met_class [metabolite ] = None
95
95
msid = MSModelUtil .metabolite_msid (metabolite )
96
96
if (
97
- msid != "cpd11416"
98
- and msid != "cpd11463"
99
- and msid != "cpd11462"
100
- and msid != "cpd11461"
97
+ msid != "cpd11416" # Biomass
98
+ and msid != "cpd11463" # Protein
99
+ and msid != "cpd11462" # RNA
100
+ and msid != "cpd11461" # DNA
101
101
and msid != None
102
102
):
103
103
if msid in refcpd :
@@ -209,7 +209,7 @@ def build_package(self, parameters):
209
209
self .build_constraint (
210
210
self .new_reactions [met_class + "_flex" ], "flxcls"
211
211
)
212
- if parameters ["add_total_biomass_constraint" ]:
212
+ if self . parameters ["add_total_biomass_constraint" ]:
213
213
self .build_constraint (self .parameters ["bio_rxn" ], "flxbio" )
214
214
215
215
def build_variable (self , object , type ): # !!! can the function be removed?
@@ -254,7 +254,7 @@ def build_constraint(self, cobra_obj, obj_type):
254
254
if abs (massdiff ) > 0.00001 :
255
255
coef [rxn .forward_variable ] = massdiff
256
256
coef [rxn .reverse_variable ] = - massdiff
257
- return BaseFBAPkg .build_constraint (self , obj_type , 0 , 0 , coef , cobra_obj )
257
+ return super () .build_constraint (obj_type , 0 , 0 , coef , cobra_obj )
258
258
elif obj_type == "flxcpd" or obj_type == "flxcls" :
259
259
first_entry = None
260
260
second_entry = None
@@ -293,7 +293,7 @@ def build_constraint(self, cobra_obj, obj_type):
293
293
# If the value is positive, lock in the forward variable and set the reverse to zero
294
294
if first_entry > 0 :
295
295
if product :
296
- const = self .build_constraint (
296
+ const = super () .build_constraint (
297
297
"f" + obj_type ,
298
298
0 ,
299
299
0 ,
@@ -302,7 +302,7 @@ def build_constraint(self, cobra_obj, obj_type):
302
302
)
303
303
object .lower_bound = 0
304
304
else :
305
- const = self .build_constraint (
305
+ const = super () .build_constraint (
306
306
"f" + obj_type ,
307
307
0 ,
308
308
0 ,
@@ -313,7 +313,7 @@ def build_constraint(self, cobra_obj, obj_type):
313
313
# If the value is negative, lock in the reverse variable and set the forward to zero
314
314
elif first_entry < 0 :
315
315
if product :
316
- const = self .build_constraint (
316
+ const = super () .build_constraint (
317
317
"r" + obj_type ,
318
318
0 ,
319
319
0 ,
@@ -322,7 +322,7 @@ def build_constraint(self, cobra_obj, obj_type):
322
322
)
323
323
object .upper_bound = 0
324
324
else :
325
- const = self .build_constraint (
325
+ const = super () .build_constraint (
326
326
"r" + obj_type ,
327
327
0 ,
328
328
0 ,
@@ -337,8 +337,7 @@ def build_constraint(self, cobra_obj, obj_type):
337
337
elif second_entry >= 0 :
338
338
if first_entry >= 0 :
339
339
if product :
340
- const = BaseFBAPkg .build_constraint (
341
- self ,
340
+ const = super ().build_constraint (
342
341
"f" + obj_type ,
343
342
0 ,
344
343
None ,
@@ -347,17 +346,15 @@ def build_constraint(self, cobra_obj, obj_type):
347
346
)
348
347
object .lower_bound = 0
349
348
if first_entry > 0 :
350
- BaseFBAPkg .build_constraint (
351
- self ,
349
+ super ().build_constraint (
352
350
"r" + obj_type ,
353
351
0 ,
354
352
None ,
355
353
{biovar : - first_entry , object .forward_variable : 1 },
356
354
cobra_obj ,
357
355
)
358
356
else :
359
- const = BaseFBAPkg .build_constraint (
360
- self ,
357
+ const = super ().build_constraint (
361
358
"f" + obj_type ,
362
359
0 ,
363
360
None ,
@@ -366,8 +363,7 @@ def build_constraint(self, cobra_obj, obj_type):
366
363
)
367
364
object .upper_bound = 0
368
365
if first_entry > 0 :
369
- BaseFBAPkg .build_constraint (
370
- self ,
366
+ super ().build_constraint (
371
367
"r" + obj_type ,
372
368
0 ,
373
369
None ,
@@ -376,29 +372,29 @@ def build_constraint(self, cobra_obj, obj_type):
376
372
)
377
373
else :
378
374
if product :
379
- const = self .build_constraint (
375
+ const = super () .build_constraint (
380
376
"f" + obj_type ,
381
377
0 ,
382
378
None ,
383
379
{biovar : second_entry , object .forward_variable : - 1 },
384
380
cobra_obj ,
385
381
)
386
- self .build_constraint (
382
+ super () .build_constraint (
387
383
"r" + obj_type ,
388
384
0 ,
389
385
None ,
390
386
{biovar : - first_entry , object .reverse_variable : - 1 },
391
387
cobra_obj ,
392
388
)
393
389
else :
394
- const = self .build_constraint (
390
+ const = super () .build_constraint (
395
391
"f" + obj_type ,
396
392
0 ,
397
393
None ,
398
394
{biovar : second_entry , object .reverse_variable : - 1 },
399
395
cobra_obj ,
400
396
)
401
- self .build_constraint (
397
+ super () .build_constraint (
402
398
"r" + obj_type ,
403
399
0 ,
404
400
None ,
@@ -408,23 +404,23 @@ def build_constraint(self, cobra_obj, obj_type):
408
404
else :
409
405
if second_entry < 0 :
410
406
if product :
411
- const = self .build_constraint (
407
+ const = super () .build_constraint (
412
408
"f" + obj_type ,
413
409
0 ,
414
410
None ,
415
411
{biovar : second_entry , object .reverse_variable : 1 },
416
412
cobra_obj ,
417
413
)
418
414
else :
419
- const = self .build_constraint (
415
+ const = super () .build_constraint (
420
416
"f" + obj_type ,
421
417
0 ,
422
418
None ,
423
419
{biovar : second_entry , object .forward_variable : 1 },
424
420
cobra_obj ,
425
421
)
426
422
if product :
427
- self .build_constraint (
423
+ super () .build_constraint (
428
424
"r" + obj_type ,
429
425
0 ,
430
426
None ,
@@ -433,7 +429,7 @@ def build_constraint(self, cobra_obj, obj_type):
433
429
)
434
430
object .lower_bound = 0
435
431
else :
436
- self .build_constraint (
432
+ super () .build_constraint (
437
433
"r" + obj_type ,
438
434
0 ,
439
435
None ,
0 commit comments