예제 #1
0
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)
예제 #2
0
 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)
예제 #3
0
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)
예제 #4
0
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)
예제 #5
0
 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()])
예제 #6
0
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,
    )
예제 #7
0
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)
예제 #8
0
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)
예제 #9
0
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)
예제 #10
0
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)
예제 #11
0
 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()])
예제 #12
0
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)
예제 #13
0
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)
예제 #14
0
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)
예제 #15
0
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)
예제 #16
0
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)
예제 #17
0
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)
예제 #18
0
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)
예제 #19
0
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)
예제 #20
0
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)
예제 #21
0
 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()])
예제 #22
0
def prepare_and_trivial_phaser(debug=False, print_times=False):
    return new_phaser_chain(
        [prepare_phaser(), trivial_phaser()],
        debug=debug,
        print_times=print_times)
예제 #23
0
파일: phase.py 프로젝트: orenlivne/ober
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)
예제 #24
0
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)
예제 #25
0
파일: phase.py 프로젝트: orenlivne/ober
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)
예제 #26
0
def prepare_and_trivial_phaser(debug=False, print_times=False):
    return new_phaser_chain([
                             prepare_phaser(),
                             trivial_phaser()
                             ], debug=debug, print_times=print_times)