Commit 5283221a authored by VIGNET Pierre's avatar VIGNET Pierre
Browse files

[cmd] Add graph_nodes_places

we remove the subset of transitions in order to have the real count of biological places/entities
parent 6064dee2
......@@ -362,6 +362,7 @@ def queries_2_common_graph(output_dir, model_file, path,
- events
- genes
- graph_nodes
- graph_nodes_places
- graph_edges
- strongly_connected
- max_degree
......@@ -474,7 +475,7 @@ def queries_2_common_graph(output_dir, model_file, path,
f_d,
[
"query", "solutions", "boundaries", "events", "genes",
"graph_nodes", "graph_edges",
"graph_nodes", "graph_nodes_places", "graph_edges",
"strongly_connected",
"max_degree", "min_degree", "average_degree",
],
......
......@@ -270,6 +270,9 @@ def get_solutions_graph_data(G, info, centralities):
- graph_nodes: Number of nodes
- graph_edges: Number of edges
- graph_nodes_places: Number of biological places/entities.
The graph is a false bipartite graph, we remove the subset of transitions
in order to have the real count of biological places/entities.
If centralities is True, the folliwing information are added to the a new
key named "centralities"::
......@@ -291,9 +294,17 @@ def get_solutions_graph_data(G, info, centralities):
:type info: <dict>
:type centralities: <boolean>
"""
# Get transition nodes
# See docstring...
transition_nodes = [
node for node, color in nx.get_node_attributes(G, 'color').items()
if color == "blue"
]
nb_nodes = len(G.nodes())
info.update({
'graph_nodes': len(G.nodes()),
'graph_nodes': nb_nodes,
'graph_nodes_places': nb_nodes - len(transition_nodes),
'graph_edges': len(G.edges()),
})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment