The pyp_classes Module

pyp_classes contains two base classes that are used by PyPedal, the Animal() class and the Pedigree() class. What most PyPedal routines recognize as a pedigree is actually just a Python list of Animal() objects. An instance of a Pedigree() object is a collection of METADATA about a list of Animals(). I know that this is confusing, and it is going to change by the time that PyPedal 2.0.0 final is released.

Module Contents

Animal(animalID, sireID, damID, gen='0', by=1900, sex='u', fa=0., name='u', alleles=['', ''], breed='u', age=-999, alive=-999) (class) [#]

The Animal() class is holds animals records read from a pedigree file.

For more information about this class, see The Animal Class.

Pedigree(myped, inputfile, name, pedcode='asd', reord=0, renum=0, debug=0) (class) [#]

The Pedigree() class stores metadata about pedigrees.

For more information about this class, see The Pedigree Class.

The Animal Class

Animal(animalID, sireID, damID, gen='0', by=1900, sex='u', fa=0., name='u', alleles=['', ''], breed='u', age=-999, alive=-999) (class) [#]

The Animal() class is holds animals records read from a pedigree file.

__init__(animalID, sireID, damID, gen='0', by=1900, sex='u', fa=0., name='u', alleles=['', ''], breed='u', age=-999, alive=-999) ⇒ object [#]

__init__() initializes an Animal() object.

self
Reference to the current Animal() object
animalID
Animal ID number
sireID
Sire ID number
damID
Dam ID number
gen
Generation to which the animal belongs
by
Birthyear of the animal
sex
Sex of the animal (m|f|u)
fa
Coefficient of inbreeding of the animal
name
Name of animal
alleles
A two-element array of strings, which represent allelotypes.
breed
Breed of animal
age
Age of animal
alive
Status of animal (alive or dead)
Returns:
An instance of an Animal() object populated with data

pad_id() ⇒ integer [#]

pad_id() takes an Animal ID, pads it to fifteen digits, and prepends the birthyear (or 1950 if the birth year is unknown). The order of elements is: birthyear, animalID, count of zeros, zeros.

self
Reference to the current Animal() object
Returns:
A padded ID number that is supposed to be unique across animals

printme() [#]

printme() prints a summary of the data stored in the Animal() object.

self
Reference to the current Animal() object

stringme() [#]

stringme() returns a summary of the data stored in the Animal() object as a string.

self
Reference to the current Animal() object

trap() [#]

trap() checks for common errors in Animal() objects

self
Reference to the current Animal() object

The Pedigree Class

Pedigree(myped, inputfile, name, pedcode='asd', reord=0, renum=0, debug=0) (class) [#]

The Pedigree() class stores metadata about pedigrees. Hopefully this will help improve performance in some procedures, as well as provide some useful summary data.

__init__(myped, inputfile, name, pedcode='asd', reord=0, renum=0, debug=0) ⇒ object [#]

__init__() initializes a Pedigree metata object.

self
Reference to the current Pedigree() object
myped
A PyPedal pedigree
inputfile
The name of the file from which the pedigree was loaded
name
The name assigned to the PyPedal pedigree
pedcode
The format code for the PyPedal pedigree
reord
Flag indicating whether or not the pedigree is reordered (0|1)
renum
Flag indicating whether or not the pedigree is renumbered (0|1)
Returns:
An instance of a Pedigree() object populated with data

fileme() [#]

fileme() writes the metada stored in the Pedigree() object to disc.

self
Reference to the current Pedigree() object

nud() ⇒ integer-and-list [#]

nud() returns the number of unique dams in the pedigree along with a list of the dams

self
Reference to the current Pedigree() object
Returns:
The number of unique dams in the pedigree and a list of those dams

nuf() ⇒ integer-and-list [#]

nuf() returns the number of unique founders in the pedigree along with a list of the founders

self
Reference to the current Pedigree() object
Returns:
The number of unique founders in the pedigree and a list of those founders

nug() ⇒ integer-and-list [#]

nug() returns the number of unique generations in the pedigree along with a list of the generations

self
Reference to the current Pedigree() object
Returns:
The number of unique generations in the pedigree and a list of those generations

nus() ⇒ integer-and-list [#]

nus() returns the number of unique sires in the pedigree along with a list of the sires

self
Reference to the current Pedigree() object
Returns:
The number of unique sires in the pedigree and a list of those sires

nuy() ⇒ integer-and-list [#]

nuy() returns the number of unique birthyears in the pedigree along with a list of the birthyears

self
Reference to the current Pedigree() object
Returns:
The number of unique birthyears in the pedigree and a list of those birthyears

printme() [#]

printme() prints a summary of the metadata stored in the Pedigree() object.

self
Reference to the current Pedigree() object

stringme() [#]

stringme() returns a summary of the metadata stored in the pedigree as a string.

self
Reference to the current Pedigree() object