code: def remap_index_fn(ref_file):
      
      index_dir = os.path.join(os.path.dirname(ref_file), os.pardir, "minimap2")
      if os.path.exists(index_dir) and os.path.isdir(index_dir):
          return index_dir
      else:
          return os.path.dirname(ref_file)
docs: minimap2 can build indexes on the fly but will also store commons ones.