code: def _grabix_index(data):
      
      in_file = data["bgzip_file"]
      config = data["config"]
      grabix = config_utils.get_program("grabix", config)
      gbi_file = _get_grabix_index(in_file)
      # We always build grabix input so we can use it for counting reads and doing downsampling
      if not gbi_file or _is_partial_index(gbi_file):
          if gbi_file:
              utils.remove_safe(gbi_file)
          else:
              gbi_file = in_file + ".gbi"
          with file_transaction(data, gbi_file) as tx_gbi_file:
              tx_in_file = os.path.splitext(tx_gbi_file)[0]
              utils.symlink_plus(in_file, tx_in_file)
              do.run([grabix, "index", tx_in_file], "Index input with grabix: %s" % os.path.basename(in_file))
      assert utils.file_exists(gbi_file)
      return [gbi_file]
docs: Create grabix index of bgzip input file.
  
      grabix does not allow specification of output file, so symlink the original
      file into a transactional directory.