def _format_superfeatures_dict(json_dict, pml_dict):
    """
    Format superfeatures dictionary.

    Parameters
    ----------
    json_dict : dict
        Dictionary with JSON file information.
    pml_dict : dict
        Dictionary with PML file information.

    Returns
    -------
    dict
        Formatted dictionary as needed to initialize the dynophore's SuperFeature object using
        **kwargs.
    """

    # Save superfeatures as dict with superfeature IDs as keys
    superfeatures_dict = {
        superfeature["id"]: superfeature for superfeature in json_dict["superfeatures"]
    }

    for superfeature_id, superfeature in superfeatures_dict.items():
        # Add color to superfeatures
        color = pml_dict[superfeature_id]["color"]
        superfeature["color"] = color
        # Add cloud to superfeatures
        pml_dict[superfeature_id].pop("id")
        pml_dict[superfeature_id].pop("color")
        cloud = pml_dict[superfeature_id]
        superfeature["cloud"] = cloud
        # Save envpartners as dict with envpartner IDs as keys
        for envpartner in superfeature["envpartners"]:
            envpartner["residue_name"] = envpartner["name"].split("_")[0]
            envpartner["residue_number"] = int(envpartner["name"].split("_")[1])
            envpartner["chain"] = envpartner["name"].split("_")[2]
            envpartner["id"] = envpartner["id"].replace("_", "-")
            envpartner.pop("name")
        superfeature["envpartners"] = {
            envpartner["id"]: envpartner for envpartner in superfeature["envpartners"]
        }

    return superfeatures_dict