def create_orthofinder_line(graph, genomes_order):
    """
    Takes an OG (nx.Graph) and prepares a line
    (str) in orthofinder format
    """
    d = {genome: [] for genome in genomes_order}
    for node in graph.nodes:
      d[graph.nodes[node]['genome']].append(node)
    return '\t'.join([graph.orthogroup] + [', '.join(d[genome]) for genome in genomes_order])