def create_mod_site(self, mc): """Create modification site for the BaseAgent from a ModCondition.""" site_name = get_mod_site_name(mc) (unmod_site_state, mod_site_state) = states[mc.mod_type] self.create_site(site_name, (unmod_site_state, mod_site_state)) site_anns = [ Annotation((site_name, mod_site_state), mc.mod_type, 'is_modification') ] if mc.residue: site_anns.append(Annotation(site_name, mc.residue, 'is_residue')) if mc.position: site_anns.append(Annotation(site_name, mc.position, 'is_position')) self.site_annotations += site_anns
def test_get_mp_with_grounding_2(): a1 = Agent('A', mods=[ModCondition('phosphorylation', None, None)], db_refs={'HGNC': '6840'}) a2 = Agent('A', mods=[ModCondition('phosphorylation', 'Y', '187')], db_refs={'HGNC': '6840'}) Monomer('A_monomer', ['phospho', 'T185', 'Y187'], { 'phospho': 'y', 'T185': ['u', 'p'], 'Y187': ['u', 'p'] }) Annotation(A_monomer, 'https://identifiers.org/hgnc:6840') A_monomer.site_annotations = [ Annotation(('phospho', 'y'), 'phosphorylation', 'is_modification'), Annotation(('T185', 'p'), 'phosphorylation', 'is_modification'), Annotation(('Y187', 'p'), 'phosphorylation', 'is_modification'), Annotation('T185', 'T', 'is_residue'), Annotation('T185', '185', 'is_position'), Annotation('Y187', 'Y', 'is_residue'), Annotation('Y187', '187', 'is_position') ] mps_1 = list(pa.grounded_monomer_patterns(model, a1)) assert len(mps_1) == 3 mps_2 = list(pa.grounded_monomer_patterns(model, a2)) assert len(mps_2) == 1 mp = mps_2[0] assert mp.monomer == A_monomer assert mp.site_conditions == {'Y187': ('p', WILD)}
def test_get_mp_with_grounding(): foo = Agent('Foo', db_refs={'HGNC': 'foo'}) a = Agent('A', db_refs={'HGNC': '6840'}) b = Agent('B', db_refs={'HGNC': '6871'}) Monomer('A_monomer') Monomer('B_monomer') Annotation(A_monomer, 'http://identifiers.org/hgnc/HGNC:6840') Annotation(B_monomer, 'http://identifiers.org/hgnc/HGNC:6871') mps = list(pa.grounded_monomer_patterns(model, foo)) assert len(mps) == 0 mps = list(pa.grounded_monomer_patterns(model, a)) assert len(mps) == 1 assert mps[0].monomer == A_monomer mps = list(pa.grounded_monomer_patterns(model, b)) assert len(mps) == 1 assert mps[0].monomer == B_monomer
def add_obs_for_agents(main_agent, ref_agents=None): if ref_agents: all_agents = [main_agent] + ref_agents else: all_agents = [main_agent] ag_to_obj_mps = self.get_all_mps(all_agents, mapping=True) if all([not v for v in ag_to_obj_mps.values()]): logger.debug('No monomer patterns found in model for agents %s' ', skipping' % all_agents) return obs_nodes = NodesContainer(main_agent, ref_agents) main_obs_set = set() ref_obs_set = set() for agent in ag_to_obj_mps: for obj_mp in ag_to_obj_mps[agent]: obs_name = _monomer_pattern_label(obj_mp) + '_obs' self.obs_to_agents[obs_name] = agent # Add the observable obj_obs = Observable(obs_name, obj_mp, _export=False) if agent.matches(main_agent): main_obs_set.add(obs_name) else: ref_obs_set.add(obs_name) try: self.model.add_component(obj_obs) self.model.add_annotation( Annotation(obs_name, agent.name, 'from_indra_agent')) except ComponentDuplicateNameError as e: pass obs_nodes.main_interm = main_obs_set obs_nodes.ref_interm = ref_obs_set return obs_nodes
def add_obs_for_agent(agent): obj_mps = list(pa.grounded_monomer_patterns(self.model, agent)) if not obj_mps: logger.debug('No monomer patterns found in model for agent %s,' ' skipping' % agent) return obs_list = [] for obj_mp in obj_mps: obs_name = _monomer_pattern_label(obj_mp) + '_obs' # Add the observable obj_obs = Observable(obs_name, obj_mp, _export=False) obs_list.append(obs_name) try: self.model.add_component(obj_obs) self.model.add_annotation( Annotation(obs_name, agent.name, 'from_indra_agent')) except ComponentDuplicateNameError as e: pass return obs_list
def get_annotation(component, db_name, db_ref): ''' Construct Annotation following format guidelines given at http://identifiers.org/. ''' url = 'http://identifiers.org/' subj = component if db_name == 'UP': obj = url + 'uniprot/%s' % db_ref pred = 'is' elif db_name == 'HGNC': obj = url + 'hgnc/HGNC:%s' % db_ref pred = 'is' elif db_name == 'XFAM' and db_ref.startswith('PF'): obj = url + 'pfam/%s' % db_ref pred = 'is' elif db_name == 'CHEBI': obj = url + 'chebi/CHEBI:%s' % db_ref pred = 'is' else: return None return Annotation(subj, obj, pred)
Initial(C6(bf=None, state='pro'), C6_0) Initial(C9(bf=None), C9_0) Initial(PARP(bf=None, state='U'), PARP_0) Initial(XIAP(bf=None), XIAP_0) Initial(Bid(bf=None, state='U'), Bid_0) Initial(Bax(bf=None, s1=None, s2=None, state='C'), Bax_0) Initial(Bak(bf=None, s1=None, s2=None, state='M'), Bak_0) Initial(Bcl2(bf=None, state='M'), Bcl2_0) Initial(BclxL(bf=None, state='M'), BclxL_0) Initial(Mcl1(bf=None, state='M'), Mcl1_0) Initial(Bad(bf=None, state='M'), Bad_0) Initial(Noxa(bf=None, state='M'), Noxa_0) Initial(CytoC(bf=None, state='M'), CytoC_0) Initial(Smac(bf=None, state='M'), Smac_0) Annotation(L, 'http://identifiers.org/uniprot/P50591', 'is') Annotation(R, 'http://identifiers.org/uniprot/O14763', 'is') Annotation(DISC, 'http://identifiers.org/obo.go/GO:0031264', 'is') Annotation(flip, 'http://identifiers.org/uniprot/O15519', 'is') Annotation(C8, 'http://identifiers.org/uniprot/Q14790', 'is') Annotation(BAR, 'http://identifiers.org/uniprot/Q9NZS9', 'is') Annotation(Bid, 'http://identifiers.org/uniprot/P55957', 'is') Annotation(Bax, 'http://identifiers.org/uniprot/Q07812', 'is') Annotation(Bak, 'http://identifiers.org/uniprot/Q16611', 'is') Annotation(Bcl2, 'http://identifiers.org/uniprot/P10415', 'is') Annotation(BclxL, 'http://identifiers.org/uniprot/Q07817', 'is') Annotation(Mcl1, 'http://identifiers.org/uniprot/Q07820', 'is') Annotation(Bad, 'http://identifiers.org/uniprot/Q92934', 'is') Annotation(Noxa, 'http://identifiers.org/uniprot/Q13794', 'is') Annotation(CytoC, 'http://identifiers.org/uniprot/P99999', 'is') Annotation(Smac, 'http://identifiers.org/uniprot/Q9NR28', 'is')
u'HIPK2_deactivates_PPM1D_activity', HIPK2() + PPM1D(activity=u'active') >> HIPK2() + PPM1D(activity=u'inactive'), kf_hp_act_1) Rule(u'ARF_deactivates_MDM2_activity', ARF() + MDM2(activity=u'active') >> ARF() + MDM2(activity=u'inactive'), kf_am_act_1) Initial(PPM1D(activity=u'inactive'), PPM1D_0) Initial(TP53(activity=u'inactive'), TP53_0) Initial(HIPK2(), HIPK2_0) Initial(ATR(activity=u'inactive'), ATR_0) Initial(ARF(), ARF_0) Initial(MDM2(activity=u'inactive'), MDM2_0) Initial(ATR(activity=u'active'), ATRa_0) Annotation(PPM1D, u'http://identifiers.org/hgnc/HGNC:9277', u'is') Annotation(PPM1D, u'http://identifiers.org/uniprot/O15297', u'is') Annotation(TP53, u'http://identifiers.org/hgnc/HGNC:11998', u'is') Annotation(TP53, u'http://identifiers.org/uniprot/P04637', u'is') Annotation(HIPK2, u'http://identifiers.org/uniprot/Q9H2X6', u'is') Annotation(HIPK2, u'http://identifiers.org/hgnc/HGNC:14402', u'is') Annotation(ATR, u'http://identifiers.org/uniprot/Q13535', u'is') Annotation(ATR, u'http://identifiers.org/hgnc/HGNC:882', u'is') Annotation(MDM2, u'http://identifiers.org/uniprot/Q00987', u'is') Annotation(MDM2, u'http://identifiers.org/hgnc/HGNC:6973', u'is') Annotation(ATR_activates_ATR_activity, u'ATR', u'rule_has_subject') Annotation(ATR_activates_ATR_activity, u'ATR', u'rule_has_object') Annotation(ATR_activates_TP53_activity, u'ATR', u'rule_has_subject') Annotation(ATR_activates_TP53_activity, u'TP53', u'rule_has_object') Annotation(TP53_activates_PPM1D_activity, u'TP53', u'rule_has_subject') Annotation(TP53_activates_PPM1D_activity, u'PPM1D', u'rule_has_object')
MEK(meki=1, phospho='p') % MEKi(mek=1), ep_MEKphosphop_MEKi_Gf) EnergyPattern('ep_SOS1S1134p_GRB2_single', GRB2(SH3=1) % SOS1(S1134='p', SH3=1), ep_SOS1S1134p_GRB2_Gf) Initial(RAFi(raf=None), initRAFi, fixed=True) Initial(MEKi(mek=None), initMEKi, fixed=True) Initial(EGF(rtk=None), initEGF, fixed=True) Initial(BRAF(AA600='E', RBD=None, mek=None, raf=None, rafi=None), initBRAF) Initial(CRAF(RBD=None, mek=None, raf=None, rafi=None), initCRAF) Initial(RAS(raf=None, sos1=None, state='gdp'), initRAS) Initial(MEK(Dsite=None, meki=None, phospho='u', raf=None), initMEK) Initial(ERK(CD=None, phospho='u'), initERK) Initial(GRB2(SH2=None, SH3=None), initGRB2) Initial(SOS1(S1134='u', SH3=None, ras=None), initSOS1) Annotation(RAFi, 'http://identifiers.org/chebi/63637', 'is') Annotation(MEKi, 'http://identifiers.org/chebi/90851', 'is') Annotation(EGF, 'http://identifiers.org/uniprot/P01133', 'is') Annotation(EGFR, 'http://identifiers.org/uniprot/P00533', 'is') Annotation(GRB2, 'http://identifiers.org/uniprot/P62993', 'is') Annotation(SOS1, 'http://identifiers.org/uniprot/Q07889', 'is') Annotation(RAS, 'http://identifiers.org/uniprot/P01111', 'is') Annotation(RAS, 'http://identifiers.org/uniprot/P01116', 'is') Annotation(RAS, 'http://identifiers.org/uniprot/P01112', 'is') Annotation(EGF_and_EGFR_bind_and_dissociate, 'http://identifiers.org/pubmed/16946702', 'isDescribedBy') Annotation(EGFR_and_EGFR_bind_and_dissociate, 'http://identifiers.org/pubmed/16946702', 'isDescribedBy') Annotation(transactivated_EGFR_dimers_bind_GRB2, 'http://identifiers.org/pubmed/16777603', 'isDescribedBy') Annotation(GRB2_and_SOS1_bind_and_dissociate,
Rule(u'MDM2_degraded', MDM2() >> None, kf_m_deg_1) Rule(u'TP53_ub_degraded', TP53(ub=(u'y', WILD)) >> None, kf_t_deg_1) Rule(u'TP53_synthesized', None >> TP53(ub=u'n', activity=u'inactive'), kf_t_synth_1) Rule(u'TP53_synthesizes_MDM2', TP53(activity=u'active') >> MDM2() + TP53(activity=u'active'), kf_tm_synth_1) Initial(HIPK2(), HIPK2_0) Initial(MDM2(), MDM2_0) Initial(ATM(phospho=u'u'), ATM_0) Initial(TP53(ub=u'n', activity=u'inactive'), TP53_0) Initial(PPM1D(activity=u'inactive'), PPM1D_0) Initial(ATM(phospho=u'p'), ATMa_0) Annotation(HIPK2, u'http://identifiers.org/uniprot/Q9H2X6', u'is') Annotation(HIPK2, u'http://identifiers.org/hgnc/HGNC:14402', u'is') Annotation(MDM2, u'http://identifiers.org/uniprot/Q00987', u'is') Annotation(MDM2, u'http://identifiers.org/hgnc/HGNC:6973', u'is') Annotation(ATM, u'http://identifiers.org/uniprot/Q13315', u'is') Annotation(ATM, u'http://identifiers.org/hgnc/HGNC:795', u'is') Annotation(TP53, u'http://identifiers.org/hgnc/HGNC:11998', u'is') Annotation(TP53, u'http://identifiers.org/uniprot/P04637', u'is') Annotation(PPM1D, u'http://identifiers.org/hgnc/HGNC:9277', u'is') Annotation(PPM1D, u'http://identifiers.org/uniprot/O15297', u'is') Annotation(ATM_phosphorylation_ATM_phospho, u'ATM', u'rule_has_subject') Annotation(ATM_phosphorylation_ATM_phospho, u'ATM', u'rule_has_object') Annotation(PPM1D_dephosphorylation_ATM_phospho, u'PPM1D', u'rule_has_subject') Annotation(PPM1D_dephosphorylation_ATM_phospho, u'ATM', u'rule_has_object') Annotation(MDM2_ubiquitination_TP53_ub, u'MDM2', u'rule_has_subject') Annotation(MDM2_ubiquitination_TP53_ub, u'TP53', u'rule_has_object')