def process_set(line, annotations):
    """Convert annotations into nanopub_bel annotations format"""

    matches = re.match('SET\s+(\w+)\s*=\s*"?(.*?)"?\s*$', line)

    key = None
    if matches:
        key = matches.group(1)
        val = matches.group(2)

    if key == "STATEMENT_GROUP":
        annotations["statement_group"] = val
    elif key == "Citation":
        annotations["citation"] = process_citation(val)
    elif key.lower() == "support" or key.lower() == "evidence":
        annotations["evidence"] = val
    elif re.match("\s*{.*?}", val):
        vals = convert_csv_str_to_list(val)
        annotations[key] = vals
    else:
        annotations[key] = val

    return annotations
def process_set ( line , annotations ) : matches = re . match ( 'SET\s+(\w+)\s*=\s*"?(.*?)"?\s*$' , line ) key = None if matches : key = matches . group ( 1 ) val = matches . group ( 2 ) if key == "STATEMENT_GROUP" : annotations [ "statement_group" ] = val elif key == "Citation" : annotations [ "citation" ] = process_citation ( val ) elif key . lower ( ) == "support" or key . lower ( ) == "evidence" : annotations [ "evidence" ] = val elif re . match ( "\s*{.*?}" , val ) : vals = convert_csv_str_to_list ( val ) annotations [ key ] = vals else : annotations [ key ] = val return annotations
Convert annotations into nanopub_bel annotations format