Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ uploaded_file2 = st.file_uploader("Upload Second Excel File", type=["xlsx"])
|
|
14 |
|
15 |
if uploaded_file1 and uploaded_file2:
|
16 |
try:
|
17 |
-
# Read files, header starts at second row
|
18 |
df1 = pd.read_excel(uploaded_file1, header=1)
|
19 |
df2 = pd.read_excel(uploaded_file2, header=1)
|
20 |
|
@@ -22,10 +22,10 @@ if uploaded_file1 and uploaded_file2:
|
|
22 |
df1.columns = df1.columns.astype(str)
|
23 |
df2.columns = df2.columns.astype(str)
|
24 |
|
25 |
-
#
|
26 |
id_col = df1.columns[0]
|
27 |
name_col = df1.columns[1]
|
28 |
-
repeat_columns = df1.columns[2:] #
|
29 |
|
30 |
differences = []
|
31 |
|
@@ -51,7 +51,7 @@ if uploaded_file1 and uploaded_file2:
|
|
51 |
differences.append({
|
52 |
id_col: entry_id,
|
53 |
name_col: protein_name,
|
54 |
-
"Repeat": repeat_col,
|
55 |
"Frequency File 1": freq1,
|
56 |
"Frequency File 2": freq2,
|
57 |
"Difference": diff
|
@@ -77,4 +77,4 @@ if uploaded_file1 and uploaded_file2:
|
|
77 |
st.info("No changes in repeat frequencies were found.")
|
78 |
|
79 |
except Exception as e:
|
80 |
-
st.error(f"
|
|
|
14 |
|
15 |
if uploaded_file1 and uploaded_file2:
|
16 |
try:
|
17 |
+
# Read files, header starts at second row (index 1)
|
18 |
df1 = pd.read_excel(uploaded_file1, header=1)
|
19 |
df2 = pd.read_excel(uploaded_file2, header=1)
|
20 |
|
|
|
22 |
df1.columns = df1.columns.astype(str)
|
23 |
df2.columns = df2.columns.astype(str)
|
24 |
|
25 |
+
# Extract ID, Name, and Repeat columns
|
26 |
id_col = df1.columns[0]
|
27 |
name_col = df1.columns[1]
|
28 |
+
repeat_columns = df1.columns[2:] # actual repeat names
|
29 |
|
30 |
differences = []
|
31 |
|
|
|
51 |
differences.append({
|
52 |
id_col: entry_id,
|
53 |
name_col: protein_name,
|
54 |
+
"Repeat": repeat_col, # ✅ actual repeat name from header
|
55 |
"Frequency File 1": freq1,
|
56 |
"Frequency File 2": freq2,
|
57 |
"Difference": diff
|
|
|
77 |
st.info("No changes in repeat frequencies were found.")
|
78 |
|
79 |
except Exception as e:
|
80 |
+
st.error(f"⚠ Error: {e}")
|