Spaces:
Sleeping
Sleeping
Commit
·
110f578
1
Parent(s):
d0da3b8
Update app.py
Browse files
app.py
CHANGED
@@ -94,6 +94,7 @@ cdict1 = {
|
|
94 |
} # #1E88E5 -> #ff0052
|
95 |
red_blue = LinearSegmentedColormap('RedBlue', cdict1)
|
96 |
|
|
|
97 |
def matplotlib_to_plotly(cmap, pl_entries):
|
98 |
h = 1.0/(pl_entries-1)
|
99 |
pl_colorscale = []
|
@@ -105,6 +106,7 @@ def matplotlib_to_plotly(cmap, pl_entries):
|
|
105 |
return pl_colorscale
|
106 |
|
107 |
red_blue = matplotlib_to_plotly(red_blue, 255)
|
|
|
108 |
|
109 |
if len(gene_list) > 1:
|
110 |
df = df_total[df_total.index.isin(gene_list)]
|
@@ -135,6 +137,7 @@ if len(gene_list) > 1:
|
|
135 |
feature_order = np.argsort(np.sum(np.abs(shap_values), axis=0)[:-1])
|
136 |
feature_order = feature_order[-min(8, len(feature_order)):]
|
137 |
col_order = [df_shap.columns[i] for i in feature_order]
|
|
|
138 |
st.caption("Interactive SHAP Summary Plot of All Input Genes")
|
139 |
mpl_fig = shap_summary_plot(shap_values, df_shap, max_display=8, show=False, feature_names=col_order)
|
140 |
plotly_fig = tls.mpl_to_plotly(mpl_fig)
|
@@ -187,7 +190,7 @@ if len(gene_list) > 1:
|
|
187 |
|
188 |
|
189 |
st.plotly_chart(plotly_fig)
|
190 |
-
|
191 |
else:
|
192 |
pass
|
193 |
|
|
|
94 |
} # #1E88E5 -> #ff0052
|
95 |
red_blue = LinearSegmentedColormap('RedBlue', cdict1)
|
96 |
|
97 |
+
'''
|
98 |
def matplotlib_to_plotly(cmap, pl_entries):
|
99 |
h = 1.0/(pl_entries-1)
|
100 |
pl_colorscale = []
|
|
|
106 |
return pl_colorscale
|
107 |
|
108 |
red_blue = matplotlib_to_plotly(red_blue, 255)
|
109 |
+
'''
|
110 |
|
111 |
if len(gene_list) > 1:
|
112 |
df = df_total[df_total.index.isin(gene_list)]
|
|
|
137 |
feature_order = np.argsort(np.sum(np.abs(shap_values), axis=0)[:-1])
|
138 |
feature_order = feature_order[-min(8, len(feature_order)):]
|
139 |
col_order = [df_shap.columns[i] for i in feature_order]
|
140 |
+
'''
|
141 |
st.caption("Interactive SHAP Summary Plot of All Input Genes")
|
142 |
mpl_fig = shap_summary_plot(shap_values, df_shap, max_display=8, show=False, feature_names=col_order)
|
143 |
plotly_fig = tls.mpl_to_plotly(mpl_fig)
|
|
|
190 |
|
191 |
|
192 |
st.plotly_chart(plotly_fig)
|
193 |
+
'''
|
194 |
else:
|
195 |
pass
|
196 |
|