def get_refs(genome_build, aligner, config):
    """Retrieve reference genome data from a standard bcbio directory structure.
    """
    ref_collection = tz.get_in(["arvados", "reference"], config)
    if not ref_collection:
        raise ValueError("Could not find reference collection in bcbio_system YAML for arvados.")
    cfiles = collection_files(ref_collection, config["arvados"])
    ref_prefix = None
    for prefix in ["./%s", "./genomes/%s"]:
        cur_prefix = prefix % genome_build
        if any(x.startswith(cur_prefix) for x in cfiles):
            ref_prefix = cur_prefix
            break
    assert ref_prefix, "Did not find genome files for %s:\n%s" % (genome_build, pprint.pformat(cfiles))
    out = {}
    base_targets = ("/%s.fa" % genome_build, "/mainIndex")
    for dirname in ["seq", "rtg", aligner]:
        key = {"seq": "fasta"}.get(dirname, dirname)
        cur_files = [x for x in cfiles if x.startswith("%s/%s/" % (ref_prefix, dirname))]
        cur_files = ["keep:%s" % os.path.normpath(os.path.join(ref_collection, x)) for x in cur_files]
        base_files = [x for x in cur_files if x.endswith(base_targets)]
        if len(base_files) > 0:
            assert len(base_files) == 1, base_files
            base_file = base_files[0]
            del cur_files[cur_files.index(base_file)]
            out[key] = {"base": base_file, "indexes": cur_files}
        else:
            out[key] = {"indexes": cur_files}
    return out
dataset/ETHPy150Open chapmanb/bcbio-nextgen-vm/bcbiovm/arvados/retriever.py/get_refs/original