Commit d88f4bc5 authored by Carlos GO's avatar Carlos GO
Browse files

parse

parent dd187c0f
......@@ -162,7 +162,7 @@ def mutate(rna, mutation_rate):
#if adaptive mutation rate, mutation rate is a function of stability.
if mutation_rate == -1:
sig = lambda e: 1 / (1 + np.exp(-e/10))
sig = lambda e: 1 / (3 + np.exp(-e/15))
mutation_rate = sig(rna.energy)
pass
......@@ -324,4 +324,4 @@ def start(generations=20, size=10, length=50, fit='energy', gc=0.5,\
if __name__ == "__main__":
start(mutation_rate=-1,verbose=True, generations=1000, size=1000, runs=20,\
dest="maternal_50_a10.csv", procs=10)
dest="maternal_50_a15.csv", procs=10)
......@@ -17,22 +17,31 @@ def mean_stats(dfs):
def struc_plot(dfs, sse='multi'):
dfs = (structure_info(df) for df in dfs)
strucs = pd.concat(dfs).groupby('mutations').mean()
print(strucs)
# dfs = (structure_info(df, sse='stack') for df in dfs)
# dfs = (structure_info(df, sse='internal') for df in dfs)
# strucs = pd.concat(dfs).groupby('generation').mean()
# strucs.to_csv("adapt_gen_15.csv")
# print(strucs)
strucs = pd.read_csv("adapt_mut_15.csv")
sse_mean = strucs[sse]
sns.tsplot(sse_mean)
plt.savefig("multis_adapt.pdf", format="pdf")
plt.xlabel("Mutations")
plt.ylabel("Multiloop frequency")
plt.title("Energy based mutation rate c=3 a=15")
plt.savefig("multis_adapt_a15_mut.pdf", format="pdf")
plt.show()
# print(sse_mean)
def mut_plot():
sig = lambda e: 1 / (1 + np.exp(-e/10))
plt.plot([sig(x) for x in np.arange(-30, 0, 1)])
sig = lambda e: 1 / (3 + np.exp(-e/15))
print(sig(-80))
plt.plot([sig(x) for x in np.arange(-80, 0, 1)])
plt.xticks(np.arange(0, 80, 10), np.arange(-80, 0, 10))
plt.show()
if __name__ == "__main__":
path = "maternal_50_adaptive_0.csv"
dfs = (pd.read_csv(f"maternal_50_a10_{i}.csv") for i in range(20))
dfs = (pd.read_csv(f"maternal_50_a15_{i}.csv") for i in range(20))
struc_plot(dfs, sse='multi')
# mut_plot()
pass
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment