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 test5(): """ Tests is_palindrome function. :return: None """ print("Test5: testing is_palindrome") dna_seq = None print(dna.is_palindrome(dna_seq) == True, end=" ") dna_seq = linked_code.insert_at(0, "A", dna_seq) print(dna.is_palindrome(dna_seq) == True, end=" ") dna_seq = linked_code.insert_at(0, "T", dna_seq) print(dna.is_palindrome(dna_seq) == False, end=" ") dna_seq = linked_code.remove_at(0, dna_seq) dna_seq = linked_code.insert_at(0, "A", dna_seq) print(dna.is_palindrome(dna_seq) == True, end=" ") dna_seq = linked_code.insert_at(1, "G", dna_seq) print(dna.is_palindrome(dna_seq) == True, end=" ") dna_seq = linked_code.insert_at(2, "T", dna_seq) print(dna.is_palindrome(dna_seq) == False)