Exemple #1
0
    def detect_change_points(self, *args, **kwargs):
        '''
        *args, **kwargs: passed directly to 'run_changepoint'

        returns list of ChangePoint tuples
        '''
        changepts = []
        for n in self.G.nodes_iter():
            expr_data = self.get_expr_data(*n)
            for cp in run_changepoint(expr_data, *args, **kwargs):
                # add offset from start of node to change point positions
                cp = cp._replace(pos=n.start + cp.pos,
                                 start=n.start + cp.start,
                                 end=n.start + cp.end)
                changepts.append(cp)
                logging.debug('%s changepoint node=(%s-%s) '
                              'pos=%d interval=(%d-%d) p=%.3f fc=%.3f' %
                              (str(self), n.start, n.end, cp.pos, cp.start,
                               cp.end, cp.pvalue, cp.foldchange))
        return changepts
Exemple #2
0
    def detect_change_points(self, *args, **kwargs):
        '''
        *args, **kwargs: passed directly to 'run_changepoint'

        returns list of ChangePoint tuples
        '''
        changepts = []
        for n in self.G.nodes_iter():
            expr_data = self.get_expr_data(*n)
            for cp in run_changepoint(expr_data, *args, **kwargs):
                # add offset from start of node to change point positions
                cp = cp._replace(pos=n.start + cp.pos,
                                 start=n.start + cp.start,
                                 end=n.start + cp.end)
                changepts.append(cp)
                logging.debug('%s changepoint node=(%s-%s) '
                              'pos=%d interval=(%d-%d) p=%.3f fc=%.3f' %
                              (str(self), n.start,
                               n.end, cp.pos, cp.start, cp.end,
                               cp.pvalue, cp.foldchange))
        return changepts
    def detect_change_points(self, *args, **kwargs):
        '''
        *args, **kwargs: passed directly to 'run_changepoint'

        returns list of ChangePoint tuples
        '''
        changepts = []
        for n_id in self.G:
            n = self.get_node_interval(n_id)
            expr_data = self.get_expr_data(n.start, n.end)
            for cp in run_changepoint(expr_data, *args, **kwargs):
                # add offset from start of node to change point positions
                cp = cp._replace(pos=n.start + cp.pos,
                                 start=n.start + cp.start,
                                 end=n.start + cp.end)
                changepts.append(cp)
                logging.debug(
                    '\t%s:%d-%d[%s] node: %s-%s cp:%d(%d-%d) '
                    'p=%.3f fc=%.3f' %
                    (self.chrom, self.start, self.end,
                     Strand.to_gtf(self.strand), n.start, n.end, cp.pos,
                     cp.start, cp.end, cp.pvalue, cp.foldchange))
        return changepts
    def detect_change_points(self, *args, **kwargs):
        '''
        *args, **kwargs: passed directly to 'run_changepoint'

        returns list of ChangePoint tuples
        '''
        changepts = []
        for n_id in self.G:
            n = self.get_node_interval(n_id)
            expr_data = self.get_expr_data(n.start, n.end)
            for cp in run_changepoint(expr_data, *args, **kwargs):
                # add offset from start of node to change point positions
                cp = cp._replace(pos=n.start + cp.pos,
                                 start=n.start + cp.start,
                                 end=n.start + cp.end)
                changepts.append(cp)
                logging.debug('\t%s:%d-%d[%s] node: %s-%s cp:%d(%d-%d) '
                              'p=%.3f fc=%.3f' %
                              (self.chrom, self.start, self.end,
                               Strand.to_gtf(self.strand), n.start,
                               n.end, cp.pos, cp.start, cp.end,
                               cp.pvalue, cp.foldchange))
        return changepts