Skip to content

Commit

Permalink
fix queries to correctly retrieve proteins (capitalize)
Browse files Browse the repository at this point in the history
  • Loading branch information
Maluuck committed Jan 7, 2024
1 parent e72395c commit 998853a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/src/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ def get_protein_ids_for_names(driver: neo4j.Driver, names: list[str], species_id
result_names = list(genes_set - aliases_set) + list(symbols_set - genes_set)
query = f"""
MATCH (protein:Protein:{species})
WHERE protein.SYMBOL IN {str([n.title() for n in result_names])}
OR protein.ENSEMBL_PROTEIN IN {str([n.title() for n in result_names])}
WHERE protein.SYMBOL IN {str([n.capitalize() for n in result_names])}
OR protein.ENSEMBL_PROTEIN IN {str([n.capitalize() for n in result_names])}
RETURN protein, protein.ENSEMBL_PROTEIN AS id
"""
with driver.session() as session:
Expand Down Expand Up @@ -161,7 +161,7 @@ def _convert_to_symbol_alias(result: neo4j.Result) -> (set[str], set[str]):
aliases.add(alias)
# Only add the (symbol: alias) if the symbol isnt there already
if row["symbol"] not in mapping:
mapping[symbol.title()] = alias.title()
mapping[symbol.capitalize()] = alias.capitalize()
return symbols, aliases, mapping


Expand Down

0 comments on commit 998853a

Please sign in to comment.