get_reads.py 文件源码

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

项目:NAIBR 作者: raphael-group 项目源码 文件源码
def get_candidates(discs,reads_by_LR):
    candidates = []
    r = lmax
    p_len,p_rate,barcode_overlap = get_distributions(reads_by_LR)
    if p_len == None or p_rate == None:
        return None,None,None
    num_cands = 0
    for key,items in iteritems(discs):
        orient = key[4]
        si,ei,sj,ej = disc_intersection(items)
        if si and sj and len(items) >= MIN_DISCS:
            i = coordinates(si,ei,orient[0])
            j = coordinates(sj,ej,orient[1])
            cand = copy.copy(items[0])
            cand.i = i
            cand.j = j
            barcode_overlaps = barcode_overlap[(cand.chrm,int(cand.i/d)*d,cand.nextchrm,int(cand.j/d)*d)]
            if not inblacklist(cand) and ((cand.chrm == cand.nextchrm and cand.j-cand.i < d)\
                or barcode_overlaps >= k):
                already_appended = sum([1 for x in candidates if x.i == cand.i and x.j == cand.j])
                if not already_appended:
                    num_cands += 1
                    candidates.append(cand)
    return candidates,p_len,p_rate
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号