roni commited on
Commit
4a6ff7a
·
1 Parent(s): d48c285

uniprot ID added to display

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -37,7 +37,10 @@ def limit_n_results(n):
37
  def aggregate_search_results(raw_results: List[dict], max_res: int) -> Dict[str, dict]:
38
  aggregated_by_gene = collections.defaultdict(list)
39
  for raw_result in raw_results:
40
- entry = select_keys(raw_result, ["pdb_name", "chain_id", "score", "organism"])
 
 
 
41
  genes = raw_result["genes"]
42
  if genes is not None:
43
  gene_names = genes.split(" ")
@@ -58,7 +61,8 @@ def format_search_results(agg_search_results):
58
  entry = entries[0]
59
  organism = entry["organism"]
60
  score = entry["score"]
61
- key = f"Gene: {gene} | Organism: {organism}"
 
62
  formatted_search_results[key] = score
63
  return formatted_search_results
64
 
 
37
  def aggregate_search_results(raw_results: List[dict], max_res: int) -> Dict[str, dict]:
38
  aggregated_by_gene = collections.defaultdict(list)
39
  for raw_result in raw_results:
40
+ entry = select_keys(
41
+ raw_result,
42
+ keys=["pdb_name", "chain_id", "score", "organism", "uniprot_id"]
43
+ )
44
  genes = raw_result["genes"]
45
  if genes is not None:
46
  gene_names = genes.split(" ")
 
61
  entry = entries[0]
62
  organism = entry["organism"]
63
  score = entry["score"]
64
+ uniprot_id = entry["uniprot_id"]
65
+ key = f"Gene: {gene} | Organism: {organism} | Uniprot ID: {uniprot_id}"
66
  formatted_search_results[key] = score
67
  return formatted_search_results
68