From 292241c6c08c151b3f1b4be3f7328c7e40ad4a29 Mon Sep 17 00:00:00 2001 From: tibvdm Date: Tue, 16 Apr 2024 11:57:45 +0200 Subject: [PATCH] fix equate IL --- app/controllers/private_api/proteins_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/private_api/proteins_controller.rb b/app/controllers/private_api/proteins_controller.rb index a4f82f3..bee7315 100644 --- a/app/controllers/private_api/proteins_controller.rb +++ b/app/controllers/private_api/proteins_controller.rb @@ -21,9 +21,12 @@ def proteins # Request the suffix array search service search_result = search([ peptide ], equate_il) + if search_result.empty? + return + end # Collect all protein information - @proteins = UniprotEntry.where(uniprot_accession_number: search_result["uniprot_accessions"]) + @proteins = UniprotEntry.where(uniprot_accession_number: search_result[0]["uniprot_accessions"]) @lca = search_result["lca"] || -1