code: def print_genome_matrix(hits, fastas, id2desc, file_name):
      out = open(file_name, 'w')
      fastas = sorted(fastas)
      print('
      print('
      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('
      print('
      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)