code: def as_bits( region_start, region_length, intervals ):
      
      bits = BitSet( region_length )
      for chr, start, stop in intervals:
          bits.set_range( start - region_start, stop - start )
      return bits
docs: 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.