widget4.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:MMinte 作者: mendessoares 项目源码 文件源码
def replaceRxns(model,modelID):    
    '''
    This function adds the tag specified in the parameter modelID to the beginning of the reaction IDs for a particular Model object. We are doing this so that we know which reactions come from one species or the other. This is the same as assigning each species to a different compartment. This is important because the two species have common reactions and metabolites, but are not sharing these metabolites in their biology, since the cells are closed compartments. They only share the metabolites that are transported in and out of the cell, hence the creation of an extra external compartment.

    :param model: Model object containing the metabolic model of a particular species
    :param modelID: Tag to add to the beginning of the reaction IDs of the model.
    :return model: same model but with updated reactions IDs
    '''


    cherrypy.log('Started function to replace the reaction IDs in the species models')


    for i in range(len(model.reactions)):
        old_rxns = str(model.reactions[i])
        new_rxns = 'model' + modelID + '_' + old_rxns
        model.reactions[i].id = new_rxns

    cherrypy.log('Finished changing the reaction IDs in the species models')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号