Calculates the isoelectric point of the sequence for ph 1-13.

    Parameters
    ----------
    seq : str
        Sequence of amino acids.
    granularity : float, optional
        Granularity of pH values i.e. if 0.1 pH = [1.0, 1.1, 1.2...]

def sequence_isoelectric_point(seq, granularity=0.1):
    """Calculates the isoelectric point of the sequence for ph 1-13.

    Parameters
    ----------
    seq : str
        Sequence of amino acids.
    granularity : float, optional
        Granularity of pH values i.e. if 0.1 pH = [1.0, 1.1, 1.2...]
    """
    if 'X' in seq:
        warnings.warn(_nc_warning_str, NoncanonicalWarning)
    ph_range, charge_at_ph = charge_series(seq, granularity)
    abs_charge_at_ph = [abs(ch) for ch in charge_at_ph]
    pi_index = min(enumerate(abs_charge_at_ph), key=lambda x: x[1])[0]
    return ph_range[pi_index]