<jupyter_start><jupyter_text>Figure 2 Pull in data from differential expression screen<jupyter_code>cd ..
import NotebookImport
from DX_screen import *<jupyter_output><empty_output><jupyter_text>Read in microarray validation data.<jupyter_code>gs2 = gene_sets.ix[dx_rna.index].fillna(0)
from metaPCNA import *
sns.set_context('paper',font_scale=1.75)
fig, axs = subplots(1,3, figsize=(17,4))
plt.rcParams['font.size'] = 16
ax = axs[0]
v = pd.concat([dx_rna.frac, 
               dx_rna.frac.ix[ti(gs2['REACTOME_CELL_CYCLE']>0)],
               dx_rna.frac.ix[ti(gs2['REACTOME_M_G1_TRANSITION']>0)],
               dx_rna.frac.ix[ti(gs2['REACTOME_DEPOSITION_OF_NEW_CENPA_CONTAINING_NUCLEOSOMES_AT_THE_CENTROMERE']>0)]
               ]).dropna()
v1 = pd.concat([pd.Series('All Genes', dx_rna.frac.index), 
                pd.Series('Cell Cycle', ti(gs2['REACTOME_CELL_CYCLE']>0)),
                pd.Series('M/G1\nTransition', ti(gs2['REACTOME_M_G1_TRANSITION']>0)),
                pd.Series('CEPNA\nDeposition', ti(gs2['REACTOME_DEPOSITION_OF_NEW_CENPA_CONTAINING_NUCLEOSOMES_AT_THE_CENTROMERE']>0))
                ])
v1.name = ''
v.name = 'Fraction Overexpressed'
o = ['All Genes','Cell Cycle','CEPNA\nDeposition',
     'M/G1\nTransition']
violin_plot_pandas(v1, v, order=o, ann=None, ax=ax)
prettify_ax(ax)
ax.spines['bottom'].set_visible(False)
ax.axhline(.5, color='grey', lw=2, ls='--');
fig_1g(axs[1])

ax = axs[2]
plot_regression(dx_rna.frac - .5, pcna_corr, density=True, rad=.03, s=20,
                rasterized=True, ax=ax, line_args={'lw': 0})
ax.set_xticks([-.5, 0, .5])
ax.set_xticklabels([0.0, 0.5, 1.0])
ax.set_yticks([-.5, 0, .5, 1.])
ann = ax.get_children()[4]
ann.set_text(ann.get_text().split()[0])
ax.set_xlim(-.5, .5)
ax.set_xlabel('Fraction Overexpressed')
ax.set_ylabel('Proliferation Score')
letters = list(map(chr, range(97, 123)))[:6] 

for i,ax in enumerate(axs):
    ax.text(-0.15, 1.15, letters[i], transform=ax.transAxes,
            fontsize=26, fontweight='bold', va='top', ha='right')

fig.tight_layout()
fig.savefig(FIGDIR + 'dx_fig1.pdf', transparent=True)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17757889778615168, 'fraction_numerical': 0.03579839849269901, 'mean_word_length': 4.574803149606299, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '70602', 'license': 'MIT', 'n_tokens_mistral': 939, 'n_tokens_neox': 884, 'n_words': 121, 'path': 'Notebooks/Figures/Figure_2_refactor.ipynb', 'repo_name': 'theandygross/TCGA_differential_expression', 'size': '2123'}