Hi,
I've been trying to use the new GPR system in cobrapy.
I want to be able to know which reactions would be affected by a gene KO.
It seems to me that this is what the eval function is for: the way I understand it, it returns True on a GPR that is active for a given knockout, and False if the reaction is inactivated by a given knockout.
However, it seems to be returning True no matter what.
Here's an example using Human 1:
import cobra
model = cobra.io.read_sbml_model("Human-GEM.xml")
g = model.genes.get_by_id("ENSG00000100170")
with model:
print(g.functional)
g.knock_out()
print(g.functional)
for r in g.reactions:
print(r.bounds)
print(r.gpr)
print(r.gpr.eval([g]))
Results:
True
False
True
(0, 0)
ENSG00000100170
True
(-1000.0, 1000.0)
ENSG00000086159 or ENSG00000100170 or ENSG00000103375 or ENSG00000143595 or ENSG00000161798 or ENSG00000165269 or ENSG00000165272 or ENSG00000167580 or ENSG00000171885 or ENSG00000240583 or ENSG00000259916
True
(0, 0)
ENSG00000100170
True
(0, 0)
ENSG00000100170
True
(0, 0)
ENSG00000100170
True
(0, 0)
ENSG00000100170
True
(0, 0)
As you can see, all but one reactions are affected by this gene KO but all of the eval results are True. Is this the intended behaviour or is it a bug?
If it's intended, what is the correct way to test if a reaction will be affected by a KO? Running the KO and checking the bounds?
Thanks,
Juliette