Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tiago Peixoto
graph-tool
Commits
8a5b5c24
Commit
8a5b5c24
authored
Jul 14, 2014
by
Tiago Peixoto
Browse files
Fix ordering of motif vertex maps in motifs()
parent
9b31eeae
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/graph_tool/clustering/__init__.py
View file @
8a5b5c24
...
...
@@ -398,7 +398,10 @@ def motifs(g, k, p=1.0, motif_list=None, return_maps=False):
temp
.
append
(
mg
)
sub_list
=
temp
list_hist
=
list
(
zip
(
sub_list
,
hist
))
if
return_maps
:
list_hist
=
list
(
zip
(
sub_list
,
hist
,
vertex_maps
))
else
:
list_hist
=
list
(
zip
(
sub_list
,
hist
))
# sort according to in-degree sequence
list_hist
.
sort
(
key
=
lambda
x
:
sorted
([
v
.
in_degree
()
for
v
in
x
[
0
].
vertices
()]))
...
...
@@ -412,6 +415,7 @@ def motifs(g, k, p=1.0, motif_list=None, return_maps=False):
hist
=
[
x
[
1
]
for
x
in
list_hist
]
if
return_maps
:
vertex_maps
=
[
x
[
2
]
for
x
in
list_hist
]
for
i
,
vlist
in
enumerate
(
vertex_maps
):
sub
=
sub_list
[
i
]
vertex_maps
[
i
]
=
[
PropertyMap
(
vm
,
sub
,
"v"
)
for
vm
in
vlist
]
...
...
Write
Preview
Supports
Markdown
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