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
4b556f0c
Commit
4b556f0c
authored
May 25, 2018
by
Carlos GO
Browse files
parse
parent
cfdc4738
Changes
1
Hide whitespace changes
Inline
Side-by-side
parse.py
View file @
4b556f0c
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
(
"Mu
tation
s"
)
plt
.
ylabel
(
"
Multiloop frequenc
y"
)
plt
.
title
(
"Energy based mutation rate
c=3 a=15
"
)
plt
.
savefig
(
"multi
s_adapt_a15
_mut.pdf"
,
format
=
"pdf"
)
plt
.
xlabel
(
"Mu
ltiloop
s"
)
plt
.
ylabel
(
"
Energ
y"
)
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
=
'
gener
ations'
)
dfs
=
(
pd
.
read_csv
(
f
"maternal_
lehm
_
{
i
}
.csv"
)
for
i
in
range
(
20
))
struc_plot
(
dfs
,
sse
=
'multi'
,
mode
=
'
mut
ations'
)
# mut_plot()
pass
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