Update app.py
Browse files
app.py
CHANGED
|
@@ -44,7 +44,7 @@ def embed_seq(model, seq, chunk):
|
|
| 44 |
mlp_pb = load_keras("mlp_protbert.h5")
|
| 45 |
mlp_bfd = load_keras("mlp_protbertbfd.h5")
|
| 46 |
mlp_esm = load_keras("mlp_esm2.h5")
|
| 47 |
-
stacking = load_keras("ensemble_stack.h5")
|
| 48 |
|
| 49 |
mlb = joblib.load(download_file("data/mlb_597.pkl"))
|
| 50 |
GO = mlb.classes_
|
|
@@ -65,11 +65,12 @@ predict_clicked = st.button("Prever GO terms")
|
|
| 65 |
if predict_clicked:
|
| 66 |
|
| 67 |
# ——— Validação mínima ———
|
| 68 |
-
seq = "
|
| 69 |
if not seq:
|
| 70 |
st.warning("Por favor, insere primeiro uma sequência FASTA válida.")
|
| 71 |
st.stop()
|
| 72 |
|
|
|
|
| 73 |
# ——— 1) EMBEDDINGS ———
|
| 74 |
with st.spinner("⏳ A gerar embeddings…"):
|
| 75 |
emb_pb = embed_seq("Rostlab/prot_bert", seq, CHUNK_PB)
|
|
|
|
| 44 |
mlp_pb = load_keras("mlp_protbert.h5")
|
| 45 |
mlp_bfd = load_keras("mlp_protbertbfd.h5")
|
| 46 |
mlp_esm = load_keras("mlp_esm2.h5")
|
| 47 |
+
stacking = load_keras("ensemble_stack.h5")
|
| 48 |
|
| 49 |
mlb = joblib.load(download_file("data/mlb_597.pkl"))
|
| 50 |
GO = mlb.classes_
|
|
|
|
| 65 |
if predict_clicked:
|
| 66 |
|
| 67 |
# ——— Validação mínima ———
|
| 68 |
+
seq = "".join(l.strip() for l in fasta_input.splitlines() if not l.startswith(">")).replace(" ", "").upper()
|
| 69 |
if not seq:
|
| 70 |
st.warning("Por favor, insere primeiro uma sequência FASTA válida.")
|
| 71 |
st.stop()
|
| 72 |
|
| 73 |
+
|
| 74 |
# ——— 1) EMBEDDINGS ———
|
| 75 |
with st.spinner("⏳ A gerar embeddings…"):
|
| 76 |
emb_pb = embed_seq("Rostlab/prot_bert", seq, CHUNK_PB)
|