In [1]:
%run ../../shared_setup.ipynb
In [2]:
df_core_promoter_diversity_50 = pandas.read_pickle(os.path.join(CACHE_DIR, 'df_core_promoter_diversity_50'))
df_core_promoter_diversity_50.head()
Out[2]:
In [3]:
def plot_indel_cp_diversity(ax, is_str, xlim=(-500, 500), ylim=(0, .002), markersize=12, n_boot=1000):
df = df_core_promoter_diversity_50
x = df.site_dist
sns.despine(offset=5, ax=ax)
if is_str:
y = df.indel_str_diversity_all
else:
y = df.indel_nostr_diversity_all
ax.axhline(np.mean(y), color='k', linestyle=':')
sns.regplot(x, y, x_estimator=np.mean, fit_reg=False, ax=ax, color='k', scatter_kws=dict(s=markersize), n_boot=n_boot)
ax.set_xlim(*xlim)
ax.set_ylim(*ylim)
ax.set_xlabel('distance to core promoter (bp)')
yticks = np.arange(ylim[0], ylim[1] + .0005, .0005)
ax.set_yticks(yticks)
ax.set_yticklabels(yticks * 1000)
ax.set_ylabel('diversity (kbp$^{-1}$)')
# ax.text(0, 1, '$\\times10^{-3}$', transform=ax.transAxes)
return ax
In [4]:
width = 8 * (1/3)
height = width / 1.2
fig, ax = plt.subplots(figsize=(width, height))
plot_indel_cp_diversity(ax, is_str=True, n_boot=1000)
fig.tight_layout()
fig.savefig('../../artwork/main/fig1C1.jpeg', dpi=1200, jpeg_quality=100);
In [5]:
width = 8 * (1/3)
height = width / 1.2
fig, ax = plt.subplots(figsize=(width, height))
plot_indel_cp_diversity(ax, is_str=False, n_boot=1000)
fig.tight_layout()
fig.savefig('../../artwork/main/fig1C2.jpeg', dpi=1200, jpeg_quality=100);
In [5]: