(self, intervals)
return np.array(scores)
Query regions for scores.

        Parameters
        ----------
        intervals : list(tuple)
                    A list of tuples with the following format:
                        (chr, chrStart, chrEnd, strand)

        Returns
        -------
        scores : array_like
                 A numpy array containing scores for each tuple


        .. currentmodule:: .WigReader
        .. autosummary::
            .WigReader
Query regions for scores.
Query regions for scores .
def query(self, intervals):
        """ Query regions for scores.

        Parameters
        ----------
        intervals : list(tuple)
                    A list of tuples with the following format:
                        (chr, chrStart, chrEnd, strand)

        Returns
        -------
        scores : array_like
                 A numpy array containing scores for each tuple


        .. currentmodule:: .WigReader
        .. autosummary::
            .WigReader

        """
        scores = []
        chrom_lengths = self.get_chromosomes
        for chrom, chrom_start, chrom_end, strand in intervals:
            if chrom not in list(chrom_lengths.keys()):
                warnings.warn(
                    'Chromosome {} does not appear in the bigwig'.format(
                        chrom), UserWarning)
                continue

            chrom_length = chrom_lengths[chrom]
            if int(chrom_start) > chrom_length:
                raise Exception(
                    'Chromsome start point exceeds chromosome length: {}>{}'.
                    format(chrom_start, chrom_length))
            elif int(chrom_end) > chrom_length:
                raise Exception(
                    'Chromsome end point exceeds chromosome length: {}>{}'.
                    format(chrom_end, chrom_length))
            score = self.wig.values(chrom, int(chrom_start), int(chrom_end))
            if strand == '-':
                score.reverse()
            scores.append(score)
        return np.array(scores)
def query ( self , intervals ) : scores = [ ] chrom_lengths = self . get_chromosomes for chrom , chrom_start , chrom_end , strand in intervals : if chrom not in list ( chrom_lengths . keys ( ) ) : warnings . warn ( 'Chromosome {} does not appear in the bigwig' . format ( chrom ) , UserWarning ) continue chrom_length = chrom_lengths [ chrom ] if int ( chrom_start ) > chrom_length : raise Exception ( 'Chromsome start point exceeds chromosome length: {}>{}' . format ( chrom_start , chrom_length ) ) elif int ( chrom_end ) > chrom_length : raise Exception ( 'Chromsome end point exceeds chromosome length: {}>{}' . format ( chrom_end , chrom_length ) ) score = self . wig . values ( chrom , int ( chrom_start ) , int ( chrom_end ) ) if strand == '-' : score . reverse ( ) scores . append ( score ) return np . array ( scores )