 |
 |
 |
A Manual for use of PyPedal
A software package for pedigree analysis |
 |
 |
 |
9.1.1 Drawing Pedigrees
The pedigree from Figure 2 in Boichard et al. ref352 is shown in Figure 9.1, and shows males enclosed in rectangles and females in ovals. Figure 9.2 shows a pedigree in which strings are used for animal IDs; animal are enclosed in ovals because sexes were not specified in the pedigree file and the set_sexes option was not specified. A more complex German Shepherd pedigree is presented in Figure 9.3; the code used to create this pedigree is:
pyp_graphics.draw_pedigree(example, gfilename='doug_p_rl_notitle', gname=1,
gdirec='RL', gfontsize=12)
Figure 9.1:
Pedigree 2 from Boichard et al. (1997)
|
|
Figure 9.2:
A pedigree with strings as animal IDs
|
|
Figure 9.3:
German Shepherd pedigree
|
|
The resulting graphic is written to doug_p_rl_notitle.jpg; note from Table 9.1 that the default file format for draw_pedigree() is JPG rather than PNG, as is the case for the other graphics routines. To get a PNG simply pass the argument gformat='png' to draw_pedigree(). For details on the options taken by draw_pedigree() please refer to the API documentation (Section ). draw_pedigree() uses rectangles to indicates known males, circles to indicate known females, and octagons to indicate animals of unknown sex.
Pedigrees can also be colored using the color_pedigree() function in the pyp_jbc module. At present, animals are shaded either by the number of sons produced or by the total number of descendants. The five-generation pedigree of the Newfoundland dog King von der Düssel is presented in Figure 9.4 (http://www.newfoundlanddog-database.net/en/ahnen.php?num=0000025330, data used with permission), and the nodes are shaded based on number of descendants.
Figure 9.4:
Newfoundland colored pedigree
|
|
FIX
Windows users should set the drawers keyword to 'old' when calling color_pedigree(). This will call draw_colored_pedigree() rather than new_draw_colored_pedigree(). The latter requires that PyGraphviz library be installed and there is not yet an easy way to install it on Windows.
Release 2.0.3, documentation updated on November 29, 2005
Revised May 15, 2012.
See About this document... for information on suggesting changes.