Functions | |
| def | ped_to_graph |
| def | find_ancestors |
| def | find_ancestors_g |
| def | find_descendants |
| def | immediate_family |
| def | count_offspring |
| def | offspring_influence |
| def | most_influential_offspring |
| def | get_founder_descendants |
| def | get_node_degrees |
| def | get_node_degree_histograms |
| def | mean_geodesic |
| def | graph_density |
| def | dyad_census |
| def | mean_degree_centrality |
| def | mean_value |
| def | get_closeness_centrality |
| def | get_clustering_coefficient |
| def | get_betweenness_centrality |
| def | get_node_betweenness |
| def PyPedal::pyp_network::count_offspring | ( | pedgraph, | ||
| anid | ||||
| ) |
count_offspring() returns the number of offspring of an animal.
| pedgraph | An instance of a networkx DiGraph. | |
| anid | The animal for whom offspring are to be counted. |
count_offspring() returns the number of offspring of an animal.
Definition at line 181 of file pyp_network.py.
| def PyPedal::pyp_network::dyad_census | ( | pg, | ||
debug = 0, |
||||
debuglog = 0 | ||||
| ) |
dyad_census() calculates the number of null, asymmetric, and mutual edges between all pairs of nodes in a directed graph.
| pg | An instance of a NetworkX DiGraph. | |
| debug | Flag to turn debugging messages on (1) or off (0). | |
| debuglog | Flag to turn debugging messages to the logfile on (1) or off (0). |
dyad_census() calculates the number of null, asymmetric, and mutual edges between all pairs of nodes in a directed graph.
Definition at line 412 of file pyp_network.py.
| def PyPedal::pyp_network::find_ancestors | ( | pedgraph, | ||
| anid, | ||||
_ancestors = [] | ||||
| ) |
find_ancestors() identifies the ancestors of an animal and returns them in a list.
| pedgraph | An instance of a networkx DiGraph. | |
| anid | The animal for whom ancestors are to be found. | |
| _ancestors | The list of ancestors already found. |
find_ancestors() identifies the ancestors of an animal and returns them in a list.
Definition at line 92 of file pyp_network.py.
| def PyPedal::pyp_network::find_ancestors_g | ( | pedgraph, | ||
| anid, | ||||
_ancestors = {}, |
||||
gens = 3 | ||||
| ) |
find_ancestors_g() identifies the ancestors of an animal going back a user-specified number of generations and returns them in a list.
| pedgraph | An instance of a networkx DiGraph. | |
| anid | The animal for whom ancestors are to be found. | |
| _ancestors | The list of ancestors already found. |
find_ancestors_g() identifies the ancestors of an animal and returns them in a list.
Definition at line 116 of file pyp_network.py.
| def PyPedal::pyp_network::find_descendants | ( | pedgraph, | ||
| anid, | ||||
_descendants = [] | ||||
| ) |
find_descendants() identifies the descendants of an animal and returns them in a list.
| pedgraph | An instance of a networkx DiGraph. | |
| anid | The animal for whom descendants are to be found. | |
| _descendants | The list of descendants already found. |
find_descendants() identifies the descendants of an animal and returns them in a list.
Definition at line 144 of file pyp_network.py.
| def PyPedal::pyp_network::get_betweenness_centrality | ( | pg | ) |
get_betweenness_centrality(pg) returns a dictionary of the betweenness centrality of each node in the graph.
| pg | An instance of a NetworkX DiGraph. |
get_betweenness_centrality(pg) returns a dictionary of the betweenness centrality of each node in the graph.
Definition at line 554 of file pyp_network.py.
| def PyPedal::pyp_network::get_closeness_centrality | ( | pg | ) |
get_closeness_centrality(pg) returns a dictionary of the closeness centrality (1/(average distance to all nodes from n)) for each node in the graph.
| pg | An instance of a NetworkX DiGraph. |
get_closeness_centrality(pg) returns a dictionary of the close- ness centrality (1/(average distance to all nodes from n)) for each node in the graph.
Definition at line 513 of file pyp_network.py.
| def PyPedal::pyp_network::get_clustering_coefficient | ( | pg | ) |
get_clustering_coefficient(pg) returns a dictionary of the clustering coefficient of each node in the graph based on the definition of Watts and Strogatz (1998).
| pg | An instance of a NetworkX DiGraph. |
get_clustering_coefficient(pg) returns a dictionary of the clustering coefficient of each node in the graph based on the definition of Watts and Strogatz (1998).
Definition at line 534 of file pyp_network.py.
| def PyPedal::pyp_network::get_founder_descendants | ( | pedgraph | ) |
get_founder_descendants() returns a dictionary containing a list of descendants of each founder in the pedigree.
| pedgraph | An instance of a NetworkX DiGraph. |
get_founder_descendants() returns a dictionary containing a list of descendants of each founder in the pedigree.
Definition at line 270 of file pyp_network.py.
| def PyPedal::pyp_network::get_node_betweenness | ( | pg | ) |
get_node_betweenness(pg) returns a dictionary of the number of shortest paths that go through each node in the graph.
| pg | An instance of a NetworkX DiGraph. |
get_node_betweenness(pg) returns a dictionary of the number of shortest paths that go through each node in the graph.
Definition at line 573 of file pyp_network.py.
| def PyPedal::pyp_network::get_node_degree_histograms | ( | node_degrees | ) |
get_node_degree_histograms() returns a dictionary containing histograms of the number of vertices (nodes) in pg with a given number of incoming, outgoing, or total edges.
| node_degrees | A dictionary of dictionaries of in, out, and total node degrees. |
get_node_degree_histograms() returns a dictionary containing histograms of the number of vertices (nodes) in pg with a given number of incoming, outgoing, or total edges.
Definition at line 321 of file pyp_network.py.
| def PyPedal::pyp_network::get_node_degrees | ( | pg | ) |
get_node_degrees() returns a dictionary containing the number of vertices (nodes) in pg with a given number of incoming, outgoing, or total edges.
| pg | An instance of a NetworkX DiGraph. |
get_node_degrees() returns a dictionary containing the number of vertices (nodes) in pg with a given number of incoming, outgoing, or total edges.
Definition at line 295 of file pyp_network.py.
| def PyPedal::pyp_network::graph_density | ( | pg | ) |
graph_density() calculates the density of a digraph, which is the ratio of edges in the gaph to the maximum possible number of edges.
| pg | An instance of a NetworkX DiGraph. |
graph_density() calculates the density of a digraph, which is the ratio of edges in the gaph to the maximum possible number of edges.
Definition at line 389 of file pyp_network.py.
| def PyPedal::pyp_network::immediate_family | ( | pedgraph, | ||
| anid | ||||
| ) |
immediate_family() returns parents and offspring of an animal.
| pedgraph | An instance of a networkx DiGraph. | |
| anid | The animal for whom immediate family are to be found. |
immediate_family() returns parents and offspring of an animal.
Definition at line 165 of file pyp_network.py.
| def PyPedal::pyp_network::mean_degree_centrality | ( | pg, | ||
normalize = 0 | ||||
| ) |
mean_degree_centrality(pg) calculates mean in- and out-degree centralities for directed graphs and simple degree-centralities for undirected graphs. If the normalize flag is set, each node's centralities are weighted by the number of edges in the (di)graph.
| pg | An instance of a NetworkX DiGraph. | |
| normalize | Flag to turn normalization on (1) or off (0). |
mean_degree_centrality(pg) calculates mean in- and out-degree centralities for directed graphs and simple degree-centralities for undirected graphs. If the normalize flag is set, each node's centralities are weighted by the number of edges in the (di)graph.
Definition at line 455 of file pyp_network.py.
| def PyPedal::pyp_network::mean_geodesic | ( | pg, | ||
debug = 0 | ||||
| ) |
mean_geodesic() calculates the mean geodesic (shortest) distance between two vertices in a network.
| pg | An instance of a NetworkX DiGraph. | |
| debug | Flag to turn debugging messages on (1) or off (0). |
mean_geodesic() calculates the mean geodesic (shortest) distance between two vertices in a network.
Definition at line 355 of file pyp_network.py.
| def PyPedal::pyp_network::mean_value | ( | mydict | ) |
mean_value() calculates the mean from all values in a dictionary.
| mydict | A dictionary whose values are integers or reals. |
mean_value() calculates the mean from all values in a dictionary.
Definition at line 494 of file pyp_network.py.
| def PyPedal::pyp_network::most_influential_offspring | ( | pedgraph, | ||
| anid, | ||||
resolve = 'all' | ||||
| ) |
most_influential_offspring() returns the most influential offspring of an animal as measured by their number of offspring.
| pedgraph | An instance of a networkx DiGraph. | |
| anid | The animal for whom the most influential offspring is to be found. | |
| resolve | Indicates how ties should be handled ('first'|'last'|'all'). |
most_influential_offspring() returns the most influential offspring of an animal as measured by their number of offspring.
Definition at line 219 of file pyp_network.py.
| def PyPedal::pyp_network::offspring_influence | ( | pedgraph, | ||
| anid | ||||
| ) |
offspring_influence() returns the number of grand-children by each child of a given animal.
| pedgraph | An instance of a networkx DiGraph. | |
| anid | The animal for whom grand-progeny are to be counted. |
offspring_influence() returns the number of grand-children by each child of a given animal.
Definition at line 197 of file pyp_network.py.
| def PyPedal::pyp_network::ped_to_graph | ( | pedobj, | ||
oid = 0 | ||||
| ) |
ped_to_graph() Takes a PyPedal pedigree object and returns a networkx XDiGraph object.
| pedobj | A PyPedal pedigree object. | |
| oid | Flag indicating if original (1) or renumbered (0) IDs should be used. |
ped_to_graph() Takes a PyPedal pedigree object and returns a networkx XDiGraph object.
Definition at line 57 of file pyp_network.py.
1.5.3