def _is_decoy_suffix(pg, suffix='_DECOY'):
    """Determine if a protein group should be considered decoy.

    This function checks that all protein names in a group end with `suffix`.
    You may need to provide your own function for correct filtering and FDR estimation.

    Parameters
    ----------

    pg : dict
        A protein group dict produced by the :py:class:`ProtXML` parser.
    suffix : str, optional
        A suffix used to mark decoy proteins. Default is `'_DECOY'`.

    Returns
    -------

    out : bool
    """
    return all(p['protein_name'].endswith(suffix) for p in pg['protein'])