def test_Coding_no_utr_degenerate_return(): """UTRs may be missing.""" crossmap = Coding([(10, 11)], (10, 11)) assert crossmap.coordinate_to_coding(8, True) == (-2, 0, -1, -2) assert crossmap.coordinate_to_coding(9, True) == (-1, 0, -1, -1) assert crossmap.coordinate_to_coding(11, True) == (1, 0, 1, 1) assert crossmap.coordinate_to_coding(12, True) == (2, 0, 1, 2)
def test_Coding_inverted_degenerate_no_return(): """Degenerate internal positions do not exist.""" crossmap = Coding([(10, 20), (30, 40)], (10, 40), True) assert (crossmap.coordinate_to_coding(25) == crossmap.coordinate_to_coding(25, True))
def test_Coding_inverted_degenerate_return(): """Degenerate upstream and downstream positions may be returned.""" crossmap = Coding([(10, 20)], (11, 19), True) assert crossmap.coordinate_to_coding(20, True) == (-2, 0, -1, -1) assert crossmap.coordinate_to_coding(9, True) == (2, 0, 1, 1)