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)
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
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
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)
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())
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())