-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_reverse_complement_generation.py
More file actions
37 lines (32 loc) · 1.27 KB
/
test_reverse_complement_generation.py
File metadata and controls
37 lines (32 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from reverse_complement_generation import *
""""
This file tests the functions defined in reverse_complement_generation.py
Each section tests a function with print based outputs
"""
dna_sequence= "ATGRYCSWKM"
large_dna_sequence= "GATCA" * 100 + "N"
print("Test Case 1: 5'-3' Reverse Complement")
RC_5_3= generate_reverse_complement(dna_sequence,orientation= "5'-3'")
print(f"Oringinal sequence: {dna_sequence}")
print(f"Reverse complement sequence: {RC_5_3}")
print()
print("Test Case 2: 3'-5' Complement")
RC_3_5= generate_reverse_complement(dna_sequence,orientation= "3'-5'")
print(f"Oringinal sequence: {dna_sequence}")
print(f"Complement sequence: {RC_3_5}")
print()
print("Test Case 3: Large Sequence")
RC_large_sequence= generate_reverse_complement(large_dna_sequence,orientation= "5'-3'")
print(f"Oringinal sequence: {large_dna_sequence}")
print(f"Reverse complement sequence (first 20 bases): {RC_large_sequence[:20]}")
print()
print("Test Case 4- Error Handling")
try:
generate_reverse_complement("ATGUULLOO")
except InvalidNucleotideError as e:
print(f"Error caught: {e}")
print("Test Case 5: Invalid Orientation ")
try:
generate_reverse_complement("ATGC", orientation="5'-4'")
except ValueError as e:
print(f"Error caught: {e}")