Update app.py
Browse files
app.py
CHANGED
|
@@ -80,12 +80,22 @@ predict_clicked = st.button("Prever GO terms")
|
|
| 80 |
def parse_fasta_multiple(fasta_str):
|
| 81 |
entries = fasta_str.strip().split(">")
|
| 82 |
parsed = []
|
| 83 |
-
|
|
|
|
| 84 |
if not entry.strip():
|
| 85 |
continue
|
|
|
|
| 86 |
lines = entry.strip().splitlines()
|
| 87 |
-
|
| 88 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
if seq:
|
| 90 |
parsed.append((header, seq))
|
| 91 |
return parsed
|
|
|
|
| 80 |
def parse_fasta_multiple(fasta_str):
|
| 81 |
entries = fasta_str.strip().split(">")
|
| 82 |
parsed = []
|
| 83 |
+
|
| 84 |
+
for i, entry in enumerate(entries):
|
| 85 |
if not entry.strip():
|
| 86 |
continue
|
| 87 |
+
|
| 88 |
lines = entry.strip().splitlines()
|
| 89 |
+
|
| 90 |
+
# Verifica se estamos num bloco com '>'
|
| 91 |
+
if i > 0:
|
| 92 |
+
header = lines[0].strip()
|
| 93 |
+
seq = "".join(l.strip() for l in lines[1:]).replace(" ", "").upper()
|
| 94 |
+
else:
|
| 95 |
+
# Entrada sem '>', trata tudo como sequência
|
| 96 |
+
header = f"Seq_{i+1}"
|
| 97 |
+
seq = "".join(l.strip() for l in lines).replace(" ", "").upper()
|
| 98 |
+
|
| 99 |
if seq:
|
| 100 |
parsed.append((header, seq))
|
| 101 |
return parsed
|