def _write_clusters(fname, cluster_lookup, order):
    """ Writes the cluster lookup to file """
    fmt = '{}' + ' {}' * order
    with open(fname, 'w') as f:
        f.write(str(len(cluster_lookup)) + '\n\n')
        for c, i in cluster_lookup.items():
            line = fmt.format(*c, i) + '\n'
            f.write(line)
