code: def print_genome_matrix(hits, fastas, id2desc, file_name):
      
      out = open(file_name, 'w')
      fastas = sorted(fastas)
      print('## percent identity between genomes', file=out)
      print('# - \t %s' % ('\t'.join(fastas)), file=out)
      for fasta in fastas:
          line = [fasta]
          for other in fastas:
              if other == fasta:
                  average = '-'
              else:
                  average = numpy.average([hits[fasta][other][i][3] for i in hits[fasta][other]])
              line.append(str(average))
          print('\t'.join(line), file=out)
      print('', file=out)
      print('## percent of orfs that are orthologous between genomes', file=out)
      print('# - \t %s' % ('\t'.join(fastas)), file=out)
      for fasta in fastas:
          line = [fasta]
          for other in fastas:
              if other == fasta:
                  percent = '-'
              else:
                  orthologs = float(len(hits[fasta][other]))
                  orfs = float(len([i for i in id2desc if id2desc[i][0] == fasta]))
                  percent = float(orthologs / orfs) * 100
              line.append(str(percent))
          print('\t'.join(line), file=out)
docs: optimize later? slow ...
      should combine with calculate_threshold module