puretabix/tabix.py
def region_to_bins(begin, end, n_levels=5, min_shift=14):
        """
        generator of keys to bins of records which *may* overlap the given region

        n_levels: int, optional
            cluster level, 5 for tabix
        min_shift: int, optional
            minimum shift, 14 for tabix
        """
        t = 0
        s = min_shift + (n_levels << 1) + n_levels
        for level in range(n_levels + 1):
            b = t + (begin >> s)
            e = t + (end >> s)
            n = e - b + 1
            for k in range(b, e + 1):
                yield k
                n += 1
            t += 1 << ((level << 1) + level)
            s -= 3

        generator of keys to bins of records which *may* overlap the given region

        n_levels: int, optional
            cluster level, 5 for tabix
        min_shift: int, optional
            minimum shift, 14 for tabix
        
generator of keys to bins of records which *may* overlap the given region
n_levels: int, optional
cluster level, 5 for tabix
min_shift: int, optional
minimum shift, 14 for tabix
generator of keys to bins of records which * may * overlap the given region n_levels : int optional cluster level 5 for tabix min_shift : int optional minimum shift 14 for tabix
def region_to_bins(begin, end, n_levels=5, min_shift=14):
        t = 0
        s = min_shift + (n_levels << 1) + n_levels
        for level in range(n_levels + 1):
            b = t + (begin >> s)
            e = t + (end >> s)
            n = e - b + 1
            for k in range(b, e + 1):
                yield k
                n += 1
            t += 1 << ((level << 1) + level)
            s -= 3
def region_to_bins ( begin , end , n_levels = 5 , min_shift = 14 ) : t = 0 s = min_shift + ( n_levels << 1 ) + n_levels for level in range ( n_levels + 1 ) : b = t + ( begin >> s ) e = t + ( end >> s ) n = e - b + 1 for k in range ( b , e + 1 ) : yield k n += 1 t += 1 << ( ( level << 1 ) + level ) s -= 3
generator of keys to bins of records which *may* overlap the given region
n_levels: int, optional
cluster level, 5 for tabix
min_shift: int, optional
minimum shift, 14 for tabix
generator of keys to bins of records which * may * overlap the given region n_levels : int optional cluster level 5 for tabix min_shift : int optional minimum shift 14 for tabix
"""
        generator of keys to bins of records which *may* overlap the given region

        n_levels: int, optional
            cluster level, 5 for tabix
        min_shift: int, optional
            minimum shift, 14 for tabix
        """
begin
end
n_levels
min_shift