From 5b89ab38f9536a61808d960fe217b414cdcaa413 Mon Sep 17 00:00:00 2001 From: tibvdm Date: Mon, 22 Apr 2024 15:23:03 +0200 Subject: [PATCH] basic filtering --- app/controllers/mpa/pept2filtered_controller.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/mpa/pept2filtered_controller.rb b/app/controllers/mpa/pept2filtered_controller.rb index 3692b6a..ee9200d 100644 --- a/app/controllers/mpa/pept2filtered_controller.rb +++ b/app/controllers/mpa/pept2filtered_controller.rb @@ -1,6 +1,6 @@ class Mpa::Pept2filteredController < Mpa::MpaController include SuffixArrayHelper - + def pept2filtered peptides = params[:peptides] || [] missed = params[:missed].nil? ? false : params[:missed] @@ -17,5 +17,10 @@ def pept2filtered # Request the suffix array search service @response = search(peptides, equate_il).uniq + + # TODO: we should remove this or use a different approach + @reponse.each do |result| + result["taxa"] = result["taxa"].select { |taxon_id| taxa_filter_ids.include?(taxon_id) } + end end end