def test_score():
    test_table = dp_table.DPTable("GCCCT", "GCGCA")
    test_table.build_table()
    test_table.base_cases()
    test_table.fill_matrix()
    test_table.get_score()
    utils.print_table(test_table.table)
    print(test_table.score)
def test_backtrack():
    test_table = dp_table.DPTable("GCCCT", "GCGCA")
    test_table.build_table()
    test_table.base_cases()
    test_table.fill_matrix()
    utils.print_table(test_table.table)
    test_table.backtrack()
    print(test_table.aligned1)
    print(test_table.aligned2)
Beispiel #3
0
def main():
    seq_1, seq_2 = parse_args()

    # Calculate and display Needleman-Wunsch
    print('Needleman-Wunsch alignment:\n')
    nw_table = dp_table.DPTable(seq_1, seq_2)
    nw_table.calculate_alignment()
    # utils.print_table(nw_table.table)

    print('Score: {}'.format(nw_table.score))
    utils.print_alignment(nw_table.aligned1, nw_table.aligned2)

    # Calculate and display Smith-Waterman
    print('\n\nSmith-Waterman alignment:\n')
    sw_table = smith_waterman.SmithWaterman(seq_1, seq_2)
    sw_table.calculate_alignment()
    # utils.print_table(sw_table.table)

    print('Score: {}'.format(sw_table.score))
    print('Local alignment:')
    utils.print_alignment(sw_table.alignment_1, sw_table.alignment_2)
def test_base_cases():
    test_table = dp_table.DPTable("12345", "12345")
    test_table.build_table()
    test_table.base_cases()
    utils.print_table(test_table.table)
def test_calc_value():
    test_table = dp_table.DPTable("GCCCT", "GCGCA")
    test_table.build_table()
    test_table.base_cases()
    test_table.fill_matrix()
    utils.print_table(test_table.table)