Mercurial > repos > mheinzl > fsd_regions
comparison fsd_regions.py @ 1:9ce2b4089c1b draft
planemo upload for repository https://github.com/monikaheinzl/galaxyProject/tree/master/tools/fsd_regions commit b9403b3ce2b7a41fa8ee1aa47909152de78cf641
author | mheinzl |
---|---|
date | Tue, 15 May 2018 13:50:29 -0400 |
parents | b82fdb006304 |
children | 2631864873d7 |
comparison
equal
deleted
inserted
replaced
0:b82fdb006304 | 1:9ce2b4089c1b |
---|---|
106 minimumX = numpy.amin(numpy.concatenate(quantAfterRegion)) | 106 minimumX = numpy.amin(numpy.concatenate(quantAfterRegion)) |
107 | 107 |
108 ### PLOT ### | 108 ### PLOT ### |
109 plt.rc('figure', figsize=(11.69, 8.27)) # A4 format | 109 plt.rc('figure', figsize=(11.69, 8.27)) # A4 format |
110 plt.rcParams['axes.facecolor'] = "E0E0E0" # grey background color | 110 plt.rcParams['axes.facecolor'] = "E0E0E0" # grey background color |
111 plt.rcParams['xtick.labelsize'] = 12 | 111 plt.rcParams['xtick.labelsize'] = 14 |
112 plt.rcParams['ytick.labelsize'] = 12 | 112 plt.rcParams['ytick.labelsize'] = 14 |
113 plt.rcParams['patch.edgecolor'] = "black" | 113 plt.rcParams['patch.edgecolor'] = "black" |
114 fig = plt.figure() | 114 fig = plt.figure() |
115 plt.subplots_adjust(bottom=0.3) | 115 plt.subplots_adjust(bottom=0.3) |
116 | 116 |
117 colors = ["#6E6E6E", "#0431B4", "#5FB404", "#B40431", "#F4FA58", "#DF7401", "#81DAF5"] | 117 colors = ["#6E6E6E", "#0431B4", "#5FB404", "#B40431", "#F4FA58", "#DF7401", "#81DAF5"] |
154 for i, s, count in zip(groupUnique, space, quantAfterRegion): | 154 for i, s, count in zip(groupUnique, space, quantAfterRegion): |
155 plt.text(0.6, 0.05 + s, "{}=\n".format(i), size=11, transform=plt.gcf().transFigure) | 155 plt.text(0.6, 0.05 + s, "{}=\n".format(i), size=11, transform=plt.gcf().transFigure) |
156 plt.text(0.75, 0.05 + s, "{:,}\n".format(len(count) / 2), size=11, transform=plt.gcf().transFigure) | 156 plt.text(0.75, 0.05 + s, "{:,}\n".format(len(count) / 2), size=11, transform=plt.gcf().transFigure) |
157 | 157 |
158 plt.legend(loc='upper right', fontsize=14, bbox_to_anchor=(0.9, 1), frameon=True) | 158 plt.legend(loc='upper right', fontsize=14, bbox_to_anchor=(0.9, 1), frameon=True) |
159 plt.title(name1, fontsize=14) | 159 #plt.title(name1, fontsize=14) |
160 plt.xlabel("No. of Family Members", fontsize=12) | 160 plt.xlabel("Family size", fontsize=14) |
161 plt.ylabel("Absolute Frequency", fontsize=12) | 161 plt.ylabel("Absolute Frequency", fontsize=14) |
162 plt.grid(b=True, which="major", color="#424242", linestyle=":") | 162 plt.grid(b=True, which="major", color="#424242", linestyle=":") |
163 plt.margins(0.01, None) | 163 plt.margins(0.01, None) |
164 | 164 |
165 # plt.savefig("{}_regions.pdf".format(title_file), bbox_inch="tight") | 165 # plt.savefig("{}_regions.pdf".format(title_file), bbox_inch="tight") |
166 pdf.savefig(fig, bbox_inch="tight") | 166 pdf.savefig(fig, bbox_inch="tight") |
167 plt.close() | 167 plt.close() |
168 | 168 |
169 output_file.write("Dataset:{}{}\n".format(sep, firstFile)) | 169 output_file.write("Dataset:{}{}\n".format(sep, name1)) |
170 output_file.write("{}AB{}BA\n".format(sep, sep)) | 170 output_file.write("{}AB{}BA\n".format(sep, sep)) |
171 output_file.write("max. family size:{}{}{}{}\n".format(sep, max(map(int, quant_ab)), sep, max(map(int, quant_ba)))) | 171 output_file.write("max. family size:{}{}{}{}\n".format(sep, max(map(int, quant_ab)), sep, max(map(int, quant_ba)))) |
172 output_file.write("absolute frequency:{}{}{}{}\n".format(sep, count[len(count) - 1], sep, count2[len(count2) - 1])) | 172 output_file.write("absolute frequency:{}{}{}{}\n".format(sep, count[len(count) - 1], sep, count2[len(count2) - 1])) |
173 output_file.write("relative frequency:{}{:.3f}{}{:.3f}\n\n".format(sep, float(count[len(count) - 1]) / sum(count), sep, float(count2[len(count2) - 1]) / sum(count2))) | 173 output_file.write("relative frequency:{}{:.3f}{}{:.3f}\n\n".format(sep, float(count[len(count) - 1]) / sum(count), sep, float(count2[len(count2) - 1]) / sum(count2))) |
174 output_file.write("total nr. of reads{}{}\n".format(sep, sum(numpy.array(data_array[:, 0]).astype(int)))) | 174 output_file.write("total nr. of reads{}{}\n".format(sep, sum(numpy.array(data_array[:, 0]).astype(int)))) |