Closed ghost closed 4 years ago
It is because of the version of cobrapy you are using. In the current version, you have to specify reacts.id. So... if(e in reacts.id and ex in reacts.id):
Using COBRAPy 0.4.1 did not seem to fix the issue. How would I go about specifying reacts.id? Thanks.
import os import cobra import numpy import bottom_up_ecology as bte
n=10 models = [cobra.io.read_sbml_model('models' + '/' + os.listdir('models')[i]) for i in range(n)] for i in range(n): models[i].solver = 'glpk'
initial_environment = bte.starting_environment(models)
if(e in reacts and ex in reacts): #identify exchange reactions (if you removed reactions by setting fluxes to zero, then you should add this condition here) TypeError: argument of type 'Reaction' is not iterable
I am not sure what I've done wrong here, anyone know the fix?