basilboy commited on
Commit
253caff
·
verified ·
1 Parent(s): cdc1ea7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -7
app.py CHANGED
@@ -4,9 +4,9 @@ from model import models
4
  import pandas as pd
5
 
6
  def main():
7
- st.set_page_config(layout="wide") # Set page to wide layout
8
  st.title("AA Property Inference Demo", anchor=None)
9
-
10
  # Apply monospace font to the entire app
11
  st.markdown("""
12
  <style>
@@ -19,9 +19,12 @@ def main():
19
  </style>
20
  """, unsafe_allow_html=True)
21
 
22
- # User input: Text and CSV
23
- sequence = st.text_input("Enter your amino acid sequence:")
24
- uploaded_file = st.file_uploader("Or upload a CSV file with amino acid sequences", type="csv")
 
 
 
25
 
26
  if st.button("Analyze Sequence"):
27
  sequences = [sequence] if sequence else []
@@ -44,8 +47,8 @@ def main():
44
  if results:
45
  st.write("### Results")
46
  results_df = pd.DataFrame(results)
47
- # Use full width for DataFrame display
48
- st.dataframe(results_df.style.format(precision=3), width=None, height=None) # Set width and height to None to use full available space
49
 
50
  if __name__ == "__main__":
51
  main()
 
4
  import pandas as pd
5
 
6
  def main():
7
+ st.set_page_config(layout="wide") # Keep the wide layout for overall flexibility
8
  st.title("AA Property Inference Demo", anchor=None)
9
+
10
  # Apply monospace font to the entire app
11
  st.markdown("""
12
  <style>
 
19
  </style>
20
  """, unsafe_allow_html=True)
21
 
22
+ # Create columns for input controls
23
+ col1, col2 = st.columns([1, 3]) # Adjust column width ratios as needed
24
+
25
+ with col1:
26
+ sequence = st.text_input("Enter your amino acid sequence:")
27
+ uploaded_file = st.file_uploader("Or upload a CSV file with amino acid sequences", type="csv")
28
 
29
  if st.button("Analyze Sequence"):
30
  sequences = [sequence] if sequence else []
 
47
  if results:
48
  st.write("### Results")
49
  results_df = pd.DataFrame(results)
50
+ # Use full width for DataFrame display only
51
+ st.dataframe(results_df.style.format(precision=3), width=None, height=None)
52
 
53
  if __name__ == "__main__":
54
  main()