%load_ext rpy2.ipython
%matplotlib inline
from matplotlib import pyplot as plt
import pandas as pd
from utils import functions as fxs
%load_ext autoreload
%autoreload 2
ctype='skcm'
cls = fxs.analysis()
fxs.plotParam()
cls.read_DHS_MutRate(ctype) #mutation rate for DHS centered and its controls
cls.read_TFBS_MutRate_distal(ctype, "tfbs-distal") # mutation rate for distal regions
fig=plt.figure(figsize=(5,6), facecolor='w')
NROW=2
NCOL=1
axss=[]
for item in range(0, NROW):
for col in range(0, NCOL):
axss.append(plt.subplot2grid((NROW,NCOL), (item, col)))
count=0
cls.plot_TFBS_MutRate_distal(axss[0], axss[1], "allTFs")
plt.tight_layout()
plt.show()
NROW = 4
NCOL = 3
fig = plt.figure(figsize=(5, 7))
axs=[]
for item in range(0, NROW):
axs.append(plt.subplot2grid((NROW, NCOL), (item, 0), colspan=2))
axs.append(plt.subplot2grid((NROW, NCOL), (item, 2)))
count=0
# DHS alone and bar plot
for atype in [ 'all-DHS', 'DHS-noPromoters-noTFBS', 'DHS-Promoters-noTFBS', 'DHS-Promoters-TFBS' ]:
cls.plot_DHS_MutRate(axs[count], axs[count+1], atype, ctype, 1000, 'selected')
count = count + 2
plt.tight_layout()
plt.show()