def test_phospho_mod_grounding():
    a = Agent('MEK1',
              mods=[
                  ModCondition('phosphorylation', 'S', '218'),
                  ModCondition('phosphorylation', 'S', '222')
              ],
              db_refs={'HGNC': '6840'})
    b = Agent('ERK2', db_refs={'HGNC': '6871'})
    a_phos = Agent('Foo',
                   mods=[ModCondition('phosphorylation', None, None)],
                   db_refs={'HGNC': '6840'})
    st1 = Phosphorylation(a, b, 'T', '185')
    pysb_asmb = pa.PysbAssembler([st1])
    model = pysb_asmb.make_model(policies='one_step')
    mps = list(pa.grounded_monomer_patterns(model, a_phos))
    assert len(mps) == 2
    assert mps[0].monomer.name == 'MEK1'
    assert mps[1].monomer.name == 'MEK1'
    sc = [mp.site_conditions for mp in mps]
    assert {'S218': ('p', WILD)} in sc
    assert {'S222': ('p', WILD)} in sc
    # Check if we get the doubly phosphorylated MonomerPattern
    mps = list(pa.grounded_monomer_patterns(model, a))
    assert len(mps) == 1
    assert mps[0].monomer.name == 'MEK1'
    assert mps[0].site_conditions == {'S218': ('p', WILD), 'S222': ('p', WILD)}
 def check_policy(policy):
     pysb_asmb = pa.PysbAssembler([st1])
     model = pysb_asmb.make_model(policies=policy)
     mps = list(pa.grounded_monomer_patterns(model, b_phos))
     assert len(mps) == 1
     assert mps[0].monomer.name == 'ERK2'
     assert mps[0].site_conditions == {'T185': ('p', WILD)}
Exemplo n.º 3
0
def test_multiple_grounding_mods():
    mek = Agent('MEK1', db_refs={'HGNC': '6840'})
    erk = Agent('ERK2', db_refs={'HGNC': '6871'})
    cbl = Agent('CBL', db_refs={'HGNC': '1541'})
    ub_phos_erk = Agent(
        'ERK2',
        mods=[ModCondition('phosphorylation', None, None),
              ModCondition('ubiquitination', None, None)],
        db_refs={'HGNC': '6871'})
    st1 = Phosphorylation(mek, erk, 'T', '185')
    st2 = Phosphorylation(mek, erk, 'Y', '187')
    st3 = Ubiquitination(cbl, erk, 'K', '40')
    st4 = Ubiquitination(cbl, erk, 'K', '50')
    pysb_asmb = pa.PysbAssembler([st1, st2, st3, st4])
    model = pysb_asmb.make_model(policies='one_step')
    mps = list(pa.grounded_monomer_patterns(model, ub_phos_erk))
    assert len(mps) == 4
    assert mps[0].monomer.name == 'ERK2'
    assert mps[1].monomer.name == 'ERK2'
    assert mps[2].monomer.name == 'ERK2'
    assert mps[3].monomer.name == 'ERK2'
Exemplo n.º 4
0
def test_get_grounded_agents_from_model():
    mek = Agent('MEK1', db_refs={'HGNC': '6840'})
    erk = Agent('ERK2', db_refs={'HGNC': '6871'})
    erk_phos = Agent('ERK2', db_refs={'HGNC': '6871'},
                     mods=[ModCondition('phosphorylation')])
    erk_phos_y187 = Agent('ERK2', db_refs={'HGNC': '6871'},
                       mods=[ModCondition('phosphorylation', 'Y', '187')])
    phos_stmt = Phosphorylation(mek, erk)
    phos_y187_stmt = Phosphorylation(mek, erk, 'Y', '187')
    pysba = pa.PysbAssembler([phos_stmt, phos_y187_stmt])
    pysb_model = pysba.make_model()
    agents_by_mp, mps_by_rule = pa.get_grounded_agents(pysb_model)
    assert isinstance(agents_by_mp, dict)
    assert isinstance(mps_by_rule, dict)
    model_agents = agents_by_mp.values()
    model_keys = set([ag.matches_key() for ag in model_agents])
    # TODO add other types of agent conditions here
    # TODO do we expect a different agent for af?
    test_keys = set([mek.matches_key(), erk_phos.matches_key(),
                     erk_phos_y187.matches_key()])
    assert len(model_keys.intersection(test_keys)) == 3