<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def charge_series(seq, granularity=0.1):
 """Calculates the charge for pH 1-13. Parameters seq : str Sequence of amino acids. granularity : float, optional """

    if 'X' in seq:
        warnings.warn(_nc_warning_str, NoncanonicalWarning)
    ph_range = numpy.arange(1, 13, granularity)
    charge_at_ph = [sequence_charge(seq, ph) for ph in ph_range]
    return ph_range, charge_at_ph