8.2.1 How do I calculate coefficients of inbreeding?

This requires that you have a renumbered pedigree (HOWTO 8.1.3).
options = {}
options['renumber'] = 1
options['pedfile'] = 'new_lacy.ped'
options['pedformat'] = 'asd'
example1 = pyp_newclasses.loadPedigree(options)
example_inbreeding = pyp_nrm.inbreeding(example)
print example_inbreeding
The dictionary returned by pyp_nrm.inbreeding(example), example_inbreeding, contains two dictionaries: fx contains coefficients of inbreeding (COI) keyed to renumbered animal IDs and metadata contains summary statistics. metadata also contains two dictionaries: all contains summary statistics for all animals, while nonzero contains summary statistics for only animals with non-zero coefficients of inbreeding. If you print example_inbreeding you'll get the following:
{'fx': {1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0, 5: 0.0, 6: 0.0, 7: 0.0, 8: 0.0, 9: 0.0,
10: 0.0, 11: 0.0, 12: 0.0, 13: 0.0, 14: 0.0, 15: 0.0, 16: 0.0, 17: 0.0, 18: 0.0,
19: 0.0, 20: 0.0, 21: 0.0, 22: 0.0, 23: 0.0, 24: 0.0, 25: 0.0, 26: 0.0, 27: 0.0,
28: 0.25, 29: 0.0, 30: 0.0, 31: 0.25, 32: 0.0, 33: 0.0, 34: 0.0, 35: 0.0, 36: 0.0,
37: 0.0, 38: 0.21875, 39: 0.0, 40: 0.0625, 41: 0.0, 42: 0.0, 43: 0.03125, 44: 0.0,
45: 0.0, 46: 0.0, 47: 0.0},
'metadata': {'nonzero': {'f_max': 0.25, 'f_avg': 0.16250000000000001,
'f_rng': 0.21875, 'f_sum': 0.8125, 'f_min': 0.03125, 'f_count': 5},
'all': {'f_max': 0.25, 'f_avg': 0.017287234042553192, 'f_rng': 0.25,
'f_sum': 0.8125, 'f_min': 0.0, 'f_count': 47}}}
Obtaining the COI for a given animal, say 28, is simple:
>>> print example_inbreeding['fx'][28]
'0.25'
To print the mean COI for the pedigree:
>>> print example_inbreeding['metadata']['all']['f_avg']
'0.017287234042553192'
See About this document... for information on suggesting changes.