#!/usr/bin/env python # coding: utf-8 # In[1]: get_ipython().run_line_magic('load_ext', 'rpy2.ipython') get_ipython().run_line_magic('matplotlib', 'inline') from matplotlib import pyplot as plt from utils import functions as fxs # In[2]: get_ipython().run_line_magic('load_ext', 'autoreload') get_ipython().run_line_magic('autoreload', '2') # In[3]: ctype='skcm' cls = fxs.analysis() fxs.plotParam() #

Figure 3A - Mutation/repair in proximal and distal TFBS

# In[4]: fig = plt.figure(figsize=(10, 4)) NROW = 1 NCOL = 2 axs=[] for item in range(0, NROW): for col in range(0, NCOL): axs.append(plt.subplot2grid((NROW, NCOL), (item, col))) count=0 # flags for axis control yaxis={'PP64':1, 'CPD':1} xlabel={1000:0, 100:1} flank=1000 # for proximal TFBS-DHS pp='CPD' target='tfbs-proximal' title='proximal TFBS-DHS (n = 74,159)' # set axisParam [title, xaxis, xlabel, Lyaxis, Lylabel, Ryaxis, Rylabel ] axisParam = [title, 1, 0, 1, 1, 0, 0 ] # plot values cls.plot_TFBS_xrseq_combined(axs[count], pp, [ 'NHF1', 'CSB' ], "combined", flank, "allTFs", axisParam, target) count+=1 target = 'tfbs-distal' title='distal TFBS-DHS (n = 41,758)' # set axisParam [title, xaxis, xlabel, Lyaxis, Lylabel, Ryaxis, Rylabel ] axisParam = [title, 1, 0, 0, 0, 1, 1 ] # plot values cls.plot_TFBS_xrseq_combined(axs[count], pp, [ 'NHF1', 'CSB' ], "combined", flank, "allTFs", axisParam, target) count+=1 plt.tight_layout(pad=0, w_pad=0) plt.show() #

Figure 3B - TFBS seperated by binding strength

# In[5]: fig = plt.figure(figsize=(10, 2.5)) NROW = 1 NCOL = 4 axs=[] for item in range(0, NROW): for col in range(0, NCOL): axs.append(plt.subplot2grid((NROW, NCOL), (item, col))) count=0 # flags for axis control yaxis={'PP64':1, 'CPD':1} xlabel={1000:0, 500:0, 100:1} flank=200 # for proximal TFBS-DHS pp='CPD' target='tfbs-bs-seperated' title='Low (n = 4,878)' # set axisParam [title, xaxis, xlabel, Lyaxis, Lylabel, Ryaxis, Rylabel ] axisParam = [title, 1, 0, 1, 1, 0, 0 ] # plot values cls.plot_TFBS_xrseq_combined(axs[count], pp, [ 'NHF1', 'CSB' ], "combined", flank, "allTFs_0", axisParam, target) count+=1 title='Low-medium (n = 4,547)' # set axisParam [title, xaxis, xlabel, Lyaxis, Lylabel, Ryaxis, Rylabel ] axisParam = [title, 1, 0, 0, 0, 0, 0 ] # plot values cls.plot_TFBS_xrseq_combined(axs[count], pp, [ 'NHF1', 'CSB' ], "combined", flank, "allTFs_1", axisParam, target) count+=1 title='Medium-high (n = 4,580)' # set axisParam [title, xaxis, xlabel, Lyaxis, Lylabel, Ryaxis, Rylabel ] axisParam = [title, 1, 0, 0, 0, 0, 0 ] # plot values cls.plot_TFBS_xrseq_combined(axs[count], pp, [ 'NHF1', 'CSB' ], "combined", flank, "allTFs_2", axisParam, target) count+=1 title='High (n = 4,560)' # set axisParam [title, xaxis, xlabel, Lyaxis, Lylabel, Ryaxis, Rylabel ] axisParam = [title, 1, 0, 0, 0, 1, 1 ] # plot values cls.plot_TFBS_xrseq_combined(axs[count], pp, [ 'NHF1', 'CSB' ], "combined", flank, "allTFs_3", axisParam, target) count+=1 plt.tight_layout(pad=0, w_pad=0) plt.show()