PyPedal::pyp_graphics Namespace Reference


Functions

def rmuller_spy_matrix_pil
def rmuller_pcolor_matrix_pil
def rmuller_get_color
def draw_pedigree
def plot_founders_by_year
def plot_founders_pct_by_year
def pcolor_matrix_pylab
def spy_matrix_pylab
def plot_line_xy
def new_draw_pedigree


Function Documentation

def PyPedal::pyp_graphics::draw_pedigree (   pedobj,
  gfilename = 'pedigree',
  gtitle = '',
  gformat = 'jpg',
  gsize = 'f',
  gdot = '1',
  gorient = 'p',
  gdirec = '',
  gname = 0,
  gfontsize = 10,
  garrow = 1,
  gtitloc = 'b',
  gtitjust = 'c',
  gshowall = 1,
  gclusters = 0 
)

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.

Parameters:
pedobj A PyPedal pedigree object.
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.
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').
gshowall Draws animals with no links to other ancestors in the pedigree (1) or suppresses them (0).
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 247 of file pyp_graphics.py.

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

new_draw_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.
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.
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 757 of file pyp_graphics.py.

def PyPedal::pyp_graphics::pcolor_matrix_pylab (   A,
  fname = 'pcolor_matrix_matplotlib' 
)

pcolor_matrix_pylab() implements a matlab-like 'pcolor' function to display the large elements of a matrix in pseudocolor using the Python Imaging Library.

Parameters:
A Input Numpy matrix (such as a numerator relationship matrix).
fname Output filename to which to dump the graphics (default 'tmp.png')
do_outline Whether or not to print an outline around the block (default 0)
height The height of the image (default 300)
width The width of the image (default 300)
Returns:
A list of Animal() objects; a pedigree metadata object. lists
pcolor_matrix_pylab() implements a matlab-like 'pcolor' function to
display the large elements of a matrix in pseudocolor using the Python Imaging
Library.

Definition at line 604 of file pyp_graphics.py.

def PyPedal::pyp_graphics::plot_founders_by_year (   pedobj,
  gfilename = 'founders_by_year',
  gtitle = 'Founders by Birthyear' 
)

founders_by_year() uses matplotlib -- if available on your system -- to produce a bar graph of the number (count) of founders in each birthyear.

Parameters:
pedobj A PyPedal pedigree object.
gfilename The name of the file to which the pedigree should be drawn
gtitle The title of the graph.
Returns:
A 1 for success and a 0 for failure. integer
founders_by_year() uses matplotlib -- if available on your system -- to produce a
bar graph of the number (count) of founders in each birthyear.

Definition at line 509 of file pyp_graphics.py.

def PyPedal::pyp_graphics::plot_founders_pct_by_year (   pedobj,
  gfilename = 'founders_pct_by_year',
  gtitle = 'Founders by Birthyear' 
)

founders_pct_by_year() uses matplotlib -- if available on your system -- to produce a line graph of the frequency (percentage) of founders in each birthyear.

Parameters:
pedobj A PyPedal pedigree object.
gfilename The name of the file to which the pedigree should be drawn
gtitle The title of the graph.
Returns:
A 1 for success and a 0 for failure. integer
founders_pct_by_year() uses matplotlib -- if available on your system -- to produce a
line graph of the frequency (percentage) of founders in each birthyear.

Definition at line 554 of file pyp_graphics.py.

def PyPedal::pyp_graphics::plot_line_xy (   xydict,
  gfilename = 'plot_line_xy',
  gtitle = 'Value by key',
  gxlabel = 'X',
  gylabel = 'Y',
  gformat = 'png' 
)

plot_line_xy() uses matplotlib -- if available on your system -- to produce a line graph of the values in a dictionary for each level of key.

Parameters:
dictionary A Python dictionary
gfilename The name of the file to which the figure should be written
gtitle The title of the graph.
gxlabel The label for the x-axis.
gylabel The label for the y-axis.
Returns:
A 1 for success and a 0 for failure. integer
plot_line_xy() uses matplotlib -- if available on your system -- to produce a
line graph of the values in a dictionary for each level of key.

Definition at line 699 of file pyp_graphics.py.

def PyPedal::pyp_graphics::rmuller_get_color (   a,
  cmin,
  cmax 
)

rmuller_get_color() Converts a float value to one of a continuous range of colors using recipe 9.10 from the Python Cookbook.

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.

Definition at line 210 of file pyp_graphics.py.

def PyPedal::pyp_graphics::rmuller_pcolor_matrix_pil (   A,
  fname = 'tmp.png',
  do_outline = 0,
  height = 300,
  width = 300 
)

rmuller_pcolor_matrix_pil() implements a matlab-like 'pcolor' function to display the large elements of a matrix in pseudocolor using the Python Imaging Library.

Parameters:
A Input Numpy matrix (such as a numerator relationship matrix).
fname Output filename to which to dump the graphics (default 'tmp.png')
do_outline Whether or not to print an outline around the block (default 0)
height The height of the image (default 300)
width The width of the image (default 300)
Returns:
A list of Animal() objects; a pedigree metadata object. lists
rmuller_pcolor_matrix_pil() implements a matlab-like 'pcolor' function to
display the large elements of a matrix in pseudocolor using the Python Imaging
Library.

Definition at line 142 of file pyp_graphics.py.

def PyPedal::pyp_graphics::rmuller_spy_matrix_pil (   A,
  fname = 'tmp.png',
  cutoff = 0.1,
  do_outline = 0,
  height = 300,
  width = 300 
)

import matplotlib matplotlib.use('Agg') import pylab rmuller_spy_matrix_pil() implements a matlab-like 'spy' function to display the sparsity of a matrix using the Python Imaging Library.

Parameters:
A Input Numpy matrix (such as a numerator relationship matrix).
fname Output filename to which to dump the graphics (default 'tmp.png')
cutoff Threshold value for printing an element (default 0.1)
do_outline Whether or not to print an outline around the block (default 0)
height The height of the image (default 300)
width The width of the image (default 300)
Returns:
None None
rmuller_spy_matrix_pil() implements a matlab-like 'spy' function to display the
sparsity of a matrix using the Python Imaging Library.

Definition at line 82 of file pyp_graphics.py.

def PyPedal::pyp_graphics::spy_matrix_pylab (   A,
  fname = 'spy_matrix_matplotlib' 
)

spy_matrix_pylab() implements a matlab-like 'pcolor' function to display the large elements of a matrix in pseudocolor using the Python Imaging Library.

Parameters:
A Input Numpy matrix (such as a numerator relationship matrix).
fname Output filename to which to dump the graphics (default 'tmp.png')
do_outline Whether or not to print an outline around the block (default 0)
height The height of the image (default 300)
width The width of the image (default 300)
Returns:
A list of Animal() objects; a pedigree metadata object. lists
spy_matrix_pylab() implements a matlab-like 'pcolor' function to
display the large elements of a matrix in pseudocolor using the Python Imaging
Library.

Definition at line 658 of file pyp_graphics.py.


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