def as_bits( region_start, region_length, intervals ):
    """
    Convert a set of intervals overlapping a region of a chromosome into 
    a bitset for just that region with the bits covered by the intervals 
    set.
    """
    bits = BitSet( region_length )
    for chr, start, stop in intervals:
        bits.set_range( start - region_start, stop - start )
    return bits