wenjun99 commited on
Commit
bce28b1
Β·
verified Β·
1 Parent(s): d34499f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -12
app.py CHANGED
@@ -97,13 +97,13 @@ with tab1:
97
 
98
  df = pd.DataFrame(groups, columns=[str(h) for h in mutation_site_headers] + ["Edited Sites"])
99
  st.dataframe(df)
100
- st.download_button("Download as CSV", df.to_csv(index=False), "text_31_binary_labels.csv")
101
 
102
  ascending_headers = sorted(mutation_site_headers_actual)
103
  df_sorted = df[[str(h) for h in ascending_headers if str(h) in df.columns]]
104
  st.subheader("Binary Labels (Ascending Order 3244 β†’ 4882)")
105
  st.dataframe(df_sorted)
106
- st.download_button("Download Ascending Order CSV", df_sorted.to_csv(index=False), "text_binary_labels_ascending.csv")
107
 
108
  # === Robot Preparation Script Generation ===
109
  st.subheader("Robot Preparation Script")
@@ -133,7 +133,7 @@ with tab1:
133
 
134
  robot_script_df = pd.DataFrame(robot_script)
135
  st.dataframe(robot_script_df)
136
- st.download_button("Download Robot Script CSV", robot_script_df.to_csv(index=False), "robot_script.csv")
137
 
138
 
139
  # Tab 2: EF β†’ Binary
@@ -167,7 +167,7 @@ with tab2:
167
  st.subheader("Binary Labels (Reordered 4402β†’3244, 4882β†’4455)")
168
  styled = binary_reordered.style.applymap(color_binary)
169
  st.dataframe(styled)
170
- st.download_button("Download CSV", binary_reordered.to_csv(index=False), "ef_binary_labels.csv")
171
 
172
  all_bits = binary_reordered.values.flatten().tolist()
173
  decoded_string = binary_labels_to_string(all_bits)
@@ -176,7 +176,7 @@ with tab2:
176
 
177
  st.subheader("Binary Labels (Ascending 3244β†’4882)")
178
  st.dataframe(binary_part.style.applymap(color_binary))
179
- st.download_button("Download Ascending Order CSV", binary_part.to_csv(index=False), "ef_binary_labels_ascending.csv")
180
 
181
  all_bits = binary_part.values.flatten().tolist()
182
  decoded_string = binary_labels_to_string(all_bits)
@@ -254,13 +254,13 @@ with tab3:
254
 
255
  df = pd.DataFrame(groups, columns=[str(h) for h in mutation_site_headers_3614] + ["Edited Sites"])
256
  st.dataframe(df)
257
- st.download_button("Download as CSV", df.to_csv(index=False), "text_32_binary_labels.csv")
258
 
259
  ascending_headers = sorted(mutation_site_headers_actual_3614)
260
  df_sorted = df[[str(h) for h in ascending_headers if str(h) in df.columns]]
261
  st.subheader("Binary Labels (Ascending Order 3244 β†’ 4882)")
262
  st.dataframe(df_sorted)
263
- st.download_button("Download Ascending Order CSV", df_sorted.to_csv(index=False), "text_binary_labels_ascending.csv")
264
 
265
  # === Robot Preparation Script Generation ===
266
  st.subheader("Robot Preparation Script")
@@ -290,11 +290,11 @@ with tab3:
290
 
291
  robot_script_df = pd.DataFrame(robot_script)
292
  st.dataframe(robot_script_df)
293
- st.download_button("Download Robot Script CSV", robot_script_df.to_csv(index=False), "robot_script.csv")
294
 
295
 
296
- # Tab 2: EF β†’ Binary
297
- with tab2:
298
  st.write("Upload an Editing Frequency CSV or enter manually:")
299
  st.write("**Note:** Please upload CSV files **without column headers**, in ascending order from 3244 to 4882.")
300
  ef_file = st.file_uploader("Upload EF CSV", type=["csv"], key="ef")
@@ -324,7 +324,7 @@ with tab2:
324
  st.subheader("Binary Labels (Reordered 4402β†’3244, 4882β†’4455)")
325
  styled = binary_reordered.style.applymap(color_binary)
326
  st.dataframe(styled)
327
- st.download_button("Download CSV", binary_reordered.to_csv(index=False), "ef_binary_labels.csv")
328
 
329
  all_bits = binary_reordered.values.flatten().tolist()
330
  decoded_string = binary_labels_to_string(all_bits)
@@ -333,7 +333,7 @@ with tab2:
333
 
334
  st.subheader("Binary Labels (Ascending 3244β†’4882)")
335
  st.dataframe(binary_part.style.applymap(color_binary))
336
- st.download_button("Download Ascending Order CSV", binary_part.to_csv(index=False), "ef_binary_labels_ascending.csv")
337
 
338
  all_bits = binary_part.values.flatten().tolist()
339
  decoded_string = binary_labels_to_string(all_bits)
 
97
 
98
  df = pd.DataFrame(groups, columns=[str(h) for h in mutation_site_headers] + ["Edited Sites"])
99
  st.dataframe(df)
100
+ st.download_button("Download as CSV", df.to_csv(index=False), "text_31_binary_labels.csv", key="download_csv_tab1_31csv")
101
 
102
  ascending_headers = sorted(mutation_site_headers_actual)
103
  df_sorted = df[[str(h) for h in ascending_headers if str(h) in df.columns]]
104
  st.subheader("Binary Labels (Ascending Order 3244 β†’ 4882)")
105
  st.dataframe(df_sorted)
106
+ st.download_button("Download Ascending Order CSV", df_sorted.to_csv(index=False), "text_binary_labels_ascending.csv", key="download_csv_tab1_ascend")
107
 
108
  # === Robot Preparation Script Generation ===
109
  st.subheader("Robot Preparation Script")
 
133
 
134
  robot_script_df = pd.DataFrame(robot_script)
135
  st.dataframe(robot_script_df)
136
+ st.download_button("Download Robot Script CSV", robot_script_df.to_csv(index=False), "robot_script.csv", key="download_csv_tab1_robot")
137
 
138
 
139
  # Tab 2: EF β†’ Binary
 
167
  st.subheader("Binary Labels (Reordered 4402β†’3244, 4882β†’4455)")
168
  styled = binary_reordered.style.applymap(color_binary)
169
  st.dataframe(styled)
170
+ st.download_button("Download CSV", binary_reordered.to_csv(index=False), "ef_binary_labels.csv", key="download_csv_tab2_csv")
171
 
172
  all_bits = binary_reordered.values.flatten().tolist()
173
  decoded_string = binary_labels_to_string(all_bits)
 
176
 
177
  st.subheader("Binary Labels (Ascending 3244β†’4882)")
178
  st.dataframe(binary_part.style.applymap(color_binary))
179
+ st.download_button("Download Ascending Order CSV", binary_part.to_csv(index=False), "ef_binary_labels_ascending.csv", key="download_csv_tab2_ascend")
180
 
181
  all_bits = binary_part.values.flatten().tolist()
182
  decoded_string = binary_labels_to_string(all_bits)
 
254
 
255
  df = pd.DataFrame(groups, columns=[str(h) for h in mutation_site_headers_3614] + ["Edited Sites"])
256
  st.dataframe(df)
257
+ st.download_button("Download as CSV", df.to_csv(index=False), "text_32_binary_labels.csv", key="download_csv_tab3_csv")
258
 
259
  ascending_headers = sorted(mutation_site_headers_actual_3614)
260
  df_sorted = df[[str(h) for h in ascending_headers if str(h) in df.columns]]
261
  st.subheader("Binary Labels (Ascending Order 3244 β†’ 4882)")
262
  st.dataframe(df_sorted)
263
+ st.download_button("Download Ascending Order CSV", df_sorted.to_csv(index=False), "text_binary_labels_ascending.csv", key="download_csv_tab3_ascend")
264
 
265
  # === Robot Preparation Script Generation ===
266
  st.subheader("Robot Preparation Script")
 
290
 
291
  robot_script_df = pd.DataFrame(robot_script)
292
  st.dataframe(robot_script_df)
293
+ st.download_button("Download Robot Script CSV", robot_script_df.to_csv(index=False), "robot_script.csv", key="download_csv_tab3_robot")
294
 
295
 
296
+ # Tab 4: EF β†’ Binary (32)
297
+ with tab4:
298
  st.write("Upload an Editing Frequency CSV or enter manually:")
299
  st.write("**Note:** Please upload CSV files **without column headers**, in ascending order from 3244 to 4882.")
300
  ef_file = st.file_uploader("Upload EF CSV", type=["csv"], key="ef")
 
324
  st.subheader("Binary Labels (Reordered 4402β†’3244, 4882β†’4455)")
325
  styled = binary_reordered.style.applymap(color_binary)
326
  st.dataframe(styled)
327
+ st.download_button("Download CSV", binary_reordered.to_csv(index=False), "ef_binary_labels.csv", key="download_csv_tab4_csv")
328
 
329
  all_bits = binary_reordered.values.flatten().tolist()
330
  decoded_string = binary_labels_to_string(all_bits)
 
333
 
334
  st.subheader("Binary Labels (Ascending 3244β†’4882)")
335
  st.dataframe(binary_part.style.applymap(color_binary))
336
+ st.download_button("Download Ascending Order CSV", binary_part.to_csv(index=False), "ef_binary_labels_ascending.csv", key="download_csv_tab4_ascend")
337
 
338
  all_bits = binary_part.values.flatten().tolist()
339
  decoded_string = binary_labels_to_string(all_bits)