def test_grounding_all(): im = IncrementalModel() stmt = Complex([Agent('A', db_refs={'UP': 'ABCD'}), Agent('B', db_refs={'HGNC': '1234'})]) im.add_statements('12345', [stmt]) im.preassemble(filters=['grounding']) assert len(im.assembled_stmts) == 1
def test_add_stmts_prior_all(): im = IncrementalModel() im.stmts['prior'] = [stmts[0]] im.prior_genes = ['MAPK1', 'MAPK3'] im.add_statements('12345', [stmts[1]]) im.preassemble(filters=['prior_all']) assert len(im.assembled_stmts) == 1
def test_add_stmts_prior_all(): im = IncrementalModel() # Start out with MAPK1 and MAPK3 im.stmts['prior'] = [stmts[0]] im.prior_genes = ['MAPK1', 'MAPK3'] # Try to add MAP2K1 and MAPK3 im.add_statements('12345', [stmts[1]]) im.preassemble(filters=['prior_all']) assert len(im.assembled_stmts) == 1, im.assembled_stmts
def test_human_only(): im = IncrementalModel() stmt1 = Phosphorylation(None, Agent('BRAF', db_refs={'UP': 'P15056'})) stmt2 = Phosphorylation(None, Agent('BRAF', db_refs={'UP': 'P28028'})) stmt3 = Phosphorylation(None, Agent('BRAF', db_refs={'HGNC': 'BRAF'})) stmt4 = Phosphorylation(None, Agent('BRAF', db_refs={})) im.add_statements('12345', [stmt1], filters=['human_only']) assert(len(im.get_statements()) == 1) im.add_statements('12346', [stmt2], filters=['human_only']) assert(len(im.get_statements()) == 1) im.add_statements('12346', [stmt3], filters=['human_only']) assert (len(im.get_statements()) == 2) im.add_statements('12346', [stmt4], filters=['human_only']) assert (len(im.get_statements()) == 3)
def test_human_only(): im = IncrementalModel() stmt1 = Phosphorylation(None, Agent('BRAF', db_refs={'UP': 'P15056'})) stmt2 = Phosphorylation(None, Agent('BRAF', db_refs={'UP': 'P28028'})) stmt3 = Phosphorylation(None, Agent('BRAF', db_refs={'HGNC': 'BRAF'})) stmt4 = Phosphorylation(None, Agent('BRAF', db_refs={})) im.add_statements('12345', [stmt1]) im.preassemble(filters=['human_only']) assert len(im.assembled_stmts) == 1 im.add_statements('12346', [stmt2]) im.preassemble(filters=['human_only']) assert len(im.assembled_stmts) == 1 im.add_statements('12346', [stmt3]) im.preassemble(filters=['human_only']) assert (len(im.assembled_stmts) == 2) im.add_statements('12346', [stmt4]) im.preassemble(filters=['human_only']) assert (len(im.assembled_stmts) == 3)
def test_add_stmts_blank_noprior2(): im = IncrementalModel() im.add_statements('12345', stmts, filters=['prior_all']) assert(len(im.get_statements()) == 2)
def test_add_stmts_model_all(): im = IncrementalModel() im.add_statements('12345', [stmts[0]]) im.add_statements('23456', [stmts[1]], filters=['model_all']) assert(len(im.get_statements()) == 1)
def test_add_stmts_blank(): im = IncrementalModel() im.add_statements('12345', stmts) assert(len(im.get_statements()) == 2)
def test_add_stmts_blank_emptyfilter(): im = IncrementalModel() im.add_statements('12345', stmts, filters=[]) assert(len(im.get_statements()) == 2)
def test_add_stmts_blank(): im = IncrementalModel() im.add_statements('12345', stmts) assert len(im.get_statements()) == 2 im.preassemble() assert len(im.assembled_stmts) == 2
def test_grounding_none_agent(): im = IncrementalModel() im.add_statements('12345', stmts2) im.preassemble(filters=['grounding']) assert len(im.assembled_stmts) == 1
def test_add_stmts_blank_nofilter(): im = IncrementalModel() im.add_statements('12345', stmts) im.preassemble(filters=None) assert (len(im.assembled_stmts) == 2)
def test_add_stmts_blank_noprior2(): im = IncrementalModel() im.add_statements('12345', stmts) im.preassemble(filters=['prior_all']) assert len(im.assembled_stmts) == 2
def test_grounding_none_agent(): im = IncrementalModel() im.add_statements('12345', stmts2, filters=['grounding']) assert(len(im.get_statements()) == 1)
def test_add_stmts_prior_all(): im = IncrementalModel() im.stmts['prior'] = [stmts[0]] im.add_statements('12345', [stmts[1]], filters=['prior_all']) assert(len(im.get_statements()) == 1)
def test_add_stmts_blank_emptyfilter(): im = IncrementalModel() im.add_statements('12345', stmts) im.preassemble(filters=[]) assert len(im.assembled_stmts) == 2
def test_grounding_not_all(): im = IncrementalModel() stmt = Complex([Agent('A', db_refs={'UP': 'ABCD'}), Agent('B')]) im.add_statements('12345', [stmt], filters=['grounding']) assert(len(im.get_statements()) == 0)
def test_add_stmts_blank_nofilter(): im = IncrementalModel() im.add_statements('12345', stmts) im.preassemble(filters=None) assert(len(im.assembled_stmts) == 2)