Commit 4b556f0c authored by Carlos GO's avatar Carlos GO
Browse files


parent cfdc4738
import pickle
import numpy as np import numpy as np
import pandas as pd import pandas as pd
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
...@@ -16,15 +18,16 @@ def mean_stats(dfs, mode='mutations'): ...@@ -16,15 +18,16 @@ def mean_stats(dfs, mode='mutations'):
return pd.concat(list(dfs)).groupby(mode).mean() return pd.concat(list(dfs)).groupby(mode).mean()
def struc_plot(dfs, sse='multi', mode='mutations'): def struc_plot(dfs, sse='multi', mode='mutations'):
dfs = (structure_info(df) for df in dfs) # dfs = (structure_info(df) for df in dfs)
strucs = pd.concat(dfs).groupby(mode).mean() # strucs = pd.concat(dfs).groupby(mode).mean()
print(strucs) # pickle.dump(strucs, open("lehm_df_muts.csv", "wb"))
strucs = pickle.load(open("lehm_df_muts.csv", "rb"))
sse_mean = strucs[sse] sse_mean = strucs[sse]
sns.tsplot(sse_mean) sns.tsplot(sse_mean)
plt.xlabel("Mutations") plt.xlabel("Multiloops")
plt.ylabel("Multiloop frequency") plt.ylabel("Energy")
plt.title("Energy based mutation rate c=3 a=15") plt.title("Energy based mutation rate")
plt.savefig("multis_adapt_a15_mut.pdf", format="pdf") # plt.savefig("multi_lehm_mut.pdf", format="pdf")
# print(sse_mean) # print(sse_mean)
...@@ -37,7 +40,7 @@ def mut_plot(): ...@@ -37,7 +40,7 @@ def mut_plot():
if __name__ == "__main__": if __name__ == "__main__":
path = "maternal_50_adaptive_0.csv" path = "maternal_50_adaptive_0.csv"
dfs = (pd.read_csv(f"adaptive_run/maternal_50_a10_{i}.csv") for i in range(20)) dfs = (pd.read_csv(f"maternal_lehm_{i}.csv") for i in range(20))
struc_plot(dfs, sse='multi', mode='generations') struc_plot(dfs, sse='multi', mode='mutations')
# mut_plot() # mut_plot()
pass pass
Supports Markdown
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