wenjun99 commited on
Commit
c6fed48
·
verified ·
1 Parent(s): edcca9a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -4
app.py CHANGED
@@ -6,8 +6,6 @@ from streamlit_cropper import st_cropper
6
 
7
  # Simple app: convert user input into ASCII codes and binary labels
8
 
9
- # (functions string_to_binary_labels, clean_image, image_to_binary_labels_rgb, binary_labels_to_rgb_image stay unchanged)
10
-
11
  def string_to_binary_labels(s: str) -> list[int]:
12
  bits: list[int] = []
13
  for char in s:
@@ -61,6 +59,14 @@ def binary_labels_to_rgb_image(binary_labels: list[int], width: int = None, heig
61
  img = Image.fromarray(array, mode='RGB')
62
  return img
63
 
 
 
 
 
 
 
 
 
64
  # Load thresholds from file
65
  thresholds = pd.read_csv("Column_Thresholds.csv", index_col=0).squeeze()
66
 
@@ -178,7 +184,6 @@ with tab3:
178
 
179
  st.subheader("Binary Labels")
180
  st.dataframe(styled_binary_df)
181
-
182
  st.download_button(
183
  label="Download Binary Labels Table as CSV",
184
  data=binary_df.to_csv(index=False),
@@ -186,4 +191,4 @@ with tab3:
186
  mime="text/csv"
187
  )
188
 
189
- # Future: integrate DNA editor mapping for each mutation site here
 
6
 
7
  # Simple app: convert user input into ASCII codes and binary labels
8
 
 
 
9
  def string_to_binary_labels(s: str) -> list[int]:
10
  bits: list[int] = []
11
  for char in s:
 
59
  img = Image.fromarray(array, mode='RGB')
60
  return img
61
 
62
+ # Predefined headers for the 32 mutation sites
63
+ mutation_site_headers = [
64
+ 3244, 3297, 3350, 3399, 3455, 3509, 3562, 3614,
65
+ 3665, 3720, 3773, 3824, 3879, 3933, 3985, 4039,
66
+ 4089, 4145, 4190, 4245, 4298, 4349, 4402, 4455,
67
+ 4510, 4561, 4615, 4668, 4720, 4773, 4828, 4882
68
+ ]
69
+
70
  # Load thresholds from file
71
  thresholds = pd.read_csv("Column_Thresholds.csv", index_col=0).squeeze()
72
 
 
184
 
185
  st.subheader("Binary Labels")
186
  st.dataframe(styled_binary_df)
 
187
  st.download_button(
188
  label="Download Binary Labels Table as CSV",
189
  data=binary_df.to_csv(index=False),
 
191
  mime="text/csv"
192
  )
193
 
194
+ # Future: integrate DNA editor mapping for each mutation site here