import re


def generate_name(analysis_name, tool_name, logfc=1, fdr=0.05):
    """Generate name for gene sets."""
    analysis_name = analysis_name.strip().replace(" ", "_")
    analysis_name = re.sub(r"[^-\w.]", "", analysis_name)

    tool_name = tool_name.strip().replace(" ", "_")
    tool_name = re.sub(r"[^-\w.]", "", tool_name)

    return f"{analysis_name}_{tool_name}_logFC{logfc}_FDR{fdr}"