Exemplo n.º 1
0
 def test_thorough_json_file(self):
     """Test the round-trip through a node-link JSON file."""
     sio = StringIO()
     to_json_file(sialic_acid_graph, sio)
     sio.seek(0)
     graph = from_json_file(sio)
     self.help_test_equal(graph)
Exemplo n.º 2
0
def process_json_file(file_name):
    """Return a PybelProcessor by processing a Node-Link JSON file.

    For more information on this format, see:
    http://pybel.readthedocs.io/en/latest/io.html#node-link-json

    Parameters
    ----------
    file_name : str
        The path to a Node-Link JSON file.

    Returns
    -------
    bp : PybelProcessor
        A PybelProcessor object which contains INDRA Statements in
        bp.statements.
    """
    with open(file_name, 'rt') as fh:
        pybel_graph = pybel.from_json_file(fh, False)
    return process_pybel_graph(pybel_graph)
Exemplo n.º 3
0
def process_json_file(file_name):
    """Return a PybelProcessor by processing a Node-Link JSON file.

    For more information on this format, see:
    http://pybel.readthedocs.io/en/latest/io.html#node-link-json

    Parameters
    ----------
    file_name : str
        The path to a Node-Link JSON file.

    Returns
    -------
    bp : PybelProcessor
        A PybelProcessor object which contains INDRA Statements in
        bp.statements.
    """
    with open(file_name, 'rt') as fh:
        pybel_graph = pybel.from_json_file(fh, False)
    return process_pybel_graph(pybel_graph)
Exemplo n.º 4
0
 def test_thorough_json_file(self):
     sio = StringIO()
     to_json_file(self.thorough_graph, sio)
     sio.seek(0)
     graph = from_json_file(sio)
     self.bel_thorough_reconstituted(graph)
Exemplo n.º 5
0
 def test_thorough_json_file(self):
     sio = StringIO()
     to_json_file(sialic_acid_graph, sio)
     sio.seek(0)
     graph = from_json_file(sio)
     self.help_test_equal(graph)