code: def binned_bitsets_by_chrom( f, chrom, chrom_col=0, start_col=1, end_col=2):
      
      bitset = BinnedBitSet( MAX )
      for line in f:
          if line.startswith("#"): continue
          fields = line.split()
          if fields[chrom_col] == chrom:
              start, end = int( fields[start_col] ), int( fields[end_col] )
              bitset.set_range( start, end-start )
      return bitset
docs: Read a file by chrom name into a bitset