puretabix/tabix.py
def region_to_bin(begin, end):
        """
        returns the index of the smallest bin that contains the region
        as a half-closed half-open interval
        """
        if begin >> 14 == end >> 14:
            return ((1 << 15) - 1) // 7 + (begin >> 14)
        elif begin >> 17 == end >> 17:
            return ((1 << 12) - 1) // 7 + (begin >> 17)
        elif begin >> 20 == end >> 20:
            return ((1 << 9) - 1) // 7 + (begin >> 20)
        elif begin >> 23 == end >> 23:
            return ((1 << 6) - 1) // 7 + (begin >> 23)
        elif begin >> 26 == end >> 26:
            return ((1 << 3) - 1) // 7 + (begin >> 26)
        return 0

        returns the index of the smallest bin that contains the region
        as a half-closed half-open interval
        
returns the index of the smallest bin that contains the region
as a half-closed half-open interval
returns the index of the smallest bin that contains the region as a half - closed half - open interval
def region_to_bin(begin, end):
        if begin >> 14 == end >> 14:
            return ((1 << 15) - 1) // 7 + (begin >> 14)
        elif begin >> 17 == end >> 17:
            return ((1 << 12) - 1) // 7 + (begin >> 17)
        elif begin >> 20 == end >> 20:
            return ((1 << 9) - 1) // 7 + (begin >> 20)
        elif begin >> 23 == end >> 23:
            return ((1 << 6) - 1) // 7 + (begin >> 23)
        elif begin >> 26 == end >> 26:
            return ((1 << 3) - 1) // 7 + (begin >> 26)
        return 0
def region_to_bin ( begin , end ) : if begin >> 14 == end >> 14 : return ( ( 1 << 15 ) - 1 ) // 7 + ( begin >> 14 ) elif begin >> 17 == end >> 17 : return ( ( 1 << 12 ) - 1 ) // 7 + ( begin >> 17 ) elif begin >> 20 == end >> 20 : return ( ( 1 << 9 ) - 1 ) // 7 + ( begin >> 20 ) elif begin >> 23 == end >> 23 : return ( ( 1 << 6 ) - 1 ) // 7 + ( begin >> 23 ) elif begin >> 26 == end >> 26 : return ( ( 1 << 3 ) - 1 ) // 7 + ( begin >> 26 ) return 0
returns the index of the smallest bin that contains the region
as a half-closed half-open interval
returns the index of the smallest bin that contains the region as a half - closed half - open interval
"""
        returns the index of the smallest bin that contains the region
        as a half-closed half-open interval
        """
begin
end