diff --git a/src/fusor/fusor.py b/src/fusor/fusor.py index 808021e..f8cb1da 100644 --- a/src/fusor/fusor.py +++ b/src/fusor/fusor.py @@ -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}" diff --git a/src/fusor/models.py b/src/fusor/models.py index d8ed1f6..04148ac 100644 --- a/src/fusor/models.py +++ b/src/fusor/models.py @@ -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: