From fb489f9f00e4a6777b3973d0d18faf3d54532a2a Mon Sep 17 00:00:00 2001 From: tibvdm Date: Mon, 22 Apr 2024 16:24:45 +0200 Subject: [PATCH] filter --- app/controllers/mpa/pept2filtered_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/mpa/pept2filtered_controller.rb b/app/controllers/mpa/pept2filtered_controller.rb index faa62dd..e98e5bf 100644 --- a/app/controllers/mpa/pept2filtered_controller.rb +++ b/app/controllers/mpa/pept2filtered_controller.rb @@ -16,11 +16,11 @@ def pept2filtered taxa_filter_ids = (params[:taxa] || []).map(&:to_i) # Request the suffix array search service - @response = search(peptides, equate_il, cutoff).uniq.select { |result| !result["cutoff_used"] } + @response = search(peptides, equate_il, cutoff).select { |result| !result["cutoff_used"] }.uniq # TODO: we should remove this or use a different approach - # @response.each do |result| - # result["taxa"] = result["taxa"].select { |taxon_id| taxa_filter_ids.include?(taxon_id) }.uniq - # end + @response.each do |result| + result["taxa"] = result["taxa"].select { |taxon_id| taxa_filter_ids.include?(taxon_id) }.uniq + end end end