コード例 #1
0
ファイル: ab_coding.py プロジェクト: fw1121/ngs_crumbs
    def __init__(self, vcf_fhand, parents_a, parents_b,
                 parent_index_threshold=DEF_AB_CODER_THRESHOLD,
                 offspring=None, window=DEF_AB_CODING_WIN,
                 smooth_threhsold=None, recomb_threshold=None):
        # TODO a min number of genotypes to evaluate anything
        self._reader = pyvcfReader(vcf_fhand)
        self._offspring = offspring
        self.window = window
        self.parent_index_threshold = parent_index_threshold
        self.log = Counter()
        self.indexes = array('f')

        samples = self._reader.samples
        parents = set(parents_a + parents_b)
        missing_parents = parents.difference(samples)
        if missing_parents:
            msg = 'Some parents are not found in the vcf file: '
            msg += ','.join(missing_parents)
            raise ValueError(msg)
        self.parents_a = parents_a
        self.parents_b = parents_b

        self.smooth_threhsold = smooth_threhsold
        self.recomb_threshold = recomb_threshold
        self._recombs = array('B')
        self._smoothes = array('f')
コード例 #2
0
    def __init__(self,
                 vcf_fhand,
                 parents_a,
                 parents_b,
                 parent_index_threshold=DEF_AB_CODER_THRESHOLD,
                 offspring=None,
                 window=DEF_AB_CODING_WIN,
                 smooth_threhsold=None,
                 recomb_threshold=None):
        # TODO a min number of genotypes to evaluate anything
        self._reader = pyvcfReader(vcf_fhand)
        self._offspring = offspring
        self.window = window
        self.parent_index_threshold = parent_index_threshold
        self.log = Counter()
        self.indexes = array('f')

        samples = self._reader.samples
        parents = set(parents_a + parents_b)
        missing_parents = parents.difference(samples)
        if missing_parents:
            msg = 'Some parents are not found in the vcf file: '
            msg += ','.join(missing_parents)
            raise ValueError(msg)
        self.parents_a = parents_a
        self.parents_b = parents_b

        self.smooth_threhsold = smooth_threhsold
        self.recomb_threshold = recomb_threshold
        self._recombs = array('B')
        self._smoothes = array('f')
コード例 #3
0
 def __init__(self, fhand, compressed=None, filename=None,
              min_calls_for_pop_stats=DEF_MIN_CALLS_FOR_POP_STATS):
     self.fhand = fhand
     self.pyvcf_reader = pyvcfReader(fsock=fhand, compressed=compressed,
                                     filename=filename)
     self.min_calls_for_pop_stats = min_calls_for_pop_stats
     self._snpcaller = None
     self._samples = self.pyvcf_reader.samples
     self._header_lines = self.pyvcf_reader._header_lines
     self._column_headers = self.pyvcf_reader._column_headers