def _get_sel_code(sel, **kwargs):
    """
    Get selection code.

    Args:
        sel (str):
          | selection string (case independant)
          | "system" or "all": all atoms
          | "protein": protein atoms
          | "ca" or "calpha": CA atoms
          | "bb" or "backbone": backbone atoms
    Returns:
        sel_code (str)
          | "0": code for system
          | "1": code for protein
          | "3": code for CA
          | "4": code for BB
    """
    if sel.lower() == "system" or sel.lower() == "all":
        sel_code = "0"
    elif sel.lower() == "protein":
        sel_code = "1"
    elif sel.lower() == "ca" or sel.lower() == "calpha":
        sel_code = "3"
    elif sel.lower() == "bb" or sel.lower() == "backbone":
        sel_code = "4"
    else:
        raise ValueError("Unsupported selection string. Modify code to add more cases")

    return sel_code