def taxid_flag(config, tool):
    """Set taxid flag for running blast searches."""
    taxid = config["taxon"].get("taxid", None)
    if taxid is None:
        return ""
    flags = {
        "blastn": "-negative_taxids",
        "diamond_blastp": "--taxon-exclude",
        "diamond_blastx": "--taxon-exclude"
    }
    return "%s %s" % (flags[tool], taxid)