changeset 1:adf18db4c14a draft

planemo upload for repository https://github.com/eteriSokhoyan/galaxytools/tree/master/tools/GraphClust/Plotting commit 4dd7269185f6fb9bdc007028007d6540f4cf057d
author rnateam
date Sat, 25 Mar 2017 16:53:09 -0400
parents edcf58ab7552
children ee8eccb7db4e
files MotifFinderPlot.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MotifFinderPlot.py	Wed Feb 22 16:53:29 2017 -0500
+++ b/MotifFinderPlot.py	Sat Mar 25 16:53:09 2017 -0400
@@ -9,7 +9,7 @@
 import pandas as pd
 import itertools
 import seaborn as sns
-
+import numpy as np
 
 def plot_bar(ranges, colors, orig_names, cluster_nums):
     fig, ax = plt.subplots()
@@ -18,12 +18,13 @@
 
     ax.set_xlim(0)
     ax.set_xlabel('position in sequence')
+    ax.set_yticks(np.arange(-1, len(ranges)))
     ax.set_yticklabels(['']+[k+'-'+orig_names[k] for k in sorted(ranges.keys())])
     ax.grid(True)
     fig.suptitle('Structure motif prediction\nRegions with same color are prediticted to have similar structures')
     # Add the legend
     patches = [mpatches.Patch(color=cluster_nums[lab], label=lab) for lab in sorted(cluster_nums)]
-    ax.legend(handles=patches, loc='best')  # , bbox_to_anchor=(1, 0.5), loc='center left')
+    ax.legend(handles=patches, loc='best', bbox_to_anchor=(1.2, 1.05))#, loc='center left')
     plt.savefig("motif_plot.png", bbox_inches='tight')
 
 
@@ -31,13 +32,12 @@
     currentdir_files = sorted(list(glob.glob('*')))
     print ("currentdir_files are: ", currentdir_files)
     print ("RESULTS_files are: ", sorted(list(glob.glob('RESULTS/*'))))
-    
+
     cluster_files = sorted(list(glob.glob('RESULTS/*.cluster.all')))
     if len(cluster_files) == 0:
         raise RuntimeError('Expected cluster.all search path is empty:{}'.format(cluster_files))
     palette = itertools.cycle(sns.color_palette("Set2", len(cluster_files)))
 
-
     ranges = defaultdict(list)
     colors = defaultdict(list)
     orig_names = defaultdict(list)