Skip to content

Commit 86ee772

Browse files
authored
Merge pull request #6 from erinyoung/erin-dev
Adjusted check after addition/subtraction
2 parents 5205d45 + 64fa7d8 commit 86ee772

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

bin/groups.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,24 @@
4141
match_start = int(end2) + int(end_diff)
4242
match_end = int(start2) - int(start_diff)
4343

44+
if str(match_start) not in divided[chr2].keys():
45+
for potential_start in divided[chr2].keys():
46+
if (int(potential_start) - 20) <= match_start <= (int(potential_start) + 20):
47+
match_start=int(potential_start)
48+
49+
# sometimes there are small indels
50+
if str(match_start) in divided[chr2].keys():
51+
if int(divided[chr2][str(match_start)]) != int(match_end):
52+
match_end=int(divided[chr2][str(match_start)])
53+
4454
saved_line2= chr2 + ":" + str(match_start) + ":" + str(match_end)
4555
new_group = True
4656

4757
for numbers in group.keys():
4858
if saved_line in group[numbers]['list']:
4959
new_group = False
5060
if (saved_line2 not in group[numbers]['list']) and (start2 in divided[chr2].keys()):
51-
group[numbers]['list'].append(saved_line2)
61+
group[numbers]['list'].append(saved_line2)
5262
elif saved_line2 in group[numbers]['list']:
5363
new_group = False
5464
if saved_line not in group[numbers]['list']:

0 commit comments

Comments
 (0)