def parse_prefix ( identifier ) : pf , id = ( ) , identifier if "|" in identifier : pf , id = tuple ( identifier . split ( '|' ) [ : - 1 ] ) , identifier . split ( '|' ) [ - 1 ] return pf , id
prefix notation parsing in python
Parse identifier such as a|c|le|d|li|re|or|AT4G00480 . 1 and return tuple of prefix string ( separated at | ) and suffix ( AGI identifier )
def parse_prefix(identifier):
    """
    Parse identifier such as a|c|le|d|li|re|or|AT4G00480.1 and return
    tuple of prefix string (separated at '|') and suffix (AGI identifier)
    """
    pf, id = (), identifier
    if "|" in identifier:
        pf, id = tuple(identifier.split('|')[:-1]), identifier.split('|')[-1]

    return pf, id