8.3.2 How do I update a pedigree in the database?

Changes to a PyPedal pedigree object are not automatically saved to the database. If you have changed your pedigree, such as by calculating coefficients of inbreeding, and you want those changes visible to the database you have to call pyp_db.loadPedigreeTable() again. IMPORTANT NOTE: If you call pyp_db.loadPedigreeTable() after you have already loaded your pedigree into the database it will drop the existing table and reload it; all data in the existing table will be lost! In the following example, the pedigree is written to table hartlandclark in the database pypedal:
options = {}
options['pedfile'] = 'hartlandclark.ped'
options['pedname'] = 'Pedigree from van Noordwijck and Scharloo (1981)'
options['pedformat'] = 'asdb'

example = pyp_newclasses.loadPedigree(options)

pyp_db.loadPedigreeTable(example)
pypedal is the default database name used by PyPedal, and can be changed using a pedigree's database_name option. By default, table names are formed from the pedigree file name. A table name can be specified using a pedigree's dbtable_name option. Continuing the above example, suppose that I calculated coefficients of inbreeding on my pedigree and want to store the resulting pedigree in a new table named noordwijck_and_scharloo_inbreeding:
options['dbtable_name'] = 'noordwijck_and_scharloo_inbreeding'
pyp_nrm.inbreeding(example)
pyp_db.loadPedigreeTable(example)
You should see messages in the log telling you that the table has been created and populated:
Tue, 29 Nov 2005 11:24:22 WARNING  Table noordwijck_and_scharloo_inbreeding does
                                   not exist in database pypedal!
Tue, 29 Nov 2005 11:24:22 INFO     Table noordwijck_and_scharloo_inbreeding
                                   created in database pypedal!
See About this document... for information on suggesting changes.