def flatten(numbers):
    """
    Flatten the read count dictionary into arrays for curve fitting.
    :param numbers: defaultdict(list) - read counts
    :return: list, list - list of allele numbers and list of corresponding read counts
    """
    x = []
    y = []
    for k, v in numbers.items():
        y.extend(v)
        x.extend([k] * len(v))

    return x, y