Spaces:
Sleeping
Sleeping
Rename app.py to Attention_Visualization.py
Browse files
README.md
CHANGED
@@ -5,7 +5,7 @@ colorFrom: green
|
|
5 |
colorTo: purple
|
6 |
sdk: streamlit
|
7 |
sdk_version: 1.17.0
|
8 |
-
app_file: ./hexviz/
|
9 |
pinned: false
|
10 |
---
|
11 |
# hexviz
|
|
|
5 |
colorTo: purple
|
6 |
sdk: streamlit
|
7 |
sdk_version: 1.17.0
|
8 |
+
app_file: ./hexviz/Attention_Visualization.py
|
9 |
pinned: false
|
10 |
---
|
11 |
# hexviz
|
hexviz/{app.py → Attention_Visualization.py}
RENAMED
@@ -26,7 +26,7 @@ st.sidebar.markdown(
|
|
26 |
""")
|
27 |
pdb_id = st.sidebar.text_input(
|
28 |
label="PDB ID",
|
29 |
-
value="
|
30 |
)
|
31 |
structure = get_structure(pdb_id)
|
32 |
chains = get_chains(structure)
|
@@ -123,13 +123,11 @@ for att_weight, _ , _ , chain, first, second in top_n:
|
|
123 |
res2 = chain_dict[chain][second]
|
124 |
el = (att_weight, f"{res1.resname:3}{res1.id[1]:0>3} - {res2.resname:3}{res2.id[1]:0>3} ({chain})")
|
125 |
data.append(el)
|
126 |
-
# st.write(f"Attention weight: {att_weight:.2f} | Residue pair: {structure.get_chain_id(chain)[first].get_resname()}-{structure.get_chain(chain)[first].full_id[3]}{chain.id}<-->{chain[second].get_resname()}")
|
127 |
|
128 |
df = pd.DataFrame(data, columns=['Avg attention', 'Residue pair'])
|
129 |
f"Top {n_pairs} attention pairs:"
|
130 |
st.table(df)
|
131 |
|
132 |
-
|
133 |
"""
|
134 |
More models will be added soon. The attention visualization is inspired by [provis](https://github.com/salesforce/provis#provis-attention-visualizer).
|
135 |
"""
|
|
|
26 |
""")
|
27 |
pdb_id = st.sidebar.text_input(
|
28 |
label="PDB ID",
|
29 |
+
value="1AKE",
|
30 |
)
|
31 |
structure = get_structure(pdb_id)
|
32 |
chains = get_chains(structure)
|
|
|
123 |
res2 = chain_dict[chain][second]
|
124 |
el = (att_weight, f"{res1.resname:3}{res1.id[1]:0>3} - {res2.resname:3}{res2.id[1]:0>3} ({chain})")
|
125 |
data.append(el)
|
|
|
126 |
|
127 |
df = pd.DataFrame(data, columns=['Avg attention', 'Residue pair'])
|
128 |
f"Top {n_pairs} attention pairs:"
|
129 |
st.table(df)
|
130 |
|
|
|
131 |
"""
|
132 |
More models will be added soon. The attention visualization is inspired by [provis](https://github.com/salesforce/provis#provis-attention-visualizer).
|
133 |
"""
|