Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -585,13 +585,20 @@ def main():
|
|
| 585 |
current_selection = st.session_state['ref_selections'].get(selected_ref['name'], [])
|
| 586 |
default_names = [structure_info[i]['full_name'] for i in current_selection] if current_selection else []
|
| 587 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 588 |
selected_names = st.multiselect(
|
| 589 |
"Select residues",
|
| 590 |
options=[info['full_name'] for info in structure_info],
|
| 591 |
-
default=[structure_info[i]['full_name'] for i in range(2, len(structure_info)-2)],
|
| 592 |
key=f"specific_ref_{selected_ref['name']}"
|
| 593 |
)
|
| 594 |
|
|
|
|
| 595 |
name_to_idx = {info['full_name']: info['index'] for info in structure_info}
|
| 596 |
selected_indices = [name_to_idx[name] for name in selected_names]
|
| 597 |
selected_indices.sort()
|
|
@@ -684,10 +691,17 @@ def main():
|
|
| 684 |
current_selection = st.session_state['query_selections'].get(selected_query['name'], [])
|
| 685 |
default_names = [structure_info[i]['full_name'] for i in current_selection] if current_selection else []
|
| 686 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 687 |
selected_names = st.multiselect(
|
| 688 |
"Select residues",
|
| 689 |
options=[info['full_name'] for info in structure_info],
|
| 690 |
-
default=[structure_info[i]['full_name'] for i in range(2, len(structure_info)-2)],
|
| 691 |
key=f"specific_query_{selected_query['name']}"
|
| 692 |
)
|
| 693 |
|
|
|
|
| 585 |
current_selection = st.session_state['ref_selections'].get(selected_ref['name'], [])
|
| 586 |
default_names = [structure_info[i]['full_name'] for i in current_selection] if current_selection else []
|
| 587 |
|
| 588 |
+
#selected_names = st.multiselect(
|
| 589 |
+
# "Select residues",
|
| 590 |
+
# options=[info['full_name'] for info in structure_info],
|
| 591 |
+
# default=[structure_info[i]['full_name'] for i in range(2, len(structure_info)-2)],
|
| 592 |
+
# key=f"specific_ref_{selected_ref['name']}"
|
| 593 |
+
#)
|
| 594 |
selected_names = st.multiselect(
|
| 595 |
"Select residues",
|
| 596 |
options=[info['full_name'] for info in structure_info],
|
| 597 |
+
default=default_names if default_names else [structure_info[i]['full_name'] for i in range(2, len(structure_info)-2)], # ✅ Use saved selection
|
| 598 |
key=f"specific_ref_{selected_ref['name']}"
|
| 599 |
)
|
| 600 |
|
| 601 |
+
|
| 602 |
name_to_idx = {info['full_name']: info['index'] for info in structure_info}
|
| 603 |
selected_indices = [name_to_idx[name] for name in selected_names]
|
| 604 |
selected_indices.sort()
|
|
|
|
| 691 |
current_selection = st.session_state['query_selections'].get(selected_query['name'], [])
|
| 692 |
default_names = [structure_info[i]['full_name'] for i in current_selection] if current_selection else []
|
| 693 |
|
| 694 |
+
#selected_names = st.multiselect(
|
| 695 |
+
# "Select residues",
|
| 696 |
+
# options=[info['full_name'] for info in structure_info],
|
| 697 |
+
# default=[structure_info[i]['full_name'] for i in range(2, len(structure_info)-2)],
|
| 698 |
+
# key=f"specific_query_{selected_query['name']}"
|
| 699 |
+
#)
|
| 700 |
+
|
| 701 |
selected_names = st.multiselect(
|
| 702 |
"Select residues",
|
| 703 |
options=[info['full_name'] for info in structure_info],
|
| 704 |
+
default=default_names if default_names else [structure_info[i]['full_name'] for i in range(2, len(structure_info)-2)], # ✅ Use saved selection
|
| 705 |
key=f"specific_query_{selected_query['name']}"
|
| 706 |
)
|
| 707 |
|