Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
tibvdm committed Apr 16, 2024
1 parent 222eccf commit 179b739
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions app/controllers/mpa/pept2data_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,17 @@ 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

# Retrieve all lineages at once
Lineage.find(taxa).each do |lineage|
@lineages[lineage.taxon_id] = lineage.to_a_idx
end

@response = search_results["result"]
end
end
2 changes: 1 addition & 1 deletion app/helpers/suffix_array_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 179b739

Please sign in to comment.