From 250ad1877dce25296dbbbad3b7c8af07e3486be1 Mon Sep 17 00:00:00 2001 From: Pieter Verschaffelt Date: Thu, 29 Feb 2024 15:14:23 +0100 Subject: [PATCH] response to empty peptide list --- app/controllers/mpa_controller.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/controllers/mpa_controller.rb b/app/controllers/mpa_controller.rb index 65be155..b4df785 100644 --- a/app/controllers/mpa_controller.rb +++ b/app/controllers/mpa_controller.rb @@ -8,6 +8,13 @@ def pept2data missed = params[:missed] || false @equate_il = params[:equate_il].nil? ? true : params[:equate_il] + if peptides.empty? + @response = Hash.new + @lineages = Hash.new + + return + end + File.open("/mnt/data/suffix-array/unipept_query.txt", "w+") do |f| peptides.each { |element| f.puts(element) } end