From 51ffa0181b19c7e923135488e8aa87f309dc348a Mon Sep 17 00:00:00 2001 From: Joshua Klein Date: Tue, 10 Oct 2023 19:45:00 -0400 Subject: [PATCH] Re-factor name retrieval --- pyteomics/proforma.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pyteomics/proforma.py b/pyteomics/proforma.py index 1f0f92d6..fdc8e150 100644 --- a/pyteomics/proforma.py +++ b/pyteomics/proforma.py @@ -361,7 +361,7 @@ def __init__(self, **kwargs): def load_database(self): if _has_psims: - return load_unimod() + return obo_cache.load("http://www.unimod.org/obo/unimod.obo") return Unimod() def resolve(self, name=None, id=None, **kwargs): @@ -397,9 +397,12 @@ def resolve(self, name=None, id=None, **kwargs): 'provider': self.name } else: + name = defn.ex_code_name + if not name: + name = defn.code_name return { "composition": defn.composition, - "name": defn.ex_code_name, + "name": name, "id": defn.id, "mass": defn.monoisotopic_mass, "provider": self.name