-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsynth.py
executable file
·75 lines (59 loc) · 1.74 KB
/
synth.py
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/usr/bin/env python3
from Bio.Seq import Seq
from Bio.Alphabet import IUPAC
n = 600
# raw_rna = """
# AGGGCCACAUCCCACUGCCA
# """.strip()
raw_rna = """
CGUCACCCUCCUCAAGUAUACUUCAAAGGACAUUUAACUAAAACCCCUACGCAUUUAUAUAGAGGAGACAAGUCG
""".strip()
seq_rna = Seq(raw_rna, IUPAC.unambiguous_rna)
seq_dna = seq_rna.back_transcribe()
A = "taatacgactcactatagggaga"
E = ""
B = seq_dna[-8:]
D = seq_dna[0:4]
C = Seq('')
# parts = [A, B, C, D, E]
# template = sum(parts, Seq(""))
template = Seq("")
while (len(template) + len(seq_dna) <= n):
C += seq_dna
# parts = [A, B, C, D, E]
# template = sum(parts, Seq(""))
template = sum([A, B, C, D, E], Seq(""))
print("DNA Template (5' - 3'):")
# print(len(template))
print(template.upper())
print()
# Cleavage Guide
# prime5Flank = D.complement().transcribe()[::-1]
prime5Flank = D.reverse_complement().transcribe()
# center = B[4:].complement()[::-1]
center = B[4:].reverse_complement()
# prime3Flank = B[:4].complement().transcribe()[::-1]
prime3Flank = B[:4].reverse_complement().transcribe()
print("Cleavage Guide (5' - 3'):")
print(' '.join(["m" + nt for nt in prime5Flank]))
print(' '.join(center.lower()))
print(' '.join(["m" + nt for nt in prime3Flank]))
print()
# print(D.complement().transcribe()[::-1])
# print(D.reverse_complement().transcribe())
# print()
# print(B[4:].complement()[::-1])
# print(B[4:].reverse_complement())
# print()
# print(B[:4].complement().transcribe()[::-1])
# print(B[:4].reverse_complement().transcribe())
# if __name__ == "__main__":
# dna_template = construct_dna_template()
# cleavage_guide = construct_cleavage_guide()
#
# print("DNA Template (5' - 3'):")
# print(dna_template)
# print()
# print("Cleavage Guide (5' - 3'):")
# print(cleavage_guide)
# print()