def test_all(): """ Large test that calls all functions. :return: None """ print("Testing all functionality") dna_seq1 = dna.convert_to_nodes("ATGCCAATGC") dna_seq2 = dna.deletion(dna_seq1, 3, 5) dna_seq3 = dna.duplication(dna_seq2, 0, 3) dna_seq4 = dna.convert_to_nodes("CC") dna_seq5 = dna.insertion(dna_seq3, dna_seq4, 3) dna_seq6 = dna.substitution(dna_seq5, 7, "T") dna_seq7 = dna.substitution(dna_seq6, 6, "A") print(dna.is_match(dna_seq1, dna_seq7), end=" ") dna_seq8 = dna.insertion(dna_seq3, dna_seq4, 0) dna_seq9 = dna.deletion(dna_seq8, 2, 2) dna_seq10 = dna.substitution(dna_seq9, 6, "C") dna_seq11 = dna.substitution(dna_seq10, 3, "T") print(dna.is_palindrome(dna_seq11), end=" ") dna_seq12 = dna.convert_to_nodes("TACG") dna_seq13 = dna.duplication(dna_seq12, 0, 4) dna_seq14 = dna.duplication(dna_seq13, 3, 1) dna_seq15 = dna.duplication(dna_seq14, 5, 1) print(dna.is_pairing(dna_seq1, dna_seq15), end=" ") print(dna.convert_to_string(dna_seq11) == "CCGTTGCC")
def test3(): """ Tests is_match function. :return: None """ print("Test3: testing is_match") dna_seq1 = None dna_seq2 = None print(dna.is_match(dna_seq1, dna_seq2) == True, end=" ") dna_seq2 = linked_code.insert_at(0, "A", dna_seq2) print(dna.is_match(dna_seq1, dna_seq2) == False, end=" ") print(dna.is_match(dna_seq2, dna_seq1) == False, end=" ") dna_seq1 = linked_code.insert_at(0, "A", dna_seq1) print(dna.is_match(dna_seq1, dna_seq2) == True, end=" ") dna_seq1 = linked_code.insert_at(1, "T", dna_seq1) dna_seq1 = linked_code.insert_at(2, "G", dna_seq1) dna_seq1 = linked_code.insert_at(3, "C", dna_seq1) dna_seq2 = linked_code.insert_at(1, "T", dna_seq2) dna_seq2 = linked_code.insert_at(2, "G", dna_seq2) print(dna.is_match(dna_seq1, dna_seq2) == False, end=" ") dna_seq2 = linked_code.insert_at(3, "C", dna_seq2) print(dna.is_match(dna_seq1, dna_seq2) == True, end=" ") dna_seq1 = linked_code.insert_at(2, "A", dna_seq1) dna_seq2 = linked_code.insert_at(2, "G", dna_seq2) print(dna.is_match(dna_seq1, dna_seq2) == False)