Import everything from the imports notebook. This reads in all of the expression data as well as the functions needed to analyse differential expression data.
In [1]:
import NotebookImport
from Imports import *
matched_meth is our matched methylation data.
In [3]:
matched_meth = pd.read_hdf(METH_STORE, 'matched_tn')
matched_meth = matched_meth.groupby(axis=1, level=[0,1]).first()
In [4]:
matched_meth.T.head(10).T.head()
Out[4]:
In [5]:
matched_meth.shape[1] / 2
Out[5]:
Read in matched Gene and miRNA expression data.
In [6]:
matched_rna = matched_tn
matched_mir = pd.read_hdf(MIRNA_STORE, 'matched_tn')
In [7]:
dx_rna = binomial_test_screen(matched_rna, fc=1.)
dx_rna = dx_rna[dx_rna.num_dx > 300]
In [10]:
dx_rna.sort('p').head(10)
Out[10]:
In [9]:
dx_rna.ix['FOXM1']
Out[9]:
Not only is ADH1B the most downregulated gene, but many of the other genes in the ADH familly have large effects as well. I go into this with a bit more depth in the alcohol_metabolism Notebook.
In [11]:
#Do not import
fig, ax = subplots(figsize=(7.75,2.5))
paired_bp_tn_split(matched_rna.ix['ADH1B'], codes, data_type='mRNA',
ax=ax)
fig.tight_layout()
In [8]:
dx_rna.ix[['ADH1A','ADH1B','ADH1C']]
Out[8]:
In [9]:
dx_rna.p.rank().ix[['ADH1A','ADH1B','ADH1C']]
Out[9]:
In [12]:
dx_mir = binomial_test_screen(matched_mir, fc=1.)
dx_mir = dx_mir[dx_mir.num_dx > 300]
In [13]:
dx_mir.sort('p').head()
Out[13]:
In [15]:
#Do not import
fig, ax = subplots(figsize=(6.5,2.5))
paired_bp_tn_split(matched_mir.ix['hsa-mir-21'], codes, data_type='',
ax=ax)
fig.tight_layout()
In [14]:
#Do not import
paired_bp_tn_split(matched_mir.ix['hsa-mir-139'], codes, data_type='')
In [16]:
dx_meth = binomial_test_screen(matched_meth, fc=1.)
dx_meth = dx_meth[dx_meth.num_dx > 300]
In [17]:
dx_meth.sort('p').head()
Out[17]:
In [18]:
#Do not import
paired_bp_tn_split(matched_meth.ix['cg10216717'], codes, data_type='Beta')
In [19]:
def fig_1e(ax):
draw_dist(dx_meth.frac, ax=ax, lw=2.5)
draw_dist(dx_rna.frac, ax=ax, lw=2.5, bins=200)
draw_dist(dx_mir.frac, ax=ax, lw=2.5, bins=100)
ax.set_yticks([])
ax.set_xticks([0,.5,1])
ax.set_ylabel('Density')
ax.set_xlabel('Fraction')
ax.legend(('Methylation','mRNA','miRNA'), frameon=False)
prettify_ax(ax)
return ax
In [20]:
#Do not import
fig, ax = subplots(1,1, figsize=(5,3))
fig_1e(ax);