def finalize(genomes, env):
    """Provide symlinks back to reference genomes so tophat avoids generating FASTA genomes.
    """
    genome_dir = os.path.join(env.data_files, "genomes")
    for (orgname, gid, manager) in genomes:
        org_dir = os.path.join(genome_dir, orgname)
        for aligner in ["bowtie", "bowtie2"]:
            aligner_dir = os.path.join(org_dir, gid, aligner)
            if env.safe_exists(aligner_dir):
                with cd(aligner_dir):
                    for ext in ["", ".fai"]:
                        orig_seq = os.path.join(os.pardir, "seq", (gid, ext) % "%s.fa%s")
                        if env.safe_exists(orig_seq) and not env.safe_exists(os.path.basename(orig_seq)):
                            env.safe_run("ln -sf %s" % orig_seq)
dataset/ETHPy150Open chapmanb/cloudbiolinux/cloudbio/biodata/rnaseq.py/finalize/swapped operands of `%`