From 179b739fbb21eef8e49ec6045f5bc9109e20444b Mon Sep 17 00:00:00 2001 From: tibvdm Date: Tue, 16 Apr 2024 10:48:55 +0200 Subject: [PATCH] test --- app/controllers/mpa/pept2data_controller.rb | 6 ++---- app/helpers/suffix_array_helper.rb | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/controllers/mpa/pept2data_controller.rb b/app/controllers/mpa/pept2data_controller.rb index 07b464c..29c2546 100644 --- a/app/controllers/mpa/pept2data_controller.rb +++ b/app/controllers/mpa/pept2data_controller.rb @@ -14,11 +14,11 @@ def pept2data end # Request the suffix array search service - search_results = search(peptides, equate_il) + @response = search(peptides, equate_il).uniq # Collect all lca's to look up the lineages taxa = [] - search_results["result"].each do |result| + @response.each do |result| taxa.append(result["lca"]) end @@ -26,7 +26,5 @@ def pept2data Lineage.find(taxa).each do |lineage| @lineages[lineage.taxon_id] = lineage.to_a_idx end - - @response = search_results["result"] end end diff --git a/app/helpers/suffix_array_helper.rb b/app/helpers/suffix_array_helper.rb index 002f618..29406f3 100644 --- a/app/helpers/suffix_array_helper.rb +++ b/app/helpers/suffix_array_helper.rb @@ -17,6 +17,6 @@ def search(peptides, equate_il) end # Parse the response from the suffix array search service - JSON.parse(response.body) + JSON.parse(response.body)["result"] end end