コード例 #1
0
ファイル: phase_distant.py プロジェクト: orenlivne/ober
 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')
コード例 #2
0
ファイル: phase_distant.py プロジェクト: orenlivne/ober
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')
コード例 #3
0
ファイル: phase_distant.py プロジェクト: orenlivne/ober
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')
コード例 #4
0
ファイル: phase_distant.py プロジェクト: orenlivne/ober
 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')