ontology.py 文件源码

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

项目:seqenv 作者: xapple 项目源码 文件源码
def get_subgraph(self, envos=None):
        """Given a list of ENVO terms, get the subgraph that contains them all
        and all their ancestors, up to the root.
        Outputs a networkx DiGraph object."""
        # Testing mode #
        if envos is None: envos = test_envos
        # All nodes #
        nodes = set(n for e in envos for n in networkx.descendants(self.networkx, e))
        nodes.update(envos)
        nodes = list(nodes)
        # Return #
        return self.networkx.subgraph(nodes)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号