def test_wildcards_in_adapter(): r = 'CATCTGTCC' + WILDCARD_SEQUENCES[0] + 'GCCAGGGTTGATTCGGCTGATCTGGCCG' for a in WILDCARD_SEQUENCES: result = locate(a, r, 0.0, BACK, wildcard_ref=True) assert result == (0, 10, 9, 19, 10, 0), result a = 'CCCXTTXATC' result = locate(a, r, 0.0, BACK, wildcard_ref=True) assert result is None
def test_wildcards_in_adapter(): r = 'CATCTGTCC' + WILDCARD_SEQUENCES[0] + 'GCCAGGGTTGATTCGGCTGATCTGGCCG' for a in WILDCARD_SEQUENCES: result = locate(a, r, 0.0, BACK, wildcard_ref=True) assert result == (0, 10, 9, 19, 10, 0), result a = 'CCCXTTXATC' result = locate(a, r, 0.0, BACK, wildcard_ref=True) assert result is None
def test_wildcards_in_both(): for a in WILDCARD_SEQUENCES: for s in WILDCARD_SEQUENCES: if 'X' in s or 'X' in a: continue r = 'CATCTGTCC' + s + 'GCCAGGGTTGATTCGGCTGATCTGGCCG' result = locate(a, r, 0.0, BACK, wildcard_ref=True, wildcard_query=True) assert result == (0, 10, 9, 19, 10, 0), result
def test_wildcards_in_both(): for a in WILDCARD_SEQUENCES: for s in WILDCARD_SEQUENCES: if 'X' in s or 'X' in a: continue r = 'CATCTGTCC' + s + 'GCCAGGGTTGATTCGGCTGATCTGGCCG' result = locate(a, r, 0.0, BACK, wildcard_ref=True, wildcard_query=True) assert result == (0, 10, 9, 19, 10, 0), result
def test_wildcards_in_read(): a = WILDCARD_SEQUENCES[0] for s in WILDCARD_SEQUENCES: r = 'CATCTGTCC' + s + 'GCCAGGGTTGATTCGGCTGATCTGGCCG' result = locate(a, r, 0.0, BACK, wildcard_query=True) if 'X' in s: assert result is None else: assert result == (0, 10, 9, 19, 10, 0), result
def test_wildcards_in_read(): a = WILDCARD_SEQUENCES[0] for s in WILDCARD_SEQUENCES: r = 'CATCTGTCC' + s + 'GCCAGGGTTGATTCGGCTGATCTGGCCG' result = locate(a, r, 0.0, BACK, wildcard_query=True) if 'X' in s: assert result is None else: assert result == (0, 10, 9, 19, 10, 0), result
def test_polya(): s = 'AAAAAAAAAAAAAAAAA' t = 'ACAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' result = locate(s, t, 0.0, BACK) # start_s, stop_s, start_t, stop_t, matches, cost = result assert result == (0, len(s), 4, 4 + len(s), len(s), 0)
def test_no_match(): a = locate('CTGATCTGGCCG', 'AAAAGGG', 0.1, BACK) assert a is None, a
def test_polya(): s = 'AAAAAAAAAAAAAAAAA' t = 'ACAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' result = locate(s, t, 0.0, BACK) #start_s, stop_s, start_t, stop_t, matches, cost = result assert result == (0, len(s), 4, 4 + len(s), len(s), 0)
def test_no_match(): a = locate('CTGATCTGGCCG', 'AAAAGGG', 0.1, BACK) assert a is None, a