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
18445c39
Commit
18445c39
authored
May 11, 2009
by
Tiago Peixoto
Browse files
Allow choosing of different shuffling strategies in motif profile code
parent
a5eabf2b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/graph_tool/clustering/__init__.py
View file @
18445c39
...
...
@@ -376,7 +376,8 @@ def motifs(g, k, p=1.0, motif_list=None, undirected=None, seed=0):
def
motif_significance
(
g
,
k
,
n_shuffles
=
10
,
p
=
1.0
,
motif_list
=
None
,
undirected
=
None
,
self_loops
=
False
,
parallel_edges
=
False
,
full_output
=
False
,
seed
=
0
):
full_output
=
False
,
shuffle_strategy
=
"uncorrelated"
,
seed
=
0
):
r
"""
Obtain the motif significance profile, for subgraphs with k vertices. A
tuple with two lists is returned: the list of motifs found, and their
...
...
@@ -411,6 +412,9 @@ def motif_significance(g, k, n_shuffles=10, p=1.0, motif_list=None,
of each motif, the average count of each motif in the shuffled networks,
and the standard deviation of the average count of each motif in the
shuffled networks.
shuffle_strategy : string, optional (default: "uncorrelated")
Shuffle strategy to use. Can be either "correlated" or "uncorrelated".
See random_rewire() for details.
seed : int, optional (default: 0)
Seed for the random number generator. It the value is 0, a random seed
is used.
...
...
@@ -469,7 +473,8 @@ def motif_significance(g, k, n_shuffles=10, p=1.0, motif_list=None,
# get samples
sg
=
g
.
copy
()
for
i
in
xrange
(
0
,
n_shuffles
):
random_rewire
(
sg
,
self_loops
=
self_loops
,
parallel_edges
=
parallel_edges
)
random_rewire
(
sg
,
shuffle_strategy
,
self_loops
=
self_loops
,
parallel_edges
=
parallel_edges
)
m_temp
,
count_temp
=
motifs
(
sg
,
k
,
p
,
motif_list
,
undirected
,
seed
)
for
j
in
xrange
(
0
,
len
(
m_temp
)):
found
=
False
...
...
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