From efb311e80881c64f75d48bf4c11b55b47adda6b7 Mon Sep 17 00:00:00 2001 From: Pieter Verschaffelt Date: Mon, 11 Mar 2024 16:46:23 +0100 Subject: [PATCH] Add IPR and EC prefix to functions --- app/controllers/mpa_controller.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/controllers/mpa_controller.rb b/app/controllers/mpa_controller.rb index f0a5035..c223fbc 100644 --- a/app/controllers/mpa_controller.rb +++ b/app/controllers/mpa_controller.rb @@ -47,6 +47,15 @@ def pept2data # Iterate over the 'result' array in the response data response_data["result"].each do |item| # Map each peptide sequence to its taxon_id in the Hash + item["fa"]["data"] = item["fa"]["data"].map do |m| + if m.start_with? "IPR" + return "IPR:" . m + end + + unless m.start_with? "GO" or m.start_with? "IPR" + return "EC:" . m + end + end @response[item["sequence"]] = item taxa.append(item["lca"]) end