Skip to content

Commit

Permalink
Merge pull request #171 from gyorilab/fixes
Browse files Browse the repository at this point in the history
Minor fixes
  • Loading branch information
kkaris authored Jun 8, 2024
2 parents 0d89867 + d91b81e commit 40602dd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/indra_cogex/client/enrichment/mla.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,15 @@ def get_metabolomics_sets(
-------
: A dictionary of EC codes to set of ChEBI identifiers
"""
from indra_cogex.sources.ec import strip_ec_code
# Create local helper function instead of importing this from the sources/ec module
# to avoid importing the whole ec module
def _strip_ec_code(raw_code: str) -> str:
"""Strips off trailing dashes from ec codes"""
# Continue to strip off '.-' until name does not end with '.-'
while raw_code.endswith(".-"):
raw_code = raw_code[:-2]
return raw_code

rv = defaultdict(set)

evidence_line = minimum_evidence_helper(minimum_evidence_count)
Expand Down Expand Up @@ -111,7 +119,7 @@ def get_metabolomics_sets(
hgnc_id = hgnc_curie.replace("hgnc:", "", 1)
chebi_ids = {chebi_curie.split(":", 1)[1] for chebi_curie in chebi_curies}
for raw_ec_code in hgnc_to_enzymes.get(hgnc_id, []):
ec_code = strip_ec_code(raw_ec_code)
ec_code = _strip_ec_code(raw_ec_code)
ec_name = bio_ontology.get_name("ECCODE", ec_code)
rv[ec_code, ec_name].update(chebi_ids)
rv = dict(rv)
Expand Down
1 change: 1 addition & 0 deletions src/indra_cogex/client/enrichment/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,7 @@ def build_caches(force_refresh: bool = False, lazy_loading_ontology: bool = Fals
get_go(force_cache_refresh=force_refresh)
get_reactome(force_cache_refresh=force_refresh)
get_wikipathways(force_cache_refresh=force_refresh)
get_phenotype_gene_sets(force_cache_refresh=force_refresh)
get_entity_to_targets(
minimum_evidence_count=1,
minimum_belief=0.0,
Expand Down

0 comments on commit 40602dd

Please sign in to comment.