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 ###
评论列表
文章目录