changeset 20:64f0362c974e draft

planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
author mheinzl
date Wed, 08 May 2019 07:14:49 -0400
parents b7bccbbee4a7
children 89ddbe5ae2aa
files fsd.py
diffstat 1 files changed, 6 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/fsd.py	Wed May 08 07:08:41 2019 -0400
+++ b/fsd.py	Wed May 08 07:14:49 2019 -0400
@@ -78,7 +78,8 @@
     data_array_list = []
     list_to_plot_original = []
     colors = []
-
+    bins = numpy.arange(1, 22)
+    
     with open(title_file, "w") as output_file, PdfPages(title_file2) as pdf:
         fig = plt.figure()
         fig.subplots_adjust(left=0.12, right=0.97, bottom=0.23, top=0.94, hspace=0)
@@ -96,11 +97,7 @@
             # data1 = numpy.array(file1[:, 0]).astype(int)
             # bigFamilies = numpy.where(data1 > 20)[0]
             # data1[bigFamilies] = 22
-            if numpy.amax(integers) > 20:
-                bins = numpy.arange(numpy.amin(integers), numpy.amax(integers) + 1)
-                data1 = numpy.clip(integers, bins[0], bins[-1])
-            else:
-                data1 = integers
+            data1 = numpy.clip(integers, bins[0], bins[-1])
             name1 = name1.split(".tabular")[0]
             list_to_plot.append(data1)
             label.append(name1)
@@ -144,11 +141,7 @@
             # bigFamilies2 = numpy.where(data2 > 20)[0]
             # data2[bigFamilies2] = 22
 
-            if numpy.amax(integers) > 20:
-                bins = numpy.arange(numpy.amin(integers2), numpy.amax(integers2) + 1)
-                data2 = numpy.clip(integers2, bins[0], bins[-1])
-            else:
-                data2 = integers2
+            data2 = numpy.clip(integers2, bins[0], bins[-1])
             list_to_plot.append(data2)
             name2 = name2.split(".tabular")[0]
             label.append(name2)
@@ -193,11 +186,7 @@
             # bigFamilies3 = numpy.where(data3 > 20)[0]
             # data3[bigFamilies3] = 22
 
-            if numpy.amax(integers3) > 20:
-                bins = numpy.arange(numpy.amin(integers3), numpy.amax(integers3) + 1)
-                data3 = numpy.clip(integers3, bins[0], bins[-1])
-            else:
-                data3 = integers3
+            data3 = numpy.clip(integers3, bins[0], bins[-1])
             list_to_plot.append(data3)
             name3 = name3.split(".tabular")[0]
             label.append(name3)
@@ -242,11 +231,7 @@
             # data4 = numpy.asarray(file4[:, 0]).astype(int)
             # bigFamilies4 = numpy.where(data4 > 20)[0]
             # data4[bigFamilies4] = 22
-            if numpy.amax(integers4) > 20:
-                bins = numpy.arange(numpy.amin(integers4), numpy.amax(integers4) + 1)
-                data4 = numpy.clip(integers4, bins[0], bins[-1])
-            else:
-                data4 = integers4
+            data4 = numpy.clip(integers4, bins[0], bins[-1])
             list_to_plot.append(data4)
             name4 = name4.split(".tabular")[0]
             label.append(name4)
@@ -284,7 +269,6 @@
 
         maximumX = numpy.amax(numpy.concatenate(list_to_plot))
         minimumX = numpy.amin(numpy.concatenate(list_to_plot))
-        bins = numpy.arange(minimumX, maximumX + 1)
         list_to_plot2 = list_to_plot
         to_plot = ["Absolute frequencies", "Relative frequencies"]
         plt.xticks([], [])