def enrichment_top_x(ligand_vs_kinase_data, top_x):
    """
    Calculate the enrichment in the top x% (`top_x`) of ranked kinases.

    Parameters
    ----------
    ranks : pandas.DataFrame
        Must use `src.evaluation.kinase_ranks.kinase_ranks_by_ligand_vs_kinase_data`. See this
        return value description in this function's docstring.
    ligand_kinase_method : str
        Name for ligand profiling method to be used as identifier in `ranks`.
    kinase_kinase_method : str
        Name for kinase distances method to be used as identifier in `ranks`.
    top_x : float
        The top x% of ranked kinases.

    Returns
    -------
    ratio_ranked_data : float
        Percentage of ranked data in `top_x` (x value in enrichment plot).
    ratio_active_kinases_identified : float
        Percentage of active kinases in `top_x` (y value in enrichment plot).

    Notes
    -----
    See notes in `enrichment_plot_data`.
    """

    # Get number of kinases in top x% and in total
    kinases_total = ligand_vs_kinase_data.data
    n_kinases_total = kinases_total.shape[0]
    n_kinases_top_x = int(n_kinases_total * top_x / 100.0)
    kinases_top_x = kinases_total.head(n_kinases_top_x)

    # Get number of active kinases in top x% and in total
    n_active_kinases_total = kinases_total[
        f"{ligand_vs_kinase_data.ligand_kinase_method}.active"
    ].sum()
    n_active_kinases_top_x = kinases_top_x[
        f"{ligand_vs_kinase_data.ligand_kinase_method}.active"
    ].sum()

    # Calculate important ratios
    ratio_ranked_data = n_kinases_top_x / n_kinases_total * 100
    ratio_active_kinases_identified = n_active_kinases_top_x / n_active_kinases_total * 100

    return ratio_ranked_data, ratio_active_kinases_identified