diff --git a/app/controllers/private_api/proteins_controller.rb b/app/controllers/private_api/proteins_controller.rb index bee7315..e81e36e 100644 --- a/app/controllers/private_api/proteins_controller.rb +++ b/app/controllers/private_api/proteins_controller.rb @@ -20,13 +20,13 @@ def proteins end # Request the suffix array search service - search_result = search([ peptide ], equate_il) - if search_result.empty? + search_result = search([ peptide ], equate_il).first + if search_result.nil? return end # Collect all protein information - @proteins = UniprotEntry.where(uniprot_accession_number: search_result[0]["uniprot_accessions"]) + @proteins = UniprotEntry.where(uniprot_accession_number: search_result["uniprot_accessions"]) @lca = search_result["lca"] || -1