def genes(testapp, project, institution, locations):
    """
    Posts a gene for every given location pair.

    NOTE: Gene locations of even index contain OMIM identifiers.
    """
    result = []
    for idx, location_pair in enumerate(locations):
        item = {
            "project": project["@id"],
            "institution": institution["@id"],
            "gene_symbol": "Gene_" + str(idx),
            "ensgid": "ENSG0000000" + str(1000 + idx),
            "spos": location_pair[0],
            "epos": location_pair[1],
        }
        if idx % 2 == 0:
            item["omim_id"] = [str(5000 + idx)]
        result.append(testapp.post_json("/gene", item, status=201).json["@graph"][0])
    return result