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

parse

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