Fairly new to Python and receiving error: 'module' object is not callable.
Basically, I have a model with some reactions, I am using a for loop that changes some values of selected reactions and then I want to plot the output of the model as a function of the change in parameter. Perhaps my code will provide more of a concise answer, so here it is:
import cobra
import os
from os.path import join
import matplotlib.pyplot as plt
data_dir = '/Users/stephenchapman/Documents/research/FBA_algae_digesate/COBRApy/iCZ843/iCZ843_models'
model = cobra.io.read_sbml_model(join(data_dir, "iCZ843_mixo.xml"))
NH4_exchange = []
fluxes = []
for i in range(0,100,10):
model.reactions[15].lower_bound = -i
model.reactions[15].upper_bound = -i
solution = model_mixo.optimize()
solution.f
fluxes.append(solution.f)
NH4_exchange.append(model.reactions[15].lower_bound)
plt('fluxes','NH4_exchange')
plt.show()
Can anyone please help me with this?
Cheers
S.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.