Example #1
0
def test_trips_processor_offline():
    """Smoke test to see if imports and executes without error. Doesn't
    check for correctness of parse or of assembled model."""
    pa = PysbAssembler()
    tp = trips_api.process_xml(open(test_small_file).read())
    pa.add_statements(tp.statements)
    model = pa.make_model()
Example #2
0
def test_trips_processor_offline():
    """Smoke test to see if imports and executes without error. Doesn't
    check for correctness of parse or of assembled model."""
    pa = PysbAssembler()
    tp = trips_api.process_xml(open(test_small_file).read())
    pa.add_statements(tp.statements)
    model = pa.make_model()
Example #3
0
def text_to_sbgn(text=None, trips_xml=None):
    if (text is None and trips_xml is None) or (text is not None and trips_xml is not None):
        raise ValueError("Must provide ONE of 'text' or 'trips_xml'")
    elif text is not None:
        tp = trips_api.process_text(text)
    elif trips_xml is not None:
        tp = trips_api.process_xml(trips_xml)
    else:
        raise RuntimeError("Unexpected or impossible combination of arguments")
    sa = SBGNAssembler()
    sa.add_statements(tp.statements)
    sbgn_output = sa.make_sbgn()
    return sbgn_output
Example #4
0
def text_to_sbgn(text=None, trips_xml=None):
    if ((text is None and trips_xml is None)
            or (text is not None and trips_xml is not None)):
        raise ValueError("Must provide ONE of 'text' or 'trips_xml'")
    elif text is not None:
        tp = trips_api.process_text(text)
    elif trips_xml is not None:
        tp = trips_api.process_xml(trips_xml)
    else:
        raise RuntimeError("Unexpected or impossible combination of arguments")
    sa = SBGNAssembler()
    sa.add_statements(tp.statements)
    sbgn_output = sa.make_model()
    return sbgn_output