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 test4(): """ Tests is_pairing function. :return: None """ print("Test4: testing is_pairing") dna_seq1 = None dna_seq2 = None print(dna.is_pairing(dna_seq1, dna_seq2) == True, end=" ") dna_seq2 = linked_code.insert_at(0, "A", dna_seq2) print(dna.is_pairing(dna_seq1, dna_seq2) == False, end=" ") print(dna.is_pairing(dna_seq2, dna_seq1) == False, end=" ") dna_seq1 = linked_code.insert_at(0, "T", dna_seq1) print(dna.is_pairing(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, "A", dna_seq2) dna_seq2 = linked_code.insert_at(2, "C", dna_seq2) print(dna.is_pairing(dna_seq1, dna_seq2) == False, end=" ") dna_seq2 = linked_code.insert_at(3, "G", dna_seq2) print(dna.is_pairing(dna_seq1, dna_seq2) == True, end=" ") dna_seq1 = linked_code.insert_at(2, "A", dna_seq1) dna_seq2 = linked_code.insert_at(2, "A", dna_seq2) print(dna.is_pairing(dna_seq1, dna_seq2) == False, end=" ") test_str1 = "AATTTGC" test_str2 = "GCGCTGC" for idx in range(len(test_str1)): dna_seq1 = linked_code.remove_at(2, dna_seq1) dna_seq2 = linked_code.remove_at(2, dna_seq2) dna_seq1 = linked_code.insert_at(2, test_str1[idx], dna_seq1) dna_seq2 = linked_code.insert_at(2, test_str2[idx], dna_seq2) print(dna.is_pairing(dna_seq1, dna_seq2) == False, end=" ") print()