In [4]:
from __future__ import division, print_function
%run shared_setup.ipynb
%run plotting_setup.ipynb
# %run fig_indel_size.ipynb
%run fig_indel_amino_acids.ipynb
# %run fig_indel_core_promoters.ipynb
In [16]:
fig = plt.figure(figsize=(8, 5))
import matplotlib.gridspec as gridspec
gs = gridspec.GridSpec((2, 20))
# plot coding indel size distribution
ax = fig.add_subplot(gs[])
plot_indel_size_stacked_hist(ax, coding=True, major_step=10, minor_step=1, minsize=-33, maxsize=33)
ax.set_ylabel('coding indels')
p = plt.Rectangle((0, 0), 1, 1, fc="k")
q = plt.Rectangle((0, 0), 1, 1, fc="w")
ax.legend([p, q], ['STR', 'non-STR'],
ncol=2, loc='upper center', bbox_to_anchor=(0.5, -.17))
# plot non-coding indel size distribution
ax = fig.add_subplot(2, 3, 4)
plot_indel_size_stacked_hist(ax, coding=False, major_step=10, minor_step=1, minsize=-33, maxsize=33)
ax.set_xlabel('indel size')
ax.set_ylabel('non-coding indels')
# plot coding insertion mutations
ax = plt.subplot2grid((2, 3), (0, 1), rowspan=1, colspan=2)
plot_indel_aa_frequencies(ax)
# plot STR indel diversity relative to core promoters
ax = fig.add_subplot(2, 3, 5)
#plot_indel_cp_diversity(ax, is_str=True)
ax.set_title('intergenic indels (STR)')
ax.set_ylabel('diversity (bp$^{-1}$)')
ax.set_xlabel('distance to core promoter')
# plot non-STR indel diversity relative to core promoters
ax = fig.add_subplot(2, 3, 6)
#plot_indel_cp_diversity(ax, is_str=False)
ax.set_yticks([])
ax.set_ylabel('')
ax.set_title('intergenic indels (non-STR)')
ax.set_xlabel('distance to core promoter')
# tidy up
fig.tight_layout(h_pad=1.8, w_pad=1.8);
ax = fig.add_axes([0, 0, 1, 1])
ax.set_axis_off()
ax.axvline(.28, lw=1, color='k')
ax.axhline(.53, xmin=.28, xmax=1, lw=1, color='k')
ax.text(.25, .97, 'A', fontsize=12, fontweight='bold', ha='right', va='top');
ax.text(.7, .97, 'B', fontsize=12, fontweight='bold', ha='center', va='top');
ax.text(.7, .52, 'C', fontsize=12, fontweight='bold', ha='center', va='top');
fig.savefig('../artwork/main/fig_indels_lores.jpeg', jpeg_quality=100, dpi=200)
In [ ]:
In [ ]: