def get_obsolete_acc_to_uniparc(acc):
    ''' Tries to determine the UniParc ID for obsolete ACCs which are not returned using uniprot_map.

        :param acc: The UniProt accession number.
        :return: The corresponding UniParc ID.

        Warning: This is a fragile function as the underlying website generation or URL could change.
    '''
    contents = http_get('www.uniprot.org/uniparc/?query={0}'.format(acc))
    mtchs = re.findall(r'"UPI[A-Z0-9]+?"', contents, re.DOTALL)
    uniparc_id = set([m[1:-1] for m in mtchs])
    if len(uniparc_id) == 1:
        return uniparc_id.pop()
    elif len(uniparc_id) > 1:
        raise Exception('Multiple UPI identifiers found.')
    return None
def get_obsolete_acc_to_uniparc ( acc ) : contents = http_get ( 'www.uniprot.org/uniparc/?query={0}' . format ( acc ) ) mtchs = re . findall ( r'"UPI[A-Z0-9]+?"' , contents , re . DOTALL ) uniparc_id = set ( [ m [ 1 : - 1 ] for m in mtchs ] ) if len ( uniparc_id ) == 1 : return uniparc_id . pop ( ) elif len ( uniparc_id ) > 1 : raise Exception ( 'Multiple UPI identifiers found.' ) return None
Tries to determine the UniParc ID for obsolete ACCs which are not returned using uniprot_map.

        :param acc: The UniProt accession number.
        :return: The corresponding UniParc ID.

        Warning: This is a fragile function as the underlying website generation or URL could change.