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 setUp(self): '''Load test data and expected results.''' unittest.TestCase.setUp(self) # Test phaser, doesn't matter which here self.phaser = new_phaser_chain([trivial_phaser()]) # Generate a non-trivial Problem self.problem = itu.Templates.problem_family(itu.FAMILY13, haplotype=True)
def family_sib_comparison_phaser(next_filter=None, debug=False, print_times=False): chain = [ FamilyPhaser(family_handle=__handle_sib_comparison, name='* Sibs', genotyped_families=False), phased_samples_phaser # In selected samples mode, reset all non-selected haplotypes back to the original values ] return new_phaser_chain(chain, name='Family Sib', next_filter=next_filter, debug=debug, print_times=print_times)
def trivial_phaser(next_filter=None, debug=False, print_times=False): return new_phaser_chain([ Filter(name='* Hom SNPs', handle=__handle_hom_entries), Filter(name='* Hom Parent', handle=__handle_hom_parent), Filter(name='* Impute Parent', handle=__handle_impute_parent), phased_samples_phaser # In selected samples mode, reset all non-selected haplotypes back to the original values ], name='Trivial Cases', debug=debug, print_times=print_times)
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.problem = io.read_plink(pedigree=itu.HUTT_PED, prefix=itu.GENOTYPE_SAMPLE, haplotype=None) self.phaser = new_phaser_chain([trivial_phaser()])
def prepare_phaser(next_filter=None, debug=False, print_times=False): return new_phaser_chain( [estimate_frequencies_phaser, phased_samples_phaser], name="Pre-Processing", debug=debug, print_times=print_times, )
def family_child_comparison_phaser(next_filter=None, debug=False, print_times=False): chain = [ Filter(name='* Child Comparison', handle=__handle_child_comparison), phased_samples_phaser # In selected samples mode, reset all non-selected haplotypes back to the original values ] return new_phaser_chain(chain, name='Family Children', next_filter=next_filter, debug=debug, print_times=print_times)
def save_stats_processor(next_filter=None, debug=False, print_times=False): return new_phaser_chain([ estimate_frequencies_phaser, Filter(name='* Save stats', handle=__handle_save_stats) ], name='Save Stats', 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 prepare_phaser(next_filter=None, debug=False, print_times=False): return new_phaser_chain([ estimate_frequencies_phaser, phased_samples_phaser, ], name='Pre-Processing', debug=debug, print_times=print_times)
def family_phaser(next_filter=None, debug=False, single_family=False, print_times=False): chain = [ Filter(name='* Outer Duos', handle=__handle_outer_duos, debug=debug), # Phaser(name='* All Duos', handle=__handle_all_duos, debug=debug), FamilyPhaser(family_handle=__handle_parent_child, genotyped_families=True, min_children=0, name='* Phased Parent->Child'), phased_samples_phaser # In selected samples mode, reset all non-selected haplotypes back to the original values ] return new_phaser_chain(chain, name='Family Parent-Child', next_filter=next_filter, debug=debug, print_times=print_times)
def trivial_phaser(next_filter=None, debug=False, print_times=False): return new_phaser_chain( [ Filter(name='* Hom SNPs', handle=__handle_hom_entries), Filter(name='* Hom Parent', handle=__handle_hom_parent), Filter(name='* Impute Parent', handle=__handle_impute_parent), phased_samples_phaser # In selected samples mode, reset all non-selected haplotypes back to the original values ], name='Trivial Cases', debug=debug, print_times=print_times)
def distant_phaser(next_filter=None, debug=False, print_times=False, max_samples=np.inf, single_sample=None): chain = [ __ParentDistantPhaser(name='* Distant IBD', max_samples=max_samples, single_sample=single_sample, debug=debug), phased_samples_phaser # In selected samples mode, reset all non-selected haplotypes back to the original values ] return new_phaser_chain(chain, name='Distant IBD', next_filter=next_filter, debug=debug, print_times=print_times)
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()])
def prepare_and_trivial_phaser(debug=False, print_times=False): return new_phaser_chain( [prepare_phaser(), trivial_phaser()], debug=debug, print_times=print_times)
def build_phasing_pipeline(options): '''Bulid and return the entire phasing processing chain by options - factory method.''' chain = __build_phaser(options) + __build_post_chain(options) return new_phaser_chain(chain, debug=options.debug, print_times=options.print_times)
def prepare_and_trivial_phaser(debug=False, print_times=False): return new_phaser_chain([ prepare_phaser(), trivial_phaser() ], debug=debug, print_times=print_times)