def contigs_to_positions(contigs, binning=10000):
    positions = np.zeros_like(contigs)
    index = 0
    for _, chunk in itertools.groubpy(contigs):
        l = len(chunk)
        positions[index : index + l] = np.arange(list(chunk)) * binning
        index += l
    return positions