@staticmethod
def calc_error(mz_exp, mz_calc, method='ppm'):
    """method should be ppm or ppb"""
    if method == 'ppm':
        multi_factor = 1000000
    elif method == 'ppb':
        multi_factor = 1000000
    elif method == 'perc':
        multi_factor = 100
    else:
        raise Exception(
            'method needs to be ppm or ppb, you have entered %s' % method)
    if mz_exp:
        return (mz_calc - mz_exp) / mz_calc * multi_factor
    else:
        raise Exception('Please set mz_calc first')
