Skip to content

Commit

Permalink
Update index for new functional annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
pverscha committed Mar 11, 2024
1 parent 2a08111 commit 32871fb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/controllers/mpa_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,22 @@ def pept2data

# Initialize an empty Hash for the mapping
@response = {}
taxa = []

# Iterate over the 'result' array in the response data
response_data["result"].each do |item|
# Map each peptide sequence to its taxon_id in the Hash
@response[item["peptide"]] = item["taxon_id"]
@response[item["sequence"]] = item
taxa.append(item["lca"])
end

taxa = Taxon.includes(:lineage).find(@response.values)
looked_up_taxa = Taxon.includes(:lineage).find(taxa)

@lineages = Hash.new
taxa.each do |taxon|
looked_up_taxa.each do |taxon|
@lineages[taxon.id] = taxon.lineage.to_a_idx
end

puts @lineages.inspect

@response
end

Expand Down

0 comments on commit 32871fb

Please sign in to comment.