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