PyPedal::pyp_jbc Namespace Reference


Functions

def get_color_32
def color_pedigree
def draw_colored_pedigree
def new_draw_colored_pedigree


Function Documentation

def PyPedal::pyp_jbc::color_pedigree (   pedobj,
  metric = 'descendants',
  places = 2,
  drawer = 'new',
  kw 
)

color_pedigree() forms a graph object from a pedigree object and determines the proportion of animals in a pedigree that are descendants of each animal in the pedigree. The results will be used to feed draw_colored_pedigree().

Parameters:
pedobj A PyPedal pedigree object.
metric Count for coloring nodes in the pedigree (descendants|sons).
drawer Routine to use for drawing the pedigree (new|old).
Returns:
A 1 for success and a 0 for failure. integer
color_pedigree() forms a graph object from a pedigree object and determines the
proportion of animals in a pedigree that are descendants of each animal in the
pedigree.  The results will be used to feed draw_colored_pedigree().

Definition at line 66 of file pyp_jbc.py.

def PyPedal::pyp_jbc::draw_colored_pedigree (   pedobj,
  shading,
  gfilename = 'pedigree',
  gtitle = 'My_Pedigree',
  gformat = 'jpg',
  gsize = 'f',
  gdot = '1',
  gorient = 'l',
  gdirec = '',
  gname = 0,
  gfontsize = 10,
  garrow = 1,
  gtitloc = 'b',
  gtitjust = 'c',
  ghatch = 'hatch',
  gprog = 'dot' 
)

draw_colored_pedigree() uses the pydot bindings to the graphviz library to produce a directed graph of your pedigree with paths of inheritance as edges and animals as nodes. If there is more than one generation in the pedigree as determind by the "gen" attributes of the animals in the pedigree, draw_pedigree() will use subgraphs to try and group animals in the same generation together in the drawing. Nodes will be colored based on the number of outgoing connections (number of offspring).

Parameters:
pedobj A PyPedal pedigree object.
shading A dictionary mapping animal IDs to levels that will be used to color nodes.
gfilename The name of the file to which the pedigree should be drawn.
gtitle The title of the graph.
gsize The size of the graph: 'f': full-size, 'l': letter-sized page.
gdot Whether or not to write the dot code for the pedigree graph to a file (can produce large files).
gorient The orientation of the graph: 'p': portrait, 'l': landscape.
gdirec Direction of flow from parents to offspring: 'TB': top-bottom, 'LR': left-right, 'RL': right-left.
gname Flag indicating whether ID numbers (0) or names (1) should be used to label nodes.
gfontsize Integer indicating the typeface size to be used in labelling nodes.
garrow Flag indicating whether or not arrowheads should be drawn.
gtitloc Indicates if the title be drawn or above ('t') or below ('b') the graph.
gtitjust Indicates if the title should be center- ('c'), left- ('l'), or right-justified ('r').
ghatch Shade a node if the value of its userField attribute is equal to ghatch.
gprog Program to use to layout graph ('dot'|'neato').
Returns:
A 1 for success and a 0 for failure. integer
draw_colored_pedigree() uses the pydot bindings to the graphviz library to produce a
directed graph of your pedigree with paths of inheritance as edges and animals as
nodes.  If there is more than one generation in the pedigree as determind by the "gen"
attributes of the animals in the pedigree, draw_pedigree() will use subgraphs to try
and group animals in the same generation together in the drawing.  Nodes will be
colored based on the number of outgoing connections (number of offspring).

Definition at line 119 of file pyp_jbc.py.

def PyPedal::pyp_jbc::get_color_32 (   a,
  cmin,
  cmax 
)

get_color_32() Converts a float value to one of a continuous range of colors using recipe 9.10 from the Python Cookbook. Returns 32-bit colors rather than 16-bit colors.

Parameters:
a Float value to convert to a color.
cmin Minimum value in array (?).
cmax Maximum value in array (?).
Returns:
An RGB triplet. integer
Convert a float value to one of a continuous range of colors.
Rewritten to use recipe 9.10 from the O'Reilly Python Cookbook.
Returns 32-bit colors rather than 16-bit colors.

Definition at line 32 of file pyp_jbc.py.

def PyPedal::pyp_jbc::new_draw_colored_pedigree (   pedobj,
  shading,
  gfilename = 'pedigree',
  gtitle = '',
  gformat = 'jpg',
  gsize = 'f',
  gdot = 1,
  gorient = 'p',
  gdirec = '',
  gname = 0,
  garrow = 1,
  gtitloc = 'b',
  gtitjust = 'c',
  gshowall = 1,
  gprog = 'dot',
  ghatch = 'hatch' 
)

new_draw_colored_pedigree() uses the pyygraphviz to produce a directed graph of your pedigree with paths of inheritance as edges and animals as nodes. If there is more than one generation in the pedigree as determind by the "gen" attributes of the animals in the pedigree, draw_pedigree() will use subgraphs to try and group animals in the same generation together in the drawing.

Parameters:
pedobj A PyPedal pedigree object.
shading A dictionary mapping animal IDs to levels that will be used to color nodes.
gfilename The name of the file to which the pedigree should be drawn
gtitle The title of the graph.
gformat The format in which the output file should be written (JPG|PNG|PS).
gsize The size of the graph: 'f': full-size, 'l': letter-sized page.
gdot Whether or not to write the dot code for the pedigree graph to a file (can produce large files).
gorient The orientation of the graph: 'p': portrait, 'l': landscape.
gdirec Direction of flow from parents to offspring: 'TB': top-bottom, 'LR': left-right, 'RL': right-left.
gname Flag indicating whether ID numbers (0) or names (1) should be used to label nodes.
garrow Flag indicating whether or not arrowheads should be drawn.
gtitloc Indicates if the title be drawn or above ('t') or below ('b') the graph.
gtitjust Indicates if the title should be center- ('c'), left- ('l'), or right-justified ('r').
gshowall Draws animals with no links to other ancestors in the pedigree (1) or suppresses them (0).
gprog Specify which program should be used to position and render the graph.
ghatch Shade a node if the value of its userField attribute is equal to ghatch.
Returns:
A 1 for success and a 0 for failure. integer
draw_pedigree() uses the pydot bindings to the graphviz library -- if they
are available on your system -- to produce a directed graph of your pedigree
with paths of inheritance as edges and animals as nodes.  If there is more than
one generation in the pedigree as determind by the "gen" attributes of the animals
in the pedigree, draw_pedigree() will use subgraphs to try and group animals in the
same generation together in the drawing.

Definition at line 351 of file pyp_jbc.py.


Generated on Fri Mar 28 14:34:59 2008 for PyPedal by  doxygen 1.5.3