code: def write_diff_summary(stats, options):
      
      # set output file name
      out_name = '%s_diff_stats.csv' % options.outname
      filename = os.path.join(os.getcwd(), out_name)
  
      # open file & create csv writer object
      f = open(filename, 'w')
      statswriter = csv.writer(f)
  
      # write header
      statswriter.writerow(stats['header'])
  
      # write auc
      line = ['AUC']
      for metric_tup in stats['AUC']:
          try:
              len(metric_tup)
              line.append('[%0.2f, %0.2f]' % (metric_tup[0], metric_tup[1]))
          except:
              line.append('%0.6f' % metric_tup)
      statswriter.writerow(line)
  
      # write enrichment factors
      for title in [x for x in sorted(stats.keys()) if 'E' in x]:
          line = [title]
          for metric_tup in stats[title]:
              try:
                  len(metric_tup)
                  line.append('[%0.2f, %0.2f]' % (metric_tup[0], metric_tup[1]))
              except:
                  line.append('%0.12f' % metric_tup)
          statswriter.writerow(line)
docs: writes contents of stats to outname_diff_stats.csv
      :param stats:
      :param options: