jinysun commited on
Commit
ee612e5
·
1 Parent(s): 1173e9a

Delete app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -51
app.py DELETED
@@ -1,51 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- import streamlit as st
3
- import pandas as pd
4
- import rdkit
5
- import streamlit_ketcher
6
- from streamlit_ketcher import st_ketcher
7
- import abcBERT
8
- import RF
9
-
10
-
11
- # Page setup
12
- st.set_page_config(page_title="DeepAcceptor", page_icon="🔋", layout="wide")
13
- st.title("🔋DeepAcceptor")
14
-
15
- # Connect to the Google Sheet
16
- url1 = r"https://docs.google.com/spreadsheets/d/1YOEIg0nMTSPkAOr8wkqxQRLuUhys3-J0I-KPEpmzPLw/gviz/tq?tqx=out:csv&sheet=acceptor"
17
- url = r"https://docs.google.com/spreadsheets/d/1YOEIg0nMTSPkAOr8wkqxQRLuUhys3-J0I-KPEpmzPLw/gviz/tq?tqx=out:csv&sheet=111"
18
- df1 = pd.read_csv(url1, dtype=str, encoding='utf-8')
19
- col1, col2 = st.columns(2)
20
- with col1:
21
- st.subheader("🔍**Search papers or molecules**")
22
- text_search = st.text_input(label="_", value="",label_visibility="hidden" )
23
- m1 = df1["name"].str.contains(text_search)
24
- m2 = df1["reference"].str.contains(text_search)
25
- df_search = df1[m1 | m2]
26
- with col2:
27
-
28
- st.link_button("📝**DATABASE**", r"https://docs.google.com/spreadsheets/d/1YOEIg0nMTSPkAOr8wkqxQRLuUhys3-J0I-KPEpmzPLw")
29
- st.markdown('👆If you want to update the origin database, click the button.')
30
- if text_search:
31
- st.write(df_search)
32
- st.download_button( "⬇️ Download edited files as .csv", df_search.to_csv(), "df_search.csv", use_container_width=True)
33
- edited_df = st.data_editor(df1, num_rows="dynamic")
34
- edited_df.to_csv(url)
35
- st.download_button(
36
- "⬇️ Download edited files as .csv", edited_df.to_csv(), "edited_df.csv", use_container_width=True
37
- )
38
- st.header("📋**Input the SMILES of Molecule**")
39
- molecule = st.text_input(label="*",label_visibility="hidden")
40
- smile_code = st_ketcher(molecule)
41
- st.subheader(f"✨**The SMILES of edited molecules**: {smile_code}")
42
- try :
43
- P = RF.main( str(smile_code ) )
44
- st.subheader(f"⚡**PCE predicted by RF**: {P}")
45
- except:
46
- st.subheader(f"⚡**PCE predicted by RF**: [Running]")
47
- try:
48
- pce = abcBERT.main( str(smile_code ) )
49
- st.subheader(f"⚡**PCE predicted by abcBERT**: {pce}")
50
- except:
51
- st.subheader(f"⚡**PCE predicted by abcBERT**: [Running]")