def testMetricsEffectiveFoundersBoichardB(self): # Example taken from Boichard et al. (1997), Figure 2. # Used to test calculation of effective founder number. options = {} options['messages'] = 'quiet' options['pedfile'] = 'tests/boichard/boichard2b.ped' options['pedname'] = 'Boichard Pedigree (Family 2 only)' options['pedformat'] = 'asdg' options['pedigree_is_renumbered'] = '1' options['filetag'] = 'example2b' example2b = pyp_newclasses.NewPedigree(options) example2b.load() fe = pyp_metrics.a_effective_founders_boichard(example2b) self.assertEqual(round(2.0, 1), round(fe, 1))
def testMetricsEffectiveFoundersLacy(self): # Example taken from Lacy (1989), Appendix A. # Used to test calculation of effective population size. options = {} options['renumber'] = 0 options['messages'] = 'quiet' options['pedfile'] = 'tests/lacy/lacy.ped' options['pedformat'] = 'asd' options['sepchar'] = ' ' options['pedigree_is_renumbered'] = '1' example = pyp_newclasses.NewPedigree(options) example.load() fe = pyp_metrics.effective_founders_lacy(example) self.assertEqual(2.91, round(fe, 2))
def testMetricsEffectiveAncestorsDefiniteBoichardC(self): # Example taken from Boichard et al. (1997), Figure 2. # Used to test calculation of effective ancestor number. options = {} options['messages'] = 'quiet' options['pedfile'] = 'tests/boichard/boichard2.ped' options['pedname'] = 'Boichard Pedigree (Family 1 and 2)' options['pedformat'] = 'asdg' options['pedigree_is_renumbered'] = '1' options['filetag'] = 'example2' example2 = pyp_newclasses.NewPedigree(options) example2.load() fa = pyp_metrics.a_effective_ancestors_definite(example2) self.assertEqual(round(2.94, 2), round(fa, 2))
def testMetricsMinMaxF(self): # Pedigree from van Noordwijck and Scharloo (1981) as presented # in Hartl and Clark (1989), p. 242. options = {} options['renumber'] = 0 options['messages'] = 'quiet' options['pedfile'] = 'tests/hartlandclark.ped' options['pedformat'] = 'asd' options['sepchar'] = ' ' options['pedigree_is_renumbered'] = '1' options['form_nrm'] = '1' example = pyp_newclasses.NewPedigree(options) example.load() #example.nrm.info() high_coi, low_coi = pyp_metrics.min_max_f(example, n=5) print high_coi print low_coi