From de4f99a1dfa7482e214a26639eeaaec8b807db7a Mon Sep 17 00:00:00 2001 From: tibvdm Date: Mon, 22 Apr 2024 16:17:39 +0200 Subject: [PATCH] filter cutoff --- app/controllers/mpa/pept2filtered_controller.rb | 2 +- app/views/mpa/pept2filtered/pept2filtered.json.jbuilder | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/controllers/mpa/pept2filtered_controller.rb b/app/controllers/mpa/pept2filtered_controller.rb index 3f1f0fa..edf34cf 100644 --- a/app/controllers/mpa/pept2filtered_controller.rb +++ b/app/controllers/mpa/pept2filtered_controller.rb @@ -16,7 +16,7 @@ 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["cuttof_used"] } + @response = search(peptides, equate_il, cutoff).uniq.select { |result| !result["cutoff_used"] } # TODO: we should remove this or use a different approach @response.each do |result| diff --git a/app/views/mpa/pept2filtered/pept2filtered.json.jbuilder b/app/views/mpa/pept2filtered/pept2filtered.json.jbuilder index 596cac5..c576bc9 100644 --- a/app/views/mpa/pept2filtered/pept2filtered.json.jbuilder +++ b/app/views/mpa/pept2filtered/pept2filtered.json.jbuilder @@ -1 +1,8 @@ -json.peptides(@response) +json.peptides @response do |peptide| + json.sequence peptide["sequence"] + json.taxa peptide["taxa"] + json.fa do + json.counts peptide["fa"]["counts"] + json.data peptide["fa"]["data"] + end +end