BiBERTa / app.py
jinysun's picture
Upload 5 files
c5f2040
raw
history blame
1.45 kB
import streamlit as st
import pandas as pd
import rdkit
import streamlit_ketcher
from streamlit_ketcher import st_ketcher
import run
# Page setup
st.set_page_config(page_title="DeepDAP", page_icon="🔋", layout="wide")
st.title("🔋DeepDAP")
# Connect to the Google Sheet
url1= r"https://docs.google.com/spreadsheets/d/1AKkZS04VF3osFT36aNHIb4iUbV8D1uNfsldcpHXogj0/gviz/tq?tqx=out:csv&sheet=dap"
df1 = pd.read_csv(url1, dtype=str, encoding='utf-8')
text_search = st.text_input("🔍Search papers or molecules", value="")
m1 = df1["Donor_Name"].str.contains(text_search)
m2 = df1["reference"].str.contains(text_search)
m3 = df1["Acceptor_Name"].str.contains(text_search)
df_search = df1[m1 | m2|m3]
if text_search:
st.write(df_search)
st.download_button( "⬇️Download edited files as .csv", df_search.to_csv(), "df_search.csv", use_container_width=True)
edited_df = st.data_editor(df1, num_rows="dynamic")
st.download_button(
"⬇️ Download edited files as .csv", edited_df.to_csv(), "edited_df.csv", use_container_width=True
)
molecule = st.text_input("👨‍🔬Molecule")
smile_code = st_ketcher(molecule)
st.markdown("🏆New SMILES of edited molecules: {smile_code }")
acceptor= st.text_input("🎈SMILES of acceptor")
donor = st.text_input("🎈SMILES of donor")
try:
pce = run.smiles_aas_test( str(acceptor ), str(donor) )
st.markdown("⚡PCE: ``{pce}``")
except:
st.markdown("⚡PCE: None ")