code: def _get_ref_from_galaxy_loc(name, genome_build, loc_file, galaxy_dt, need_remap,
                               galaxy_config, data):
      
      refs = [ref for dbkey, ref in _galaxy_loc_iter(loc_file, galaxy_dt, need_remap)
              if dbkey == genome_build]
      remap_fn = alignment.TOOLS[name].remap_index_fn
      need_remap = remap_fn is not None
      if len(refs) == 0:
          raise ValueError("Did not find genome build %s in bcbio installation: %s" %
                           (genome_build, os.path.normpath(loc_file)))
      else:
          cur_ref = refs[-1]
      # Find genome directory and check for packed wf tarballs
      cur_ref_norm = os.path.normpath(utils.add_full_path(cur_ref, galaxy_config["tool_data_path"]))
      base_dir_i = cur_ref_norm.find("/%s/" % genome_build)
      base_dir = os.path.join(cur_ref_norm[:base_dir_i], genome_build)
      for tarball in glob.glob(os.path.join(base_dir, "*-wf.tar.gz")):
          cwlutils.unpack_tarballs(tarball, {"dirs": {"work": base_dir}}, use_subdir=False)
      if need_remap:
          assert remap_fn is not None, "%s requires remapping function from base location file" % name
          cur_ref = os.path.normpath(utils.add_full_path(cur_ref, galaxy_config["tool_data_path"]))
          cur_ref = remap_fn(os.path.abspath(cur_ref))
      return cur_ref
docs: Retrieve reference genome file from Galaxy *.loc file.
  
      Reads from tool_data_table_conf.xml information for the index if it
      exists, otherwise uses heuristics to find line based on most common setups.