Skip to content

Commit

Permalink
Merge branch 'issue-95-take2' of https://github.com/cancervariants/fusor
Browse files Browse the repository at this point in the history
 into issue-95-take2
  • Loading branch information
katiestahl committed Jul 29, 2024
2 parents c664b77 + 8fd8d3f commit f00ddb2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
5 changes: 2 additions & 3 deletions src/fusor/fusor.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,11 +569,10 @@ def _normalized_gene(
gene_norm_resp = self.gene_normalizer.normalize(query)
if gene_norm_resp.match_type:
gene = gene_norm_resp.gene
# remove normalize.gene from id (ex; 'normalize.gene.hgnc:1097' -> 'hgnc:1097')
gene_id = gene_norm_resp.normalized_id.replace("normalize.gene.", "")
gene.id = gene_id
gene_id = gene_norm_resp.normalized_id
if use_minimal_gene:
return Gene(id=gene_id, label=gene.label), None
gene.id = gene_id
return gene, None
return None, f"gene-normalizer unable to normalize {query}"

Expand Down
5 changes: 1 addition & 4 deletions src/fusor/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,10 +442,7 @@ def _fetch_gene_id(
:param alt_field: the field to fetch the gene from, if it is not called "gene" (ex: associatedGene instead)
:return: gene ID if gene is defined
"""
if alt_field:
gene_info = cls._access_object_attr(obj, alt_field)
else:
gene_info = cls._access_object_attr(obj, "gene")
gene_info = cls._access_object_attr(obj, alt_field if alt_field else "gene")
if gene_info:
gene_id = cls._access_object_attr(gene_info, "id")
if gene_id:
Expand Down

0 comments on commit f00ddb2

Please sign in to comment.