Spaces:
Sleeping
Sleeping
Commit
·
7c6b695
1
Parent(s):
4737824
Update app.py
Browse files
app.py
CHANGED
@@ -54,10 +54,6 @@ st.markdown("""
|
|
54 |
A machine learning pipeline for predicting disease-causing genes post-genome-wide association study in blood pressure.
|
55 |
""")
|
56 |
|
57 |
-
#gene_input = st.text_input('Input Single HGNC Gene:')
|
58 |
-
#df = df_total[df_total.index == gene_input]
|
59 |
-
#st.dataframe(df)
|
60 |
-
|
61 |
|
62 |
collect_genes = lambda x : [str(i) for i in re.split(",|, ", x) if i != ""]
|
63 |
|
@@ -68,6 +64,7 @@ explainer = shap.TreeExplainer(xgb)
|
|
68 |
if len(gene_list) > 1:
|
69 |
df = df_total[df_total.index.isin(gene_list)]
|
70 |
st.dataframe(df)
|
|
|
71 |
shap_values = explainer.shap_values(df)
|
72 |
summary_plot = shap.summary_plot(shap_values, df)
|
73 |
st.caption("SHAP Summary Plot of All Input Genes")
|
@@ -80,6 +77,7 @@ else:
|
|
80 |
input_gene = st.text_input("Input individual HGNC gene:")
|
81 |
df2 = df_total[df_total.index == input_gene]
|
82 |
st.dataframe(df2)
|
|
|
83 |
if len(input_gene) == 1:
|
84 |
shap_values = explainer.shap_values(df2)
|
85 |
shap.initjs()
|
|
|
54 |
A machine learning pipeline for predicting disease-causing genes post-genome-wide association study in blood pressure.
|
55 |
""")
|
56 |
|
|
|
|
|
|
|
|
|
57 |
|
58 |
collect_genes = lambda x : [str(i) for i in re.split(",|, ", x) if i != ""]
|
59 |
|
|
|
64 |
if len(gene_list) > 1:
|
65 |
df = df_total[df_total.index.isin(gene_list)]
|
66 |
st.dataframe(df)
|
67 |
+
df.drop(columns='XGB_Score', inplace=True)
|
68 |
shap_values = explainer.shap_values(df)
|
69 |
summary_plot = shap.summary_plot(shap_values, df)
|
70 |
st.caption("SHAP Summary Plot of All Input Genes")
|
|
|
77 |
input_gene = st.text_input("Input individual HGNC gene:")
|
78 |
df2 = df_total[df_total.index == input_gene]
|
79 |
st.dataframe(df2)
|
80 |
+
df2.drop(columns='XGB_Score', inplace=True)
|
81 |
if len(input_gene) == 1:
|
82 |
shap_values = explainer.shap_values(df2)
|
83 |
shap.initjs()
|