Toggle navigation
Toggle navigation
This project
Loading...
Sign in
bioNLP-UNAM
/
related_regulators
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Ignacio Arroyo
2018-03-04 17:35:50 -0600
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8e189b5a4222053889ebf93a699a4d785810f0c4
8e189b5a
1 parent
6d797d15
PErsistencia para graficar lista
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
20 deletions
analyze_pair.py
persistence.csv
analyze_pair.py
View file @
8e189b5
...
...
@@ -3,7 +3,7 @@
import
os
import
matplotlib.pyplot
as
plt
from
numpy
import
log10
from
pdb
import
set_trace
as
st
def
analyze_pair
(
group_anlized
,
gropus_dir
,
rev
,
eigenvectors
,
fo
):
dic_part
=
{}
...
...
@@ -72,6 +72,9 @@ def get_cmap(n, name='hsv'):
return
plt
.
cm
.
get_cmap
(
name
,
n
)
plotting
=
False
out_file
=
"persistence.csv"
log
=
False
rev
=
120
ff
=
"report_persistence_.csv"
eigenvectors
=
"one-by-one/eigen_vectors/eigenBOs_120-eigens.txt"
...
...
@@ -95,22 +98,37 @@ for g in groups_analyzed:
rev
=
rev
,
eigenvectors
=
eigenvectors
,
fo
=
ff
)
plots
.
append
(
partition
)
fig
=
plt
.
figure
()
ax1
=
fig
.
add_subplot
(
111
)
for
i
,
p
in
enumerate
(
plots
):
if
" "
.
join
(
p
[
'tfs'
][
0
])
==
marked
:
width
=
6
mark
=
"D"
else
:
width
=
2
mark
=
""
ax1
.
plot
(
p
[
'part'
],
log10
(
p
[
'n_tfs'
]),
c
=
cmap
(
i
),
linewidth
=
width
,
marker
=
mark
,
label
=
" "
.
join
(
p
[
'tfs'
][
0
]))
plt
.
legend
(
loc
=
'upper right'
)
plt
.
title
(
"TF pair persistence through partitions of model resolution"
)
plt
.
xlabel
(
"Partition"
)
plt
.
ylabel
(
"Number of TFs (log_10)"
)
plt
.
show
()
if
plotting
:
fig
=
plt
.
figure
()
ax1
=
fig
.
add_subplot
(
111
)
for
i
,
p
in
enumerate
(
plots
):
if
" "
.
join
(
p
[
'tfs'
][
0
])
==
marked
:
width
=
6
mark
=
"D"
else
:
width
=
2
mark
=
""
ax1
.
plot
(
p
[
'part'
],
log10
(
p
[
'n_tfs'
])
if
log
else
p
[
'n_tfs'
],
c
=
cmap
(
i
),
linewidth
=
width
,
marker
=
mark
,
label
=
" "
.
join
(
p
[
'tfs'
][
0
]))
plt
.
legend
(
loc
=
'upper right'
)
plt
.
title
(
"TF pair persistence through partitions of model resolution"
)
plt
.
xlabel
(
"Partition"
)
plt
.
ylabel
(
"Number of TFs (log_10)"
)
plt
.
show
()
else
:
import
csv
lists
=
[]
pn
=
[
' '
]
+
list
(
plots
[
0
][
'part'
])
lists
.
append
(
pn
)
for
p
in
plots
:
lists
.
append
([
p
[
'tfs'
][
0
]]
+
list
(
p
[
'n_tfs'
]))
lists
.
append
([
p
[
'tfs'
][
0
]]
+
list
(
p
[
'tfs'
]))
with
open
(
out_file
,
'w'
)
as
f
:
writer
=
csv
.
writer
(
f
,
delimiter
=
'
\t
'
)
writer
.
writerows
(
zip
(
*
lists
))
...
...
persistence.csv
0 → 100644
View file @
8e189b5
This diff could not be displayed because it is too large.
Please
register
or
login
to post a comment