Skip to content

Commit

Permalink
Updated reporting of *13 tandem arrangements
Browse files Browse the repository at this point in the history
  • Loading branch information
xiao-chen-xc committed May 3, 2021
1 parent 0031eeb commit 28b53f4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
12 changes: 8 additions & 4 deletions caller/match_star_allele.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,14 @@ def get_final_call_clean(final_call, cnvcall, spacer_cn):
return "*13/" + split_call[0]
return None
if cnvcall == "dup_star13intron1":
if split_call.count("*2") >= 2:
split_call.remove("*2")
split_call.remove("*2")
return "*13+*2/" + split_call[0]
unique_stars = list(set(split_call))
if len(unique_stars) == 2:
if split_call.count(unique_stars[0]) == 2:
return "*13+" + unique_stars[0] + "/" + unique_stars[1]
elif split_call.count(unique_stars[1]) == 2:
return "*13+" + unique_stars[1] + "/" + unique_stars[0]
elif len(unique_stars) == 1:
return "*13+" + unique_stars[0] + "/" + unique_stars[0]
return None
if cnvcall == "dup_star13":
if spacer_cn is not None and spacer_cn == 1:
Expand Down
10 changes: 10 additions & 0 deletions caller/tests/test_match_star.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,16 @@ def test_clean_call(self):
clean_call = get_final_call_clean(final_call, cnvcall, spacer_cn)
assert clean_call == "*13+*2/*1"

cnvcall = "dup_star13intron1"
final_call = ["*9_*4_*4"]
clean_call = get_final_call_clean(final_call, cnvcall, spacer_cn)
assert clean_call == "*13+*4/*9"

cnvcall = "dup_star13intron1"
final_call = ["*4_*4_*4"]
clean_call = get_final_call_clean(final_call, cnvcall, spacer_cn)
assert clean_call == "*13+*4/*4"

cnvcall = "dup_star13"
final_call = ["*1_*2"]
spacer_cn = None
Expand Down

0 comments on commit 28b53f4

Please sign in to comment.