示例#1
0
def checkBlocked(model_path, reacs=None):
    lp = metabolism.Metabolism(util.ImportCplex(model_path))
    lp.simplex()
    print lp
    if reacs:
        result = analyseBlockedReactions(lp, reacs)
    else:
        result = analyseBlockedReactions(lp)
    return result
示例#2
0
def determineFreeReactions(lp, setCarbonSources, freeReacsSet=None):
    if not freeReacsSet:
        allReactions = lp.getReactions()
        freeReacsSet = set(allReactions)
    for carbSource in setCarbonSources:
        print 'length of freeReactionSet', len(freeReacsSet)
        print carbSource
        lp.modifyColumnBounds({carbSource:(0,20)})
        print 'normal FBA: ', lp.fba()[biom]
        blockedReactions = set(bc.analyseBlockedReactions(lp, freeReacsSet))
        lp.initialize()
        freeReacsSet.difference_update(blockedReactions)
        print 5*'\n'
    return freeReacsSet