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
57e94a06
Commit
57e94a06
authored
Apr 19, 2018
by
Carlos GO
Browse files
parse script
parent
a155db76
Changes
1
Hide whitespace changes
Inline
Side-by-side
parse.py
0 → 100644
View file @
57e94a06
import
numpy
as
np
import
pandas
as
pd
import
matplotlib.pyplot
as
plt
import
seaborn
as
sns
from
RNAstats
import
loop_counter
def
structure_info
(
df
,
sse
=
'multi'
):
"""
Compute counts for a given SSE feature.
"""
df
[
sse
]
=
df
[
'structure'
].
apply
(
lambda
x
:
loop_counter
(
x
)[
sse
])
return
df
def
struc_plot
(
df
,
sse
=
'multi'
):
df
=
structure_info
(
df
,
sse
=
sse
)
print
(
df
)
strucs
=
df
.
groupby
(
'mutations'
).
mean
()
sse_mean
=
strucs
[
sse
]
sns
.
tsplot
(
sse_mean
)
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
)])
plt
.
show
()
if
__name__
==
"__main__"
:
path
=
"maternal_50_adaptive_0.csv"
df
=
pd
.
read_csv
(
path
)
struc_plot
(
df
,
sse
=
'multi'
)
# 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