crn.py 文件源码

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

项目:crnpy 作者: etonello 项目源码 文件源码
def dsr_graph_adj(self, keep = None):
        """Return the adjacency matrix of the directed species-reaction graph.

        Optionally remove the variables of the influence matrix not in *keep*.

        References:

        Feliu, E., & Wiuf, C. (2015). Finding the positive feedback loops underlying multi-stationarity. BMC systems biology, 9(1), 1

        """
        A = self.stoich_matrix
        im = self.influence_matrix()
        if keep is not None:
            im = im.applyfunc(lambda x: x if x in keep else 0)
        im = im.applyfunc(lambda x: -1 if str(x)[0] == "-" else (1 if x != 0 else 0))
        adjacency = sp.zeros(im.rows, im.rows).row_join(im).col_join(A.T.row_join(sp.zeros(A.cols, A.cols)))
        return adjacency


    ### Connectivity properties ###
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号