Skip to content

Commit

Permalink
Updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xiao-chen-xc committed Jul 14, 2020
1 parent 15008c9 commit caa0fe5
Showing 1 changed file with 43 additions and 7 deletions.
50 changes: 43 additions & 7 deletions caller/tests/test_cnv_hybrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
from ..cnv_hybrid import get_cnvtag


TOTAL_SITE = 116
TOTAL_SITE = 117
cn_regions = namedtuple(
"cn_regions", "rep exon9_and_downstream exon9_to_intron1 intron1_upstream"
"cn_regions",
"rep exon9_and_downstream exon9_to_intron4 intron4_to_intron1 intron1_upstream",
)


Expand All @@ -43,25 +44,37 @@ def test_get_cnvtag(self):
)
assert cnvtag[0] == "cn3"

cn_call_per_site = [2] * 8 + [3] * (TOTAL_SITE - 8)
cn_call_per_site = [2] * 9 + [3] * (TOTAL_SITE - 9)
rawv = cn_call_per_site
exon9gc_call_stringent = 2
spacer_cn = 3
cnvtag = get_cnvtag(
total_cn, rawv, cn_call_per_site, exon9gc_call_stringent, spacer_cn
)
assert cnvtag[0] == "exon9hyb"
assert cnvtag[1] == cn_regions(2, 2, 3, 3)
assert cnvtag[1] == cn_regions(2, 2, 3, 3, 3)

cn_call_per_site = [2] * 3 + [1] * 4 + [2] + [3] * (TOTAL_SITE - 8)
# *10D
cn_call_per_site = [2] * 7 + [3] * (TOTAL_SITE - 7)
rawv = cn_call_per_site
exon9gc_call_stringent = 3
spacer_cn = 3
cnvtag = get_cnvtag(
total_cn, rawv, cn_call_per_site, exon9gc_call_stringent, spacer_cn
)
assert cnvtag[0] == "cn3"
assert cnvtag[1] == cn_regions(2, 3, 3, 3, 3)

# conversion to CYP2D7 downstream of the gene
cn_call_per_site = [2] * 3 + [1] * 4 + [2, 2] + [3] * (TOTAL_SITE - 9)
rawv = cn_call_per_site
exon9gc_call_stringent = 2
spacer_cn = 4
cnvtag = get_cnvtag(
total_cn, rawv, cn_call_per_site, exon9gc_call_stringent, spacer_cn
)
assert cnvtag[0] == "exon9hyb"
assert cnvtag[1] == cn_regions(2, 2, 3, 3)
assert cnvtag[1] == cn_regions(2, 2, 3, 3, 3)

cn_call_per_site = [2] * 74 + [3] * (TOTAL_SITE - 74)
rawv = cn_call_per_site
Expand All @@ -83,11 +96,34 @@ def test_get_cnvtag(self):
assert cnvtag[0] == "dup_star68"

total_cn = 4
cn_call_per_site = [2] * 3 + [1] * 5 + [2] * (TOTAL_SITE - 8)
cn_call_per_site = [2] * 3 + [1] * 6 + [2] * (TOTAL_SITE - 9)
rawv = cn_call_per_site
exon9gc_call_stringent = 1
spacer_cn = 3
cnvtag = get_cnvtag(
total_cn, rawv, cn_call_per_site, exon9gc_call_stringent, spacer_cn
)
assert cnvtag[0] == "exon9hyb_star5"

# exon 9 gene conversion
total_cn = 4
cn_call_per_site = [2] * 7 + [1] * 2 + [2] * (TOTAL_SITE - 9)
rawv = cn_call_per_site
exon9gc_call_stringent = 1
spacer_cn = 2
cnvtag = get_cnvtag(
total_cn, rawv, cn_call_per_site, exon9gc_call_stringent, spacer_cn
)
assert cnvtag[0] == "cn2"

# fusion deletion with breakpoint in intron4
total_cn = 3
cn_call_per_site = [2] * 40 + [1] * (TOTAL_SITE - 40)
rawv = cn_call_per_site
exon9gc_call_stringent = 2
spacer_cn = 1
cnvtag = get_cnvtag(
total_cn, rawv, cn_call_per_site, exon9gc_call_stringent, spacer_cn
)
assert cnvtag[0] == "star13intron1"
assert cnvtag[1] == cn_regions(2, 2, 2, 1, 1)

0 comments on commit caa0fe5

Please sign in to comment.