Exemple #1
0
 lp.eraseHistory()
 if os.path.exists('blocked.pcl'):
     blocked = pickle.load(open('blocked.pcl'))
 else:
     # blocked = Variability(lp).getBlocked(['R("R_Ec_biomass_iAF1260_core_59p81M")', 'R("R_AGPR")'])
     blocked = Variability(lp).getBlocked()
     sys.exit()
     pickle.dump(blocked, open('blocked.pcl', 'w'))
 print blocked
 print len(blocked)
 lp.deleteReactionsFromStoich(blocked)
 lp.eraseHistory()
 ids = list(set(lp.getColumnIDs()) - set(lp.getTransporters()))
 print ids
 print len(ids)
 lp.addNegativeColumnSwitches(ids)
 # lp.addNegativeColumnSwitches(['R("Mo2b_Transp")'])
 lp.modifyColumnBounds({'R("R_Ec_biomass_iAF1260_core_59p81M")': (1., 100.)})
 binColumns = lp.getColumnsOfType('binary')
 objDict = dict()
 for i in binColumns:
     objDict[i] = 1.
 lp.setObjective(objDict)
 WriteCplex(lp, 'debug.lp')
 lp.toggleVerbosity()
 lp.fba()
 try:
     lp.fba(method='intopt')
 except:
     pass
 lp.mipValues()