def phi_psi_omega_to_abego(phi: float, psi: float, omega: float) -> str:
    """
    :param: phi: The phi angle.
    :param: psi: The psi angle.
    :param: omega: The omega angle.
    :return: The abego string.
    From Buwei
    https://wiki.ipd.uw.edu/protocols/dry_lab/rosetta/scaffold_generation_with_piecewise_blueprint_builder
    """
    if psi == None or phi == None:
        return "X"
    if omega == None:
        omega = 180

    if abs(omega) < 90:
        return "O"
    elif phi > 0:
        if -100.0 <= psi < 100:
            return "G"
        else:
            return "E"
    else:
        if -75.0 <= psi < 50:
            return "A"
        else:
            return "B"