jinysun commited on
Commit
63c27d2
·
1 Parent(s): 50dae26

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
- # Page setup
11
- st.set_page_config(page_title="DeepAcceptor", page_icon="🔋", layout="wide")
12
- st.title("🔋DeepAcceptor")
13
-
14
- # Connect to the Google Sheet
15
- url1 = r"https://docs.google.com/spreadsheets/d/1YOEIg0nMTSPkAOr8wkqxQRLuUhys3-J0I-KPEpmzPLw/gviz/tq?tqx=out:csv&sheet=accept"
16
- url = r"https://docs.google.com/spreadsheets/d/1YOEIg0nMTSPkAOr8wkqxQRLuUhys3-J0I-KPEpmzPLw/gviz/tq?tqx=out:csv&sheet=111"
17
- df1 = pd.read_csv(url1, dtype=str, encoding='utf-8')
18
- col1, col2 = st.columns(2)
19
- with col1:
20
-
21
- text_search = st.text_input("🔍**Search papers or molecules**", value="")
22
- m1 = df1["name"].str.contains(text_search)
23
- m2 = df1["reference"].str.contains(text_search)
24
- df_search = df1[m1 | m2]
25
- with col2:
26
-
27
- st.link_button("📝**DATABASE**", r"https://docs.google.com/spreadsheets/d/1YOEIg0nMTSPkAOr8wkqxQRLuUhys3-J0I-KPEpmzPLw")
28
- st.caption('👆If you want to update the database, click the button.')
29
- if text_search:
30
- st.write(df_search)
31
- st.download_button( "⬇️ Download edited files as .csv", df_search.to_csv(), "df_search.csv", use_container_width=True)
32
- edited_df = st.data_editor(df1, num_rows="dynamic")
33
- edited_df.to_csv(url)
34
- st.download_button(
35
- "⬇️ Download edited files as .csv", edited_df.to_csv(), "edited_df.csv", use_container_width=True
36
- )
37
-
38
- molecule = st.text_input("📋**Molecule**")
39
- smile_code = st_ketcher(molecule)
40
- st.subheader(f"✨**Smiles code**: {smile_code}")
41
- try :
42
- P = RF.main( str(smile_code ) )
43
- st.header(f":blue[⚡**PCE predicted by RF**]: {P}")
44
- except:
45
- st.header(f":blue[⚡**PCE predicted by RF**]: :red[Running]")
46
- try:
47
- pce = abcBERT.main( str(smile_code ) )
48
- st.header(f":blue[⚡**PCE predicted by abcBERT**]: {pce}")
49
- except:
50
- st.header(f":blue[⚡**PCE predicted by abcBERT**]: :red[Running]")
51
-