Exemplo n.º 1
0
 def __phase_distant(self, problem, segments, sample):
     s = im.idist.best_segment_index(problem.info.snp['base_pair'],
                                     segments)
     for i, segment in enumerate(segments):
         ibd._phase_in_ibd_segment(problem,
                                   np.where(s == i)[0],
                                   np.array(list(segment.samples)), 'max')
Exemplo n.º 2
0
def phase_by_segment_priority(problem, segments):
    '''Given a list of segments, determine the best segment to use at each SNP, and phase using
    the max consensus. This assumes that segments are between pairs of haplotypes, one of which
    is filled.'''
    problem.info.ibd += segments  # Not grouping to disjoint here; TODO: maybe in the future?
    # Prioritize which segment to use for phasing at each SNP
    s = im.idist.best_segment_index(problem, segments)
    # For each segment, use it to phase at all SNPs at which it is the best segment
    for i, segment in enumerate(segments):
        ibd._phase_in_ibd_segment(problem, np.where(s == i)[0], np.array(list(segment.samples), dtype=np.uint), 'max')
Exemplo n.º 3
0
def phase_by_segment_priority(problem, segments):
    '''Given a list of segments, determine the best segment to use at each SNP, and phase using
    the max consensus. This assumes that segments are between pairs of haplotypes, one of which
    is filled.'''
    problem.info.ibd += segments  # Not grouping to disjoint here; TODO: maybe in the future?
    # Prioritize which segment to use for phasing at each SNP
    s = im.idist.best_segment_index(problem, segments)
    # For each segment, use it to phase at all SNPs at which it is the best segment
    for i, segment in enumerate(segments):
        ibd._phase_in_ibd_segment(
            problem,
            np.where(s == i)[0], np.array(list(segment.samples),
                                          dtype=np.uint), 'max')
Exemplo n.º 4
0
 def __phase_distant(self, problem, segments, sample):
     s = im.idist.best_segment_index(problem.info.snp['base_pair'], segments)
     for i, segment in enumerate(segments):
         ibd._phase_in_ibd_segment(problem, np.where(s == i)[0], np.array(list(segment.samples)), 'max')