File size: 3,187 Bytes
c2a02c6
 
 
 
 
 
 
 
 
 
 
8a2e1bf
c2a02c6
c8b993f
ec06c4b
 
c8b993f
 
0d7f3a7
 
 
b68774d
9abc2e6
c2a02c6
8a2e1bf
 
 
c2a02c6
8a2e1bf
c2a02c6
 
 
 
 
ee0298f
80cfda5
e3df29c
80cfda5
43efedb
dd50af6
80cfda5
b27ef4c
9e2f96b
c8b993f
 
 
 
806931d
c8b993f
fa82089
e3df29c
8f90700
80cfda5
8f90700
 
 
 
 
 
 
 
 
efb78a7
8f90700
 
 
fa82089
9cffd28
da9bcac
d6a723e
da9bcac
 
e52de1a
d6a723e
e52de1a
 
 
e3df29c
05e0ac4
e52de1a
 
e3df29c
da9bcac
4ed9060
 
a0f4539
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import streamlit as st
import pandas as pd 
from os import path
import sys
import streamlit.components.v1 as components
sys.path.append('code/')
#sys.path.append('ASCARIS/code/') 
import pdb_featureVector
import alphafold_featureVector
import argparse
from st_aggrid import AgGrid, GridOptionsBuilder, JsCode,GridUpdateMode
import base64
showWarningOnDirectExecution = False

def convert_df(df):
   return df.to_csv(index=False).encode('utf-8')

    
# Check if 'key' already exists in session_state
# If not, then initialize it
if 'visibility' not in st.session_state:
    st.session_state['visibility'] = 'visible'
    st.session_state.disabled =  False

original_title = '<p style="font-family:Trebuchet MS; color:#FD7456; font-size: 25px; font-weight:bold; text-align:center">ASCARIS</p>'
st.markdown(original_title, unsafe_allow_html=True)
original_title = '<p style="font-family:Trebuchet MS; color:#FD7456; font-size: 25px; font-weight:bold; text-align:center">(Annotation and StruCture-bAsed RepresentatIon of Single amino acid variations)</p>'
st.markdown(original_title, unsafe_allow_html=True)
 
st.write('')
st.write('')
st.write('')
st.write('')

with st.form('mform', clear_on_submit=False):
    st.write(' I am here currently.')
    #source = st.selectbox('Select the protein structure resource (1: PDB-SwissModel-Modbase, 2: AlphaFold)',[1,2])
    mode = 1
    impute = st.selectbox('Imputation',[True, False])
    
    input_set = st.text_input('Enter SAV data points (Example: Q9Y4W6-N-432-T)')
    
    submitted = st.form_submit_button(label="Submit", help=None, on_click=None, args=None, kwargs=None, type="secondary", disabled=False, use_container_width=False)
    print('*****************************************')
    print('Feature vector generation is in progress. \nPlease check log file for updates..')
    print('*****************************************')
    mode = int(mode)
    
    
selected_df = pd.DataFrame()
st.write('The online tool may be slow, especially while processing multiple SAVs, please consider using the local programmatic version at https://github.com/HUBioDataLab/ASCARIS/')
if submitted:
    st.write('submitted.')
    with st.spinner('In progress...This may take a while...'):
        try:
            if mode == 1:
                selected_df = pdb_featureVector.pdb(input_set, mode, impute)    
                
            elif mode == 2:
                selected_df = alphafold_featureVector.alphafold(input_set, mode, impute)
            else:
                selected_df =  pd.DataFrame()

        except:
            selected_df = pd.DataFrame()
            pass

    if selected_df is None:
        st.success('Feature vector failed. Check log file.')
        st.write('Failed here1')

    else:
        if len(selected_df) != 0 :
            st.write(selected_df)
            st.success('Feature vector successfully created.')
            csv = convert_df(selected_df)
    
            st.download_button("Press to Download the Feature Vector", csv,f"ASCARIS_SAV_rep_{input_set}.csv","text/csv",key='download-csv')

        else:
            st.success('Feature vector failed. Check log file.')