def phaser_stages13(debug=False, print_times=False): return new_phaser_chain([ prepare_phaser(), trivial_phaser(), family_phaser(), family_child_comparison_phaser(), ], debug=debug, print_times=print_times)
def nuclear_family_phaser(debug=False, print_times=False): return new_phaser_chain([ prepare_phaser(), trivial_phaser(), family_phaser(), family_child_comparison_phaser(), family_sib_comparison_phaser(), ], debug=debug, print_times=print_times)
def phaser_stages13(debug=False, print_times=False): return new_phaser_chain([ prepare_phaser(), trivial_phaser(), family_phaser(), family_child_comparison_phaser(), ], debug=debug, print_times=print_times)
def __build_phaser(options): '''Bulid and return the phasing processing chain by options - factory method.''' if options.stage == 0: # 07-DEC-12: disabling stage 4 (family_sib_comparison_phaser) since it degrades phasing & imputation chain = [ prepare_phaser(), trivial_phaser(), family_phaser(), family_child_comparison_phaser(), phase_distant.family_sib_comparison_phaser(), phase_distant.distant_phaser() ] elif options.stage == 1: chain = [prepare_phaser(), trivial_phaser()] elif options.stage == 2: chain = [family_phaser()] elif options.stage == 3: chain = [family_child_comparison_phaser()] elif options.stage == 4: chain = [phase_distant.family_sib_comparison_phaser()] elif options.stage == 5: chain = [phase_distant.distant_phaser()] return chain
def nuclear_family_phaser(debug=False, print_times=False): return new_phaser_chain([ prepare_phaser(), trivial_phaser(), family_phaser(), family_child_comparison_phaser(), family_sib_comparison_phaser(), ], debug=debug, print_times=print_times)
def setUp(self): '''Load test data and expected results.''' unittest.TestCase.setUp(self) # Load test data ready from previous phasing stagees self.problem = io.read_npz(itu.FAMILY_TOO_ZEROED_STAGE1) self.family = self.problem.families()[0] self.phaser = phase_core.PhaseDecorator(FilterChain([trivial_phaser(), family_phaser(), family_child_comparison_phaser()])) self.comparator = ic.ChildComparator(Struct(problem=self.problem, params=PhaseParam()), self.family)
def __build_phaser(options): '''Bulid and return the phasing processing chain by options - factory method.''' if options.stage == 0: # 07-DEC-12: disabling stage 4 (family_sib_comparison_phaser) since it degrades phasing & imputation chain = [ prepare_phaser(), trivial_phaser(), family_phaser(), family_child_comparison_phaser(), phase_distant.family_sib_comparison_phaser(), phase_distant.distant_phaser() ] elif options.stage == 1: chain = [prepare_phaser(), trivial_phaser()] elif options.stage == 2: chain = [family_phaser()] elif options.stage == 3: chain = [family_child_comparison_phaser()] elif options.stage == 4: chain = [phase_distant.family_sib_comparison_phaser()] elif options.stage == 5: chain = [phase_distant.distant_phaser()] return chain
def setUp(self): '''Load test data and expected results.''' unittest.TestCase.setUp(self) # Load test data ready from previous phasing stagees self.problem = io.read_npz(itu.FAMILY13_STAGE2) self.family = self.problem.families()[0] self.phaser = phase_core.PhaseDecorator( FilterChain([ trivial_phaser(), family_phaser(), family_child_comparison_phaser() ])) self.comparator = ic.ChildComparator( Struct(problem=self.problem, params=PhaseParam()), self.family)
def test_outer_duo(self): '''Test applying child comparison to a nuclear family with many genotyped kids but only one genotyped parent. Seems to be fine for now: too many errors are flagged, but we are not going to split hair.''' p = self.problem # h = p.haplotype # (f, m) = (self.family.father, self.family.mother) snp = p.info.snp_by_name('rs5746679') assert_equal(snp, [3], 'Wrong SNP index') itu.assert_size_equals(p.genotype, 3218, 7) itu.assert_problem_stats(p, 45052, 40086, 4) # print 'genotypes' # print p.genotype.data[snp, :, :] # print 'haplotypes' # print p.haplotype.data[snp, :, :] phaser = family_phaser() phaser.run(p) itu.assert_problem_stats(p, 45052, 45023, 25)
def setUp(self): '''Load test data and expected results.''' unittest.TestCase.setUp(self) # The way to load a pedigree in conjunction with a genotype set is to recode # its sample IDs to consecutive for easier access by phasers. self.phaser = new_phaser_chain([trivial_phaser(), family_phaser(), family_child_comparison_phaser()])