<jupyter_start><jupyter_text>This notebook will take two genes and plot their RNA/protein correlations from each other.<jupyter_code>import pandas as pd
import seaborn as sns
from predict_protein import download_cptac, select_features, train_model, utils

get_dataframe = utils.get_dataframe
single = get_dataframe('/Volumes/Ginkgo_Data/Data/2021-11_CPTACTrainedModels/out3/tumor8_elastic_single.p')
corum = get_dataframe('/Volumes/Ginkgo_Data/Data/2021-11_CPTACTrainedModels/out3/tumor8_elastic_corum.p')

print(single)
print(corum)

single = single.rename(columns={'corr_test': 'single_corr'})
corum = corum.rename(columns={'corr_test': 'corum_corr'})
combined = single[['single_corr', 'num_obs', 'num_features']].merge(corum[['corum_corr']], left_index=True, right_index=True)
combined['diff'] = combined.corum_corr - combined.single_corr
proteins_of_interest = list(combined[(combined['diff'] > 0.2) & (combined['num_obs'] >= 1)].index)
len(proteins_of_interest)
print(proteins_of_interest)
cptac_list = download_cptac.download_cptac(n_tumors=8)
tumor_df = pd.concat(cptac_list)
tm = train_model.LearnCPTAC(tumor_df)

# Good combinations
# g1 = 'CMC1'
# g2 = 'MT-CO1'
# g1 = 'PCCB'
# g2 = 'PCCA'
# g1 = 'PSMG2'
# g2 = 'PSMG1'
g1 = 'SMCR8'
g2 = 'C9orf72'

plot_df = tm.df[[ g1 + '_proteomics', g1 + '_transcriptomics', g2+ '_proteomics', g2 + '_transcriptomics']]

plot_df
g1_p = plot_df[g1 + '_proteomics']
g1_t = plot_df[g1 + '_transcriptomics']
g2_p = plot_df[g2 + '_proteomics']
g2_t = plot_df[g2 + '_transcriptomics']

print('P1 to T1', g1_p.corr(g1_t))
print('P2 to T2', g2_p.corr(g2_t))

print('P1 to P2', g1_p.corr(g2_p))
print('T1 to T2', g1_t.corr(g2_t))

print('P1 to T2', g1_p.corr(g2_t))
print('P2 to T1', g2_p.corr(g1_t))
plot_df.corr()
sns.relplot(data = plot_df,
            x= g1 + '_transcriptomics',
            y = g1 + '_proteomics')

sns.relplot(data = plot_df,
            x= g2 + '_transcriptomics',
            y = g2 + '_proteomics')

sns.relplot(data = plot_df,
            x= g1 + '_proteomics',
            y = g2 + '_proteomics')

sns.relplot(data = plot_df,
            x= g1 + '_transcriptomics',
            y = g2 + '_transcriptomics')

sns.relplot(data = plot_df,
            x= g1 + '_transcriptomics',
            y = g2 + '_proteomics')

sns.relplot(data = plot_df,
            x= g1 + '_proteomics',
            y = g2 + '_transcriptomics')
plot_df.to_csv(f'06_PlotRNAProteinCorrelations_Output/{g1}_{g2}_out3.csv', index=False)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.148, 'fraction_numerical': 0.0356, 'mean_word_length': 4.533185840707965, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '230288', 'license': 'MIT', 'n_tokens_mistral': 1081, 'n_tokens_neox': 1004, 'n_words': 180, 'path': 'notebook/06_PlotRNAProteinCorrelations.ipynb', 'repo_name': 'Lau-Lab/CPTAC_Protein', 'size': '2500'}