Update app.py
Browse files
app.py
CHANGED
|
@@ -59,6 +59,23 @@ import streamlit as st
|
|
| 59 |
from io import BytesIO
|
| 60 |
import xlsxwriter
|
| 61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
# Function to generate and download Excel workbook with separate sheets for each input file
|
| 63 |
def create_excel(sequences_data, homorepeats, filenames):
|
| 64 |
output = BytesIO()
|
|
@@ -140,19 +157,3 @@ if uploaded_files:
|
|
| 140 |
result_df = pd.DataFrame(rows)
|
| 141 |
st.dataframe(result_df)
|
| 142 |
|
| 143 |
-
# Function to process the Excel file
|
| 144 |
-
def process_excel(excel_data):
|
| 145 |
-
# Custom logic to process each sheet within the Excel file
|
| 146 |
-
homorepeats = set()
|
| 147 |
-
sequence_data = []
|
| 148 |
-
|
| 149 |
-
for sheet_name in excel_data.sheet_names:
|
| 150 |
-
df = excel_data.parse(sheet_name)
|
| 151 |
-
for index, row in df.iterrows():
|
| 152 |
-
entry_id = row['Entry ID']
|
| 153 |
-
protein_name = row['Protein Name']
|
| 154 |
-
freq = {repeat: row[repeat] for repeat in df.columns[2:]} # Assuming repeats start from 3rd column
|
| 155 |
-
sequence_data.append((entry_id, protein_name, freq))
|
| 156 |
-
homorepeats.update(freq.keys())
|
| 157 |
-
|
| 158 |
-
return homorepeats, sequence_data
|
|
|
|
| 59 |
from io import BytesIO
|
| 60 |
import xlsxwriter
|
| 61 |
|
| 62 |
+
# Function to process the Excel file
|
| 63 |
+
def process_excel(excel_data):
|
| 64 |
+
# Custom logic to process each sheet within the Excel file
|
| 65 |
+
homorepeats = set()
|
| 66 |
+
sequence_data = []
|
| 67 |
+
|
| 68 |
+
for sheet_name in excel_data.sheet_names:
|
| 69 |
+
df = excel_data.parse(sheet_name)
|
| 70 |
+
for index, row in df.iterrows():
|
| 71 |
+
entry_id = row['Entry ID']
|
| 72 |
+
protein_name = row['Protein Name']
|
| 73 |
+
freq = {repeat: row[repeat] for repeat in df.columns[2:]} # Assuming repeats start from 3rd column
|
| 74 |
+
sequence_data.append((entry_id, protein_name, freq))
|
| 75 |
+
homorepeats.update(freq.keys())
|
| 76 |
+
|
| 77 |
+
return homorepeats, sequence_data
|
| 78 |
+
|
| 79 |
# Function to generate and download Excel workbook with separate sheets for each input file
|
| 80 |
def create_excel(sequences_data, homorepeats, filenames):
|
| 81 |
output = BytesIO()
|
|
|
|
| 157 |
result_df = pd.DataFrame(rows)
|
| 158 |
st.dataframe(result_df)
|
| 159 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|