-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
100 lines (87 loc) · 3.63 KB
/
main.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
from Ultratherm.nucl import nucl_acid, nucl_set, nucl_hybrid
from Ultratherm.blist import blacklist
from Bio.Seq import Seq
from Ultratherm.params import design_parameters, read_parameters
from Ultratherm.des import design
# NOTE Customize these!
def rna_thermometer_prok():
#Configure design parameters
blist = blacklist(path="blacklist.fasta")
des_params = design_parameters(blacklist=blist, target_temp=42, program='VIENNA',
num_mutants=8, target_energy=-6, # based on http://dx.doi.org/10.1101/017269
weights=[32, 32, 32, 32, 32, 32, 16],
thermo_score_temp=30,
max_reps=16,
max_hairpins=1,
accessibility_max_score=3,
parasitic_complex_max_score=0,
optimization_rate=3,
temp_offset=10
)
#Create nucleotide set
nucl_pool = nucl_set(nucls = [])
for i in range(0, 64):
new_nucl = nucl_acid(sequence=Seq('GNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNUAAGGAGGNNNNNNAUGAGUAAAGGC'),
no_indel = [0]+[0]*40+[1]*26,
no_mod = [1]+[0]*40+[1]*8+[0]*6+[1]*12,
score_region = [0]+[0]*40+[1]*8+[0]*6+[0]*12,
is_rna=True)
new_nucl.fitness_score(design_parameters=des_params)
nucl_pool.append(new_nucl=new_nucl)
#Start design loop
design(design_parameters=des_params, nucl_pool=nucl_pool)
def rna_thermometer_euk_fiveprime():
#Configure design parameters
blist = blacklist(path="blacklist.fasta")
des_params = design_parameters(blacklist=blist, target_temp=62, program='VIENNA',
num_mutants=8, target_energy=-13.15,
weights=[32, 32, 32, 32, 32, 32, 16], optimization_rate=10
)
#Create nucleotide set
nucl_pool = nucl_set(nucls = [])
for i in range(0, 8):
new_nucl = nucl_acid(sequence=Seq('GAANNNNNNNNNNNNNNNNNNNN'), # Optimal for non-5'capped mRNAs (i.e. T7)
no_indel = [1]*3+[0]*20,
no_mod = [1]*3+[0]*20,
score_region = [1]*3+[0]*20,
is_rna=True)
new_nucl.fitness_score(design_parameters=des_params)
nucl_pool.append(new_nucl=new_nucl)
#Start design loop
design(design_parameters=des_params, nucl_pool=nucl_pool)
def heteroduplex():
#Configure design parameters
blist = blacklist(path="blacklist.fasta")
des_params = design_parameters(blacklist=blist, target_temp=62, program='VIENNA',
num_mutants=8, target_energy=-13.15,
weights=[32, 32, 32, 32, 32, 32, 16], optimization_rate=10
)
#Create nucleotide set
nucl_pool = nucl_set(nucls = [])
for i in range(0, 8):
new_nucl_1 = nucl_acid(sequence=Seq('GAANNNNNNNNNNNNNNNNN'), # Optimal for non-5'capped mRNAs (i.e. T7)
no_indel = [1]*3+[0]*17,
no_mod = [1]*3+[0]*17,
score_region = [1]*3+[0]*17,
is_rna=True) # Limitation - heteroduplices not supported. Standard is to model as RNA
new_nucl_2 = nucl_acid(sequence=Seq('NNNNNNNNNNNNNNNNNNNN'),
no_indel = [0]*20,
no_mod = [0]*20,
score_region = [0]*20,
is_rna=True) # Limitation - heteroduplices not supported. Standard is to model as RNA
new_nucl = nucl_hybrid(new_nucl_1, new_nucl_2, True, False)
new_nucl.fitness_score(design_parameters=des_params)
nucl_pool.append(new_nucl=new_nucl)
#Start design loop
design(design_parameters=des_params, nucl_pool=nucl_pool)
#####
### # # # #
# # # # ## #
## # # # ##
# # ### # #
#####
if __name__ == '__main__':
rna_thermometer_prok()
#rna_thermometer_euk_fiveprime()
#heteroduplex()
pass