-
Notifications
You must be signed in to change notification settings - Fork 12
Description
Hello,
I am encountering an issue while running the "rfba.optimize()" & "find_conflicts()" analysis using the provided guide and code. Despite following the instructions exactly, the solution consistently returns an objective value of 0, and the following error is raised:
--------------------------------< error >-------------------------------------
RuntimeError Traceback (most recent call last)
Cell In[21], line 2
1 # we can see that 3 regulators are affecting the following essential genes: b2574; b1092; b3730
----> 2 repressed_genes, repressed_reactions = find_conflicts(model)
3 repressed_genes
File ~/insilico_data/JSY/rFBA/mewpy/src/mewpy/germ/analysis/integrated_analysis.py:475, in find_conflicts(model, strategy, constraints, initial_state)
472 solution = FBA(model).build().optimize(solver_kwargs={'constraints': constraints})
474 if not solution.objective_value:
--> 475 raise RuntimeError('FBA solution is not feasible (objective value is 0). To find inconsistencies, '
476 'the metabolic model must be feasible.')
478 # 2. it performs an essential genes analysis using FBA
479 from mewpy.germ.analysis.metabolic_analysis import single_gene_deletion
RuntimeError: FBA solution is not feasible (objective value is 0). To find inconsistencies, the metabolic model must be feasible.
[ALL Script]
import sys
import os
import warnings
import pandas as pd
warnings.filterwarnings("ignore")
current_dir = os.getcwd()
subdirs = [os.path.join(current_dir, d) for d in os.listdir(current_dir) if os.path.isdir(os.path.join(current_dir, d))]
for subdir in subdirs:
sys.path.append(subdir)
from mewpy.io import Reader, Engines, read_model
from mewpy.germ.analysis import find_conflicts
from reframed.core import model
from cobra import *
from cobra.io import load_matlab_model, load_json_model, read_sbml_model
path = str(subdirs[0][:-10])
model_path = str(path) + '/examples/models/germ/iJR904.xml'
tf_path = str(path) + '/examples/models/germ/iMC1010.csv'
cobra_model = read_met_model('iJR904.xml', str(path) + '/examples/models/germ/')
changeBound(cobra_model, 'EX_glc_DASH_D_e', -100, -100)
sol = cobra_model.optimize()
sol ## biomass flux = 3.3
path = str(subdirs[0][:-10])
model_path = str(path) + '/examples/models/germ/iJR904.xml'
tf_path = str(path) + '/examples/models/germ/iMC1010.csv'
imc1010_gem_reader = Reader(Engines.MetabolicSBML,
model_path)
imc1010_trn_reader = Reader(Engines.BooleanRegulatoryCSV,
tf_path,
sep=',', id_col=0, rule_col=4, aliases_cols=[1, 2, 3], header=0)
model = read_model(imc1010_gem_reader, imc1010_trn_reader)
repressed_genes, repressed_reactions = find_conflicts(model)
repressed_genes ## --> raise error (infeasible)
from mewpy.germ.analysis import RFBA
initial_state = {
'Stringent': 0.0,
'high-NAD': 0.0,
'AGDC': 0.0,
}
rfba = RFBA(model).build()
solution = rfba.optimize(initial_state=initial_state)
solution ## sol is zero
from mewpy.germ.analysis import SRFBA
srfba = SRFBA(model).build()
solution = srfba.optimize()
solution ## sol is zero, too...