Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Carlos GO
mateRNAl
Commits
e5284691
Commit
e5284691
authored
Apr 08, 2018
by
Carlos GO
Browse files
adaptive mutation rate with option mutation_rate=-1
parent
6edb4035
Changes
1
Hide whitespace changes
Inline
Side-by-side
mateRNAl.py
View file @
e5284691
...
...
@@ -159,6 +159,13 @@ def populate(size, length, gc, fit="energy", target=None):
def
mutate
(
rna
,
mutation_rate
):
mutations
=
0
new_seq
=
""
#if adaptive mutation rate, mutation rate is a function of stability.
if
mutation_rate
==
-
1
:
sig
=
lambda
e
:
1
/
(
1
+
np
.
exp
(
-
e
))
mutation_rate
=
sig
(
rna
.
energy
)
pass
for
s
in
rna
.
sequence
:
r
=
random
.
random
()
if
r
<
mutation_rate
:
...
...
@@ -314,3 +321,6 @@ def start(generations=20, size=10, length=50, fit='energy', gc=0.5,\
pool
.
map
(
evolve
,
todo
)
else
:
evolve
(
next
(
todo
))
if
__name__
==
"__main__"
:
start
(
mutation_rate
=-
1
,
dest
=
"maternal_adaptive.csv"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment