In [1]:
import NotebookImport
from metaPCNA import *
In [106]:
f = pd.read_table('/cellar/users/agross/Downloads_Old/LM22.txt',
index_col=0)
In [69]:
df = matched_tn
df = df.ix[f.index]
df = df.dropna()
df = 2 ** df
df.columns = ['-'.join(c) for c in df.columns]
In [70]:
df.shape
Out[70]:
In [71]:
df.to_csv('/cellar/users/agross/Desktop/TCGA_for_CIBERSORT.tab', sep='\t')
In [144]:
cs = pd.read_csv('/cellar/users/agross/Data/DiffExp/CIBERSORT/CIBERSORT.Output_matched_tn_subread.csv',
index_col=0)
cs = FH.fix_barcode_columns(cs.T).T
In [145]:
cs.shape
Out[145]:
In [146]:
cs.head(6).T
Out[146]:
In [147]:
v = cs[[c for c in cs.columns if c.startswith('T cells')]].sum(1)
v = v[:, '01'] - v[:, '11']
In [185]:
dd = cs.ix[ti(cs['Pearson Correlation'] > .1)].T
dd = dd.xs('01',1,1) - dd.xs('11',1,1)
dd = dd.ix[:-3]
dd.shape
Out[185]:
In [186]:
r1 = screen_feature(df_s3.ix['GABRD'][:,'11'].ix[dd.columns], pearson_pandas,
cs.T.ix[:-3].xs('11',1,1), align=False)
r2 = screen_feature(df_s3.ix['GABRD'][:,'01'].ix[dd.columns], pearson_pandas,
cs.T.ix[:-3].xs('01',1,1), align=False)
In [187]:
series_scatter(r1.rho, r2.rho)
In [190]:
screen_feature(dx.ix['GABRD'], spearman_pandas, dd, align=False).head()
Out[190]:
In [191]:
series_scatter(dx.ix['GABRD'], dd.ix['Plasma cells'])
In [180]:
b = (cs['T cells regulatory (Tregs)'] > 0).astype(int).unstack().T.diff().ix['11']
In [192]:
violin_plot_series(cs['T cells regulatory (Tregs)'])
In [ ]: