8.4.2 How do I convert a graph to a pedigree?

It is possible to create a PyPedal pedigree from a NetworkX graph. This is useful, for example, when you'd like to create a pedigree representing a subset of the population in a NewPedigree object. pyp_nrm.recurse_pedigree() and related functions won't do the trick because they return only lists of animal IDs, not actual NewPedigree instances. To create a pedigree from a graph you simply build your options dictionary and call pyp_newclasses.loadPedigree():
options = {}
options['pedfile'] = 'dummy'
options['messages'] = 'verbose'
options['renumber'] = 1
options['pedname'] = 'Testing fromgraph()'
options['pedformat'] = 'asd'
options['set_offspring'] = 1
options['set_ancestors'] = 1
options['set_sexes'] = 1
options['set_generations'] = 1
example2 = pyp_newclasses.loadPedigree(options,pedsource='graph',pedgraph=ng)
You must provide a non-null pedfile keyword in your options dictionary, as well as the pedsource and pedgraph arguments to pyp_newclasses.loadPedigree().

There is a known bug with logfile creation when loading a pedigree from a digraph.

See About this document... for information on suggesting changes.