pyp_network contains a set of procedures for working with pedigrees as directed
graphs.
- count_offspring(pedgraph, anid) ⇒ integer [#]
-
immediate_family() 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.
- Returns:
-
Count of offspring.
- find_ancestors(pedgraph, anid, _ancestors=[]) ⇒ list [#]
-
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.
- Returns:
-
List of ancestors of anid.
- find_descendants(pedgraph, anid, _descendants=[]) ⇒ list [#]
-
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.
- Returns:
-
List of descendants of anid.
- immediate_family(pedgraph, anid) ⇒ list [#]
-
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.
- Returns:
-
List of immediate family members of anid.
- most_influential_offspring(pedgraph, anid, resolve='all') ⇒ dictionary [#]
-
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').
- Returns:
-
The most influential offspring of anid.
- offspring_influence(pedgraph, anid) ⇒ dictionary [#]
-
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-progreny are to be counted.
- Returns:
-
A dictionary of counts of progeny per child.
- ped_to_graph(pedobj, oid=0) ⇒ graph [#]
-
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.
- Returns:
-
DiGraph object