CLAM.lite_aligner.py 文件源码

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

项目:CLAM 作者: Xinglab 项目源码 文件源码
def search_node_subg(node, location_to_reads, read_to_locations, seen):
    """
    Extract the complete independent subgraph given a node, and add all subgraph nodes into the record.
    Returns the nodes in this subgraph and updated record.
    """
    if node in seen:
        return None, seen
    tmp_net=set()
    queue=[node]
    while(len(queue)>0):        
        map(tmp_net.add, queue)
        map(seen.add, queue)
        new_queue=deque([])
        for x in queue:
            x_reads=location_to_reads[x]
            new_queue.extend([next_node for x_read in x_reads for next_node in read_to_locations[x_read] if not next_node in tmp_net])
        queue=list(set(new_queue))
    subg=list(set(tmp_net))
    return subg, seen
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号