Public Member Functions | |
def | __init__ |
__init__() initializes a NewPedigree object. | |
def | load |
load() wraps several processes useful for loading and preparing a pedigree for use in an analysis, including reading the animals into a list of animal objects, forming lists of sires and dams, checking for common errors, setting ancestor flags, and renumbering the pedigree. | |
def | save |
save() writes a PyPedal pedigree to a user-specified file. | |
def | savegraph |
savegraph() save a pedigree to a file as an adjacency list. | |
def | savegedcom |
savegedcom() save a pedigree to a file in GEDCOM 5.5 format. | |
def | savedb |
savedb() saves a pedigree to a database table in ASDx format for NewAnimals and LightAnimals. | |
def | preprocess |
preprocess() processes a pedigree file, which includes reading the animals into a list of animal objects, forming lists of sires and dams, and checking for common errors. | |
def | fromgraph |
fromgraph() loads the animals to populate the pedigree from an XDiGraph object. | |
def | tostream |
tostream() creates a text stream from a pedigree. | |
def | renumber |
renumber() updates the ID map after a pedigree has been renumbered so that all references are to renumbered rather than original IDs. | |
def | addanimal |
addanimal() adds a new animal of class NewAnimal to the pedigree. | |
def | delanimal |
delanimal() deletes an animal from the pedigree. | |
def | updateidmap |
updateidmap() updates the ID map after a pedigree has been renumbered so that all references are to renumbered rather than original IDs. | |
def | printoptions |
printoptions() prints the contents of the options dictionary. | |
def | simulate |
simulate() simulates an arbitrary pedigree of size n with g generations starting from n_s base sires and n_d base dams. | |
Public Attributes | |
kw | |
pedigree | |
metadata | |
idmap | |
backmap | |
namemap | |
nrm | |
namebackmap | |
Static Public Attributes | |
string | format = '%(asctime)s %(levelname)-8s %(message)s' |
string | datefmt = '%a, %d %b %Y %H:%M:%S' |
list | filename = self.kw['logfile'] |
string | filemode = 'w' |
Definition at line 39 of file pyp_newclasses.py.
def PyPedal::pyp_newclasses::NewPedigree::__init__ | ( | self, | ||
kw = {} , |
||||
kwfile = 'pypedal.ini' | ||||
) |
__init__() initializes a NewPedigree object.
self | Reference to the current NewPedigree() object | |
kw | A dictionary of options. | |
kwfile | An optionsl configuration file name |
__init__() initializes a NewPedigree object.
Definition at line 47 of file pyp_newclasses.py.
def PyPedal::pyp_newclasses::NewPedigree::load | ( | self, | ||
pedsource = 'file' , |
||||
pedgraph = 0 , |
||||
pedstream = '' | ||||
) |
load() wraps several processes useful for loading and preparing a pedigree for use in an analysis, including reading the animals into a list of animal objects, forming lists of sires and dams, checking for common errors, setting ancestor flags, and renumbering the pedigree.
pedsource | Source of the pedigree ('file'|'graph'|'graphfile'|'db'). | |
pedgraph | XDiGraph from which to load the pedigree. |
load() wraps several processes useful for loading and preparing a pedigree for use in an analysis, including reading the animals into a list of animal objects, forming lists of sires and dams, checking for common errors, setting ancestor flags, and renumbering the pedigree.
Definition at line 239 of file pyp_newclasses.py.
def PyPedal::pyp_newclasses::NewPedigree::save | ( | self, | ||
filename = '' , |
||||
outformat = 'o' , |
||||
idformat = 'o' | ||||
) |
save() writes a PyPedal pedigree to a user-specified file.
The saved pedigree includes all fields recognized by PyPedal, not just the original fields read from the input pedigree file.
filename | The file to which the pedigree should be written. | |
outformat | The format in which the pedigree should be written: 'o' for original (as read) and 'l' for long version (all available variables). | |
idformat | Write 'o' (original) or 'r' (renumbered) animal, sire, and dam IDs. |
save() writes a PyPedal pedigree to a user-specified file. The saved pedigree includes all fields recognized by PyPedal, not just the original fields read from the input pedigree file.
Definition at line 436 of file pyp_newclasses.py.
def PyPedal::pyp_newclasses::NewPedigree::savegraph | ( | self, | ||
pedoutfile = 0 , |
||||
pedgraph = 0 | ||||
) |
savegraph() save a pedigree to a file as an adjacency list.
pedoutfile | Name of the file to which the graph is written | |
pedgraph | Graph object |
Preprocess a pedigree file, which includes reading the animals into a list, forming lists of sires and dams, and checking for common errors.
Definition at line 534 of file pyp_newclasses.py.
def PyPedal::pyp_newclasses::NewPedigree::savegedcom | ( | self, | ||
pedoutfile = 0 | ||||
) |
savegedcom() save a pedigree to a file in GEDCOM 5.5 format.
pedoutfile | Name of the file to which the graph is written |
Preprocess a pedigree file, which includes reading the animals into a list, forming lists of sires and dams, and checking for common errors.
Definition at line 557 of file pyp_newclasses.py.
def PyPedal::pyp_newclasses::NewPedigree::savedb | ( | self, | ||
drop = False | ||||
) |
savedb() saves a pedigree to a database table in ASDx format for NewAnimals and LightAnimals.
drop | Boolean indicating if existing data should be kept (False) or deleted (True); the default is False. |
savedb() saves a pedigree to a database table in ASDx format for NewAnimals and LightAnimals.
Definition at line 575 of file pyp_newclasses.py.
def PyPedal::pyp_newclasses::NewPedigree::preprocess | ( | self, | ||
textstream = '' , |
||||
dbstream = '' | ||||
) |
preprocess() processes a pedigree file, which includes reading the animals into a list of animal objects, forming lists of sires and dams, and checking for common errors.
textstream | String containing animal records | |
dbstream | List of tuples of animal records |
Preprocess a pedigree file, which includes reading the animals into a list, forming lists of sires and dams, and checking for common errors.
Definition at line 649 of file pyp_newclasses.py.
def PyPedal::pyp_newclasses::NewPedigree::fromgraph | ( | self, | ||
pedgraph | ||||
) |
fromgraph() loads the animals to populate the pedigree from an XDiGraph object.
pedgraph |
fromgraph() loads the animals to populate the pedigree from an XDiGraph object.
Definition at line 1032 of file pyp_newclasses.py.
def PyPedal::pyp_newclasses::NewPedigree::tostream | ( | self | ) |
tostream() creates a text stream from a pedigree.
XDiGraph object.
pedgraph |
tostream() creates a text stream from a pedigree.
Definition at line 1066 of file pyp_newclasses.py.
def PyPedal::pyp_newclasses::NewPedigree::renumber | ( | self | ) |
renumber() updates the ID map after a pedigree has been renumbered so that all references are to renumbered rather than original IDs.
None |
renumber() updates the ID map after a pedigree has been renumbered so that all references are to renumbered rather than original IDs.
Definition at line 1096 of file pyp_newclasses.py.
def PyPedal::pyp_newclasses::NewPedigree::addanimal | ( | self, | ||
animalID, | ||||
sireID, | ||||
damID | ||||
) |
addanimal() adds a new animal of class NewAnimal to the pedigree.
@return | 1 on success, 0 on failure integer |
Definition at line 1131 of file pyp_newclasses.py.
def PyPedal::pyp_newclasses::NewPedigree::delanimal | ( | self, | ||
animalID | ||||
) |
delanimal() deletes an animal from the pedigree.
Note that this method DOES not update the metadata attached to the pedigree and should only be used if that is not important. As of 04/10/2006 delanimal() is intended for use by pyp_metrics/mating_coi() rather than directly by users.
animalID | ID of the animal to be deleted |
Definition at line 1207 of file pyp_newclasses.py.
def PyPedal::pyp_newclasses::NewPedigree::updateidmap | ( | self | ) |
updateidmap() updates the ID map after a pedigree has been renumbered so that all references are to renumbered rather than original IDs.
None |
updateidmap() updates the ID map after a pedigree has been renumbered so that all references are to renumbered rather than original IDs.
Definition at line 1229 of file pyp_newclasses.py.
def PyPedal::pyp_newclasses::NewPedigree::printoptions | ( | self | ) |
printoptions() prints the contents of the options dictionary.
None |
printoptions() prints the contents of the options dictionary.
Definition at line 1262 of file pyp_newclasses.py.
def PyPedal::pyp_newclasses::NewPedigree::simulate | ( | self | ) |
simulate() simulates an arbitrary pedigree of size n with g generations starting from n_s base sires and n_d base dams.
This method is based on the concepts and algorithms in the Pedigree::sample method from Matvec 1.1a. The arguments are read from the pedigree object's options dictionary.
None |
Simulate simulates an arbitrary pedigree of size n with g generations starting from n_s base sires and n_d base dams. This method is based on the concepts and algorithms in the Pedigree::sample method from Matvec 1.1a (src/classes/pedigree.cpp), although all of the code in this implementation was written from scratch.
Definition at line 1282 of file pyp_newclasses.py.