Skip to content

Commit

Permalink
Add IPR and EC prefix to functions
Browse files Browse the repository at this point in the history
  • Loading branch information
pverscha committed Mar 11, 2024
1 parent 750c6e9 commit efb311e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/controllers/mpa_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ def pept2data
# 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
item["fa"]["data"] = item["fa"]["data"].map do |m|
if m.start_with? "IPR"
return "IPR:" . m
end

unless m.start_with? "GO" or m.start_with? "IPR"
return "EC:" . m
end
end
@response[item["sequence"]] = item
taxa.append(item["lca"])
end
Expand Down

0 comments on commit efb311e

Please sign in to comment.