def write_size_distribution_dataframe_global(readDict, size_distribution_file, pol=["both"]):
  with open(size_distribution_file, 'w') as size_distrib:
    print >>size_distrib, "gene\tpolarity\tsize\tcount\tsample"
    for sample in readDict.keys():
      histogram = readDict[sample].size_histogram()
      gene="sample"
      for polarity in pol:
        for size, count in histogram[polarity].iteritems():
          print >>size_distrib, "%s\t%s\t%s\t%s\t%s" % (gene, polarity, size, count, sample)
dataset/ETHPy150Open ARTbio/tools-artbio/tools/msp_sr_size_histograms/size_histogram.py/write_size_distribution_dataframe_global/original