Plot enrichments from mapping data from ssDNA experiments

Enrichment numbers calculated based on bowtie alignment summary


In [2]:
from __future__ import division
%pylab inline
import seaborn as sns
sns.set_style('ticks')
sns.set_context('paper')


Populating the interactive namespace from numpy and matplotlib

In [2]:
# ssDNA-seq HUMAN (normed to HeLa WGS)

plt.figure(figsize=(1.25,1))

fold = [ 0.5206 ,5.6372]
cols = ['#999999','#e41a1c']

blist = plt.bar([0,0.3],fold,width=0.125,edgecolor='black',lw=0.8)
blist[0].set_facecolor('lightgrey')
blist[1].set_facecolor('black')
sns.despine(bottom=True,offset=10,trim=False)
plt.xticks([0,0.3],['Masked\nhg38','Alphoid'],size=12)
plt.yticks([0,2,4,6],size=10)
plt.title('Non-B-form DNA',size=12)
plt.ylabel('Fold enrichment\n(vs. WGS)',size=10)
plt.tick_params(length=0,axis='x')
plt.axhline(1,ls='dotted',c='grey')

for i,c in enumerate(cols):
    bar = blist[i]
    bar.set_linewidth(1)
    bar.set_edgecolor('black')
    bar.set_facecolor(c)

plt.savefig('../figures/human_non_canonical.svg',dpi=300,bbox='tight')



In [3]:
# ssDNA-seq MOUSE

plt.figure(figsize=(2.5,1.25))

fold_rest = [0.9683,1.6718,1.6568]
fold_act = [ 0.4212, 2.200, 1.825]

cols = ['#d9d9d9','#a6cee3','#fb9a99']
cols2 = ['#999999','#1f78b4','#e41a1c']

barpos = np.arange(3)
w=0.4

blist = plt.bar(barpos,fold_rest,width=w,edgecolor='black',lw=1)
blist2 = plt.bar(barpos+w,fold_act,width=w,edgecolor='black',lw=1)

sns.despine(bottom=True,offset=10,trim=False)
# plt.xticks(barpos+w/2,['Masked\nmm10','MaSat', 'MiSat'],size=16)
plt.xticks(np.concatenate([barpos,barpos+w]),['R','R','R','A','A','A'],size=12)
plt.yticks(size=10)
plt.title('Non-B-form DNA',size=12)
plt.ylabel('Fold enrichment\n(vs. WGS)',size=10)
plt.tick_params(length=0,axis='x')
plt.axhline(1,ls='dotted',c='grey')
# plt.minorticks_on()

for i,c in enumerate(cols):
    bar = blist[i]
    bar.set_linewidth(1)
    bar.set_edgecolor('black')
    bar.set_facecolor(c)

for i,c in enumerate(cols2):
    bar = blist2[i]
    bar.set_linewidth(1)
    bar.set_edgecolor('black')
    bar.set_facecolor(c)


plt.savefig('../figures/mouse_ssDNA.svg',dpi=300,bbox='tight')



In [13]:
# ssDNA-seq MOUSE

plt.figure(figsize=(2.5,1.25))

fold_rest = np.array([0.9683,1.6718,1.6568])/0.9683
fold_act = np.array([ 0.4212, 2.200, 1.825])/0.4212

cols = ['#d9d9d9','#a6cee3','#fb9a99']
cols2 = ['#999999','#1f78b4','#e41a1c']

barpos = np.arange(3)
w=0.4

blist = plt.bar(barpos,fold_rest,width=w,edgecolor='black',lw=1)
blist2 = plt.bar(barpos+w,fold_act,width=w,edgecolor='black',lw=1)

sns.despine(bottom=True,offset=10,trim=False)
# plt.xticks(barpos+w/2,['Masked\nmm10','MaSat', 'MiSat'],size=16)
plt.xticks(np.concatenate([barpos+w/2,barpos+3/2*w]),['R','R','R','A','A','A'],size=12)
plt.yticks(size=10)
plt.title('Non-B-form DNA',size=12)
plt.ylabel('Fold enrichment\n(vs. WGS)',size=10)
plt.tick_params(length=0,axis='x')
plt.axhline(1,ls='dotted',c='grey')
# plt.minorticks_on()

for i,c in enumerate(cols):
    bar = blist[i]
    bar.set_linewidth(1)
    bar.set_edgecolor('black')
    bar.set_facecolor(c)

for i,c in enumerate(cols2):
    bar = blist2[i]
    bar.set_linewidth(1)
    bar.set_edgecolor('black')
    bar.set_facecolor(c)


plt.savefig('../figures/mouse_ssDNA.svg',dpi=300,bbox='tight')



In [32]:
# ssDNA-seq HUMAN from Lai & Pugh (normed to K562 WGS)

plt.figure(figsize=(2,4))

fold = [ 0.2060 ,0.8552]
cols = ['#999999','#e41a1c']



blist = plt.bar([0,0.3],fold,width=0.2,edgecolor='black',lw=1)
blist[0].set_facecolor('lightgrey')
blist[1].set_facecolor('black')
sns.despine(bottom=True,offset=10,trim=False)
plt.xticks([0,0.3],['Masked\nhg38','Alphoid'],size=16)
plt.yticks(size=16)
plt.title('Non-canonical DNA\n(permanganate-seq;\n Lai & Pugh)',size=16)
plt.ylabel('Fold change (vs. WGS)',size=16)
plt.tick_params(length=0,axis='x')
plt.axhline(1,ls='dotted',c='grey')

for i,c in enumerate(cols):
    bar = blist[i]
    bar.set_linewidth(1)
    bar.set_edgecolor('black')
    bar.set_facecolor(c)

# plt.savefig('../figures/non_canonical.svg',dpi=300,bbox='tight')


# BLESS plt.figure(figsize=(3,4)) fold = [1.06,1.60] blist = plt.bar([0,0.3],fold,width=0.2,edgecolor='black',lw=1) blist[0].set_facecolor('lightgrey') blist[1].set_facecolor('black') sns.despine(bottom=True,offset=10,trim=False) plt.xticks([0,0.3],['Repeat-masked\nhg38','Alphoid'],size=12) plt.yticks(size=12) plt.title('DSBs (BLESS)',size=12) plt.ylabel('Fold change (vs. WGS)',size=12) plt.tick_params(length=0,axis='x') plt.axhline(1,ls='dotted',c='grey') plt.savefig('../figures/bless.pdf',dpi=300,bbox='tight') # Top2a plt.figure(figsize=(3,4)) fold = [ 1.05 ,1.20] blist = plt.bar([0,0.3],fold,width=0.2,edgecolor='black',lw=1) blist[0].set_facecolor('lightgrey') blist[1].set_facecolor('black') sns.despine(bottom=True,offset=10,trim=False) plt.xticks([0,0.3],['Repeat-masked\nhg38','Alphoid'],size=12) plt.yticks(size=12) plt.title('Top2a',size=12) plt.ylabel('Fold change (vs. WGS)',size=12) plt.tick_params(length=0,axis='x') plt.axhline(1,ls='dotted',c='grey') plt.savefig('../figures/Top2a.pdf',dpi=300,bbox='tight')