INNER CODE UNIT · Python
vs_each_control
BirolLab/straglr · straglr_compare.py:86
def vs_each_control(test_bed, control_bed, pval_cutoff, min_expansion=0, min_support=0, label=None):
expanded_loci = {}
new_loci = []
common_loci = []
for cols in test_bed.intersect(control_bed, loj=True, wao=True, f=0.9):
if cols[-2] == '.':
new_loci.append(cols)
else:
common_loci.append(cols)
for cols in test_bed.intersect(control_bed, loj=True, wao=True, F=0.9):
if cols[-2] != '.' and cols in new_loci:
common_loci.append(tuple(cols))
new_loci.remove(cols)
for cols in new_loci:
locus = (cols[0], int(cols[1]), int(cols[2]), cols[3], float(cols[4]))
ref_size = locus[-1]
test_alleles = []