Example #1
0
def test_init_graph_nodes():
    gc = GenomCompare(same=5, diff=-5, gp=-2, max_paths=100, max_seq_len=100)
    seq1 = 'MARS'
    seq2 = 'SMART'
    _, G = gc._initialize_structures(seq1, seq2)
    assert list(G.nodes()) == [(0, 0), (1, 0), (2, 0), (3, 0), (4, 0), (0, 1),
                               (0, 2), (0, 3), (0, 4), (0, 5)]
Example #2
0
def test_init_matrix_values():
    gc = GenomCompare(same=5, diff=-5, gp=-2, max_paths=100, max_seq_len=100)
    seq1 = 'MARS'
    seq2 = 'SMART'
    matrix, _ = gc._initialize_structures(seq1, seq2)
    assert np.array_equal(
        matrix,
        np.array([[0, -2, -4, -6, -8, -10], [-2, 0, 0, 0, 0, 0],
                  [-4, 0, 0, 0, 0, 0], [-6, 0, 0, 0, 0, 0],
                  [-8, 0, 0, 0, 0, 0]]))
Example #3
0
def test_init_matrix_size():
    gc = GenomCompare(same=5, diff=-5, gp=-2, max_paths=100, max_seq_len=100)
    seq1 = 'MARS'
    seq2 = 'SMART'
    matrix, _ = gc._initialize_structures(seq1, seq2)
    assert matrix.shape == (5, 6)