def test_compute_local_alignment():
    """
    Test the function compute_global_alignment function
    """
    suite = poc_simpletest.TestSuite()
    scoring_matrix = proj4_solution.build_scoring_matrix(set(["A", "C", "T", "G"]), 10, 4, -6)
    alignment_matrix = proj4_solution.compute_alignment_matrix("AA", "TAAT", scoring_matrix, False)
    local_alignment_sequence = proj4_solution.compute_local_alignment("AA", "TAAT", scoring_matrix, alignment_matrix)
    print local_alignment_sequence
    suite.run_test(local_alignment_sequence, (20, "AA", "AA"), "Error Found")

    scoring_matrix = proj4_solution.build_scoring_matrix(set(["A", "C", "T", "G"]), 10, 2, -4)
    alignment_matrix = proj4_solution.compute_alignment_matrix("---AC-C--", "TTTACACGG", scoring_matrix, False)
    local_alignment_sequence = proj4_solution.compute_local_alignment(
        "---AC-C--", "TTTACACGG", scoring_matrix, alignment_matrix
    )
    print local_alignment_sequence
    suite.run_test(local_alignment_sequence, (26, "AC-C", "ACAC"), "Error Found")

    local_alignment_sequence = proj4_solution.compute_local_alignment(
        "A",
        "A",
        {
            "A": {"A": 6, "C": 2, "-": -4, "T": 2, "G": 2},
            "C": {"A": 2, "C": 6, "-": -4, "T": 2, "G": 2},
            "-": {"A": -4, "C": -4, "-": -4, "T": -4, "G": -4},
            "G": {"A": 2, "C": 2, "-": -4, "T": 2, "G": 6},
        },
        [[0, 0], [0, 6]],
    )
    print local_alignment_sequence
    suite.run_test(local_alignment_sequence, (6, "A", "A"), "Error Found")

    suite.report_results()
def local_alignment_eyeless_protein():
    """
    Question: 1
    """
    human_eyeless_seq = provided.read_protein(provided.HUMAN_EYELESS_URL)
    fruitfly_eyeless_seq = provided.read_protein(provided.FRUITFLY_EYELESS_URL)
    scoring_matrix = provided.read_scoring_matrix(provided.PAM50_URL)
    alignment_matrix = student.compute_alignment_matrix(human_eyeless_seq, fruitfly_eyeless_seq, scoring_matrix, False)
    local_alignment = student.compute_local_alignment(human_eyeless_seq, fruitfly_eyeless_seq, scoring_matrix, alignment_matrix)
    return local_alignment