Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return None
# If no site information for this residue, skip
if mod_condition.position is None or mod_condition.residue is None:
return None
# Otherwise, try to map it and return the mapped site
mapped_site = \
self.map_to_human_ref(up_id, 'uniprot',
mod_condition.residue,
mod_condition.position,
do_methionine_offset=self.do_methionine_offset,
do_orthology_mapping=self.do_orthology_mapping,
do_isoform_mapping=self.do_isoform_mapping)
return mapped_site
default_mapper = SiteMapper(default_site_map)
# TODO: determine if this should be done in the protmapper or if this is the
# preferred place
@lru_cache(maxsize=10000)
def _get_uniprot_id(agent):
"""Return the UniProt ID for an agent, looking up in HGNC if necessary.
If the UniProt ID is a list then return the first ID by default.
"""
up_id = agent.db_refs.get('UP')
hgnc_id = agent.db_refs.get('HGNC')
if up_id is None:
if hgnc_id is None:
# If both UniProt and HGNC refs are missing we can't
# sequence check and so don't report a failure.