Spaces:
Sleeping
Sleeping
Commit
·
55479e4
1
Parent(s):
96c462b
Upload app.py
Browse files
app.py
CHANGED
@@ -211,6 +211,17 @@ with tab2:
|
|
211 |
multi_genes=multi_genes.dropna().values
|
212 |
multi_genes=np.sort(multi_genes)
|
213 |
#multi_genes=['WNT3', 'VPS13C', 'VAMP4', 'UBTF', 'UBAP2', 'TMEM175', 'TMEM163', 'SYT17', 'STK39', 'SPPL2B', 'SIPA1L2', 'SH3GL2', 'SCARB2', 'SCAF11', 'RPS6KL1', 'RPS12', 'RIT2', 'RIMS1', 'RETREG3', 'PMVK', 'PAM', 'NOD2', 'MIPOL1', 'MEX3C', 'MED12L', 'MCCC1', 'MBNL2', 'MAPT', 'LRRK2', 'KRTCAP2', 'KCNS3', 'KCNIP3', 'ITGA8', 'IP6K2', 'GPNMB', 'GCH1', 'GBA', 'FYN', 'FCGR2A', 'FBRSL1', 'FAM49B', 'FAM171A2', 'ELOVL7', 'DYRK1A', 'DNAH17', 'DLG2', 'CTSB', 'CRLS1', 'CRHR1', 'CLCN3', 'CHRNB1', 'CAMK2D', 'CAB39L', 'BRIP1', 'BIN3', 'ASXL3', 'SNCA']
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
214 |
|
215 |
col1,col2= st.columns([1,1])
|
216 |
#fig_szx=2*len(st.session_state['cell_type'])
|
@@ -227,13 +238,23 @@ with tab2:
|
|
227 |
|
228 |
#sc.pl.umap(st.session_state['adata_annot'], color='new_anno', title='', legend_loc='on data', frameon=False,show=False, ax=axx2)
|
229 |
#sc.pl.umap(st.session_state['adata_annot'], color=selected_gene, title=selected_gene, legend_loc='best', frameon=False,show=False,legend_fontsize='xx-small', ax=axx12)#,vmax='p99')
|
230 |
-
axx12=sc.pl.heatmap(st.session_state['adata_annot'], multi_genes, groupby='new_anno', vmin=-1, vmax=1, cmap='BuPu', dendrogram=True, swap_axes=True,var_group_rotation=
|
231 |
plt.xticks(rotation = 45)
|
232 |
#plt.xticks(rotation = 45)
|
233 |
#st.pyplot(fig12)
|
234 |
#st.pyplot(plt.gcf().set_size_inches(fig_szx, fig_szy))
|
235 |
st.pyplot(plt.gcf())
|
236 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
237 |
|
238 |
#######
|
239 |
|
|
|
211 |
multi_genes=multi_genes.dropna().values
|
212 |
multi_genes=np.sort(multi_genes)
|
213 |
#multi_genes=['WNT3', 'VPS13C', 'VAMP4', 'UBTF', 'UBAP2', 'TMEM175', 'TMEM163', 'SYT17', 'STK39', 'SPPL2B', 'SIPA1L2', 'SH3GL2', 'SCARB2', 'SCAF11', 'RPS6KL1', 'RPS12', 'RIT2', 'RIMS1', 'RETREG3', 'PMVK', 'PAM', 'NOD2', 'MIPOL1', 'MEX3C', 'MED12L', 'MCCC1', 'MBNL2', 'MAPT', 'LRRK2', 'KRTCAP2', 'KCNS3', 'KCNIP3', 'ITGA8', 'IP6K2', 'GPNMB', 'GCH1', 'GBA', 'FYN', 'FCGR2A', 'FBRSL1', 'FAM49B', 'FAM171A2', 'ELOVL7', 'DYRK1A', 'DNAH17', 'DLG2', 'CTSB', 'CRLS1', 'CRHR1', 'CLCN3', 'CHRNB1', 'CAMK2D', 'CAB39L', 'BRIP1', 'BIN3', 'ASXL3', 'SNCA']
|
214 |
+
######### THIS IS FOR CLUSTERMAP
|
215 |
+
# figxx = plt.subplots(figsize=(5, 5))
|
216 |
+
# hmpdat=st.session_state['adata_annot'][:, multi_genes] #.to_df()
|
217 |
+
# #st.write(hmpdat)
|
218 |
+
# samples=hmpdat.obs.new_anno
|
219 |
+
# dfh = pd.DataFrame(hmpdat.X.toarray(), columns = multi_genes)
|
220 |
+
# dfh=dfh.T
|
221 |
+
# dfh.columns=samples.values.to_list()
|
222 |
+
# sns.clustermap(dfh)
|
223 |
+
# st.pyplot(plt.gcf())
|
224 |
+
######
|
225 |
|
226 |
col1,col2= st.columns([1,1])
|
227 |
#fig_szx=2*len(st.session_state['cell_type'])
|
|
|
238 |
|
239 |
#sc.pl.umap(st.session_state['adata_annot'], color='new_anno', title='', legend_loc='on data', frameon=False,show=False, ax=axx2)
|
240 |
#sc.pl.umap(st.session_state['adata_annot'], color=selected_gene, title=selected_gene, legend_loc='best', frameon=False,show=False,legend_fontsize='xx-small', ax=axx12)#,vmax='p99')
|
241 |
+
axx12=sc.pl.heatmap(st.session_state['adata_annot'], multi_genes, groupby='new_anno', vmin=-1, vmax=1, cmap='BuPu', dendrogram=True, swap_axes=True, show_gene_labels=True,var_group_rotation=45)#,ax=ax2)
|
242 |
plt.xticks(rotation = 45)
|
243 |
#plt.xticks(rotation = 45)
|
244 |
#st.pyplot(fig12)
|
245 |
#st.pyplot(plt.gcf().set_size_inches(fig_szx, fig_szy))
|
246 |
st.pyplot(plt.gcf())
|
247 |
|
248 |
+
fign, axxn = plt.subplots(figsize=(5, 5))
|
249 |
+
|
250 |
+
#sc.pl.umap(st.session_state['adata_annot'], color='new_anno', title='', legend_loc='on data', frameon=False,show=False, ax=axx2)
|
251 |
+
#sc.pl.umap(st.session_state['adata_annot'], color=selected_gene, title=selected_gene, legend_loc='best', frameon=False,show=False,legend_fontsize='xx-small', ax=axx12)#,vmax='p99')
|
252 |
+
axxn=sc.pl.heatmap(st.session_state['adata_annot'], multi_genes, groupby='new_anno', vmin=-1, vmax=1, cmap='BuPu', dendrogram=True,swap_axes=True, show_gene_labels=True,var_group_rotation="45")#,ax=ax2)
|
253 |
+
plt.xticks(rotation = 45)
|
254 |
+
#plt.xticks(rotation = 45)
|
255 |
+
#st.pyplot(fig12)
|
256 |
+
#st.pyplot(plt.gcf().set_size_inches(fig_szx, fig_szy))
|
257 |
+
st.pyplot(plt.gcf())
|
258 |
|
259 |
#######
|
260 |
|