Kappa-Dev / KAMI

Bio-curation library for modelling cellular signalling
MIT License
7 stars 0 forks source link

Tyrosine added even if already present with SH2 nugget #13

Closed slegare2 closed 6 years ago

slegare2 commented 6 years ago

In this example, I want to say that GRB2 binds residue Y1092 from EGFR. So I specify the residue in the interaction. But when I add the interactiont to the hierarchy, it adds an other tyrosine instead. Is there something wrong in how I write the interaction?

import json
import pickle
from kami.entities import (Gene, Region, Site, Residue, State, RegionActor, SiteActor)
from kami.interactions import (Binding, Modification)
from kami.hierarchy import (KamiHierarchy)
from kami.export.old_kami import get_studio_v1
from regraph import print_graph

b1 = Binding(
        left=SiteActor(gene=Gene(uniprotid="P00533",
                                 hgnc_symbol="EGFR"),
                       site=Site(name="pY",
                                 residues=[Residue(aa="Y", loc=1092)],
                                 start=1088, end=1096)),
        right=RegionActor(gene=Gene(uniprotid="P62993",
                                    hgnc_symbol="GRB2"),
                          region=Region(name="SH2"))
)

print(b1)

hierarchy = KamiHierarchy()
hierarchy.add_interaction(b1, anatomize=True)

print_graph(hierarchy.graph['action_graph'])
slegare2 commented 6 years ago

nvm, I saw I just need to put the State("phosphorylation")