def print_clusters(fastas, info, ANI):
header = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>','<STR_LIT>', '<STR_LIT>', '<STR_LIT:list>']<EOL>yield header<EOL>in_cluster = []<EOL>for cluster_num, cluster in enumerate(connected_components(ANI)):<EOL><INDENT>cluster = sorted([genome_info(genome, info[genome])for genome in cluster],key = lambda x: x[<NUM_LIT:0>:], reverse = True)<EOL>rep = cluster[<NUM_LIT:0>][-<NUM_LIT:1>]<EOL>cluster = [i[-<NUM_LIT:1>] for i in cluster]<EOL>size = len(cluster)<EOL>for genome in cluster:<EOL><INDENT>in_cluster.append(genome)<EOL>try:<EOL><INDENT>stats = [size, rep, genome,info[genome]['<STR_LIT>'], info[genome]['<STR_LIT>'],info[genome]['<STR_LIT>'], info[genome]['<STR_LIT>'], cluster]<EOL><DEDENT>except:<EOL><INDENT>stats = [size, rep, genome,'<STR_LIT>', '<STR_LIT>',info[genome]['<STR_LIT>'], info[genome]['<STR_LIT>'], cluster]<EOL><DEDENT>if rep == genome:<EOL><INDENT>stats = ['<STR_LIT>' % (cluster_num)] + stats<EOL><DEDENT>else:<EOL><INDENT>stats = [cluster_num] + stats<EOL><DEDENT>yield stats<EOL><DEDENT><DEDENT>try:<EOL><INDENT>start = cluster_num + <NUM_LIT:1><EOL><DEDENT>except:<EOL><INDENT>start = <NUM_LIT:0><EOL><DEDENT>fastas = set([i.rsplit('<STR_LIT:.>', <NUM_LIT:1>)[<NUM_LIT:0>].rsplit('<STR_LIT:/>', <NUM_LIT:1>)[-<NUM_LIT:1>].rsplit('<STR_LIT>')[<NUM_LIT:0>] for i in fastas])<EOL>for cluster_num, genome inenumerate(fastas.difference(set(in_cluster)), start):<EOL><INDENT>try:<EOL><INDENT>stats = ['<STR_LIT>' % (cluster_num), <NUM_LIT:1>, genome, genome,info[genome]['<STR_LIT>'], info[genome]['<STR_LIT>'],info[genome]['<STR_LIT>'], info[genome]['<STR_LIT>'], [genome]]<EOL><DEDENT>except:<EOL><INDENT>stats = ['<STR_LIT>' % (cluster_num), <NUM_LIT:1>, genome, genome,'<STR_LIT>', '<STR_LIT>',info[genome]['<STR_LIT>'], info[genome]['<STR_LIT>'], [genome]]<EOL><DEDENT>yield stats<EOL><DEDENT>
choose represenative genome and
print cluster information

*if ggKbase table is provided, use SCG info to choose best genome