コード例 #1
0
ファイル: model.py プロジェクト: cmluria/emmaa
 def upload_to_ndex(self):
     """Upload the assembled model as CX to NDEx"""
     assembled_stmts = self.run_assembly()
     cxa = CxAssembler(assembled_stmts, network_name=self.name)
     cxa.make_model()
     cx_str = cxa.print_cx()
     ndex_client.update_network(cx_str, self.ndex_network)
コード例 #2
0
ファイル: machine.py プロジェクト: johnbachman/indra
def assemble_cx(stmts, name):
    ca = CxAssembler()
    ca.network_name = name
    ca.add_statements(stmts)
    ca.make_model()
    cx_str = ca.print_cx()
    return cx_str
コード例 #3
0
def assemble_cx(stmts, name):
    ca = CxAssembler()
    ca.network_name = name
    ca.add_statements(stmts)
    ca.make_model()
    cx_str = ca.print_cx()
    return cx_str
コード例 #4
0
 def update_to_ndex(self):
     """Update assembled model as CX on NDEx, updates existing network."""
     if not self.assembled_stmts:
         self.run_assembly()
     cxa = CxAssembler(self.assembled_stmts, network_name=self.name)
     cxa.make_model()
     cx_str = cxa.print_cx()
     ndex_client.update_network(cx_str, self.ndex_network)
コード例 #5
0
def test_cited():
    cxa = CxAssembler()
    cxa.add_statements([st_cited])
    cxa.make_model()
    assert len(cxa.cx['citations']) == 1
    assert len(cxa.cx['edgeCitations']) == 1
    citation = cxa.cx['citations'][0]
    assert citation.get('dc:identifier') == 'pmid:12345'
    cid = citation.get('@id')
    assert cxa.cx['edgeCitations'][0]['citations'][0] == cid
    print(cxa.print_cx())
コード例 #6
0
def test_cited():
    cxa = CxAssembler()
    cxa.add_statements([st_cited])
    cxa.make_model()
    assert len(cxa.cx['citations']) == 1
    assert len(cxa.cx['edgeCitations']) == 1
    citation = cxa.cx['citations'][0]
    assert citation.get('dc:identifier') == 'pmid:12345'
    cid = citation.get('@id')
    assert cxa.cx['edgeCitations'][0]['citations'][0] == cid
    print(cxa.print_cx())