RuleWorld / rulebender

Rule-Based Modeling and Simulation Gui
http://bionetgen.org
12 stars 7 forks source link

Contact map failure when rules contain multiple instances of molecules (see Issue 195) #202

Closed rhclark closed 6 years ago

rhclark commented 7 years ago

John Sekar sent in a .bngl file that is remarkably similar to fceri.bngl but has some subtle differences in the component binding sites and phosphorylation sites of one of the molecules. This molecule also occurs twice on both the right and left hand side of certain rules, and all this together creates a scenario that RuleBender cannot handle. The .bngl file is below:

# Author: John Sekar Jun 2, 2016
# Smaller refined version of fceri_ji.bngl minus Syk

begin model
begin molecule types
    Lig(fc,fc)
    Rec(alpha,beta~0~P)
    Lyn(U,SH2)
end molecule types

begin parameters
    Lig_tot  6.0e3  # units: molecules
    Rec_tot  4.0e2  # units: molecules
    Lyn_tot  2.8e1  # units: molecules

     kp1  1.32845238e-7  # units: /molecule/s
     km1  0              # units: /s
     kp2  2.5e-1         # units: /molecule/s
     km2  0              # units: /s
     kpL  5e-2           # units: /molecule/s
     kmL  20             # units: /s
    kpLs  5e-2           # units: /molecule/s
    kmLs  0.12           # units: /s
     pLb  30             # units: /s
    pLbs  100            # units: /s
      dm   20            # units: /s 
end parameters

begin seed species
    Lig(fc,fc)        Lig_tot
    Lyn(U,SH2)        Lyn_tot
    Rec(alpha,beta~0) Rec_tot
end seed species

begin reaction rules
    # Ligand-receptor binding      
    R1: Rec(alpha) + Lig(fc,fc) <-> Rec(alpha!1).Lig(fc!1,fc)  kp1, km1

    # Receptor-aggregation
    R2: Rec(alpha) + Lig(fc,fc!+) <-> Rec(alpha!2).Lig(fc!2,fc!+)  kp2, km2

    # Constitutive Lyn-receptor binding
    R3: Rec(beta~0) + Lyn(U,SH2) <-> Rec(beta~0!1).Lyn(U!1,SH2)  kpL, kmL

    # Transphosphorylation of beta by constitutive Lyn
    R4: Lyn(SH2,U!1).Lig(fc!2,fc!3).Rec(alpha!2,beta!1).Rec(alpha!3,beta~0) -> Lyn(SH2,U!1).Lig(fc!2,fc!3).Rec(alpha!2,beta!1).Rec(alpha!3,beta~P) pLb

    # Lyn-receptor binding through SH2 domain
    R6: Rec(beta~P) + Lyn(U,SH2) <-> Rec(beta~P!1).Lyn(U,SH2!1)  kpLs, kmLs

    # Transphosphorylation of beta by SH2-bound Lyn
    R7: Lyn(SH2!1).Rec(beta!1,alpha!2).Lig(fc!2,fc!3).Rec(alpha!3,beta~0) -> Lyn(SH2!1).Rec(beta!1,alpha!2).Lig(fc!2,fc!3).Rec(alpha!3,beta~P)  pLbs

    # Dephosphorylation of Rec beta
    R14: Rec(beta~P) -> Rec(beta~0)  dm

end reaction rules

end model

## actions ##
#visualize({type=>"conventional","each"=>1})
#visualize({type=>"compact","each"=>1})
#visualize({type=>"regulatory",background=>1,each=>1})
#visualize({type=>"regulatory",background=>1})
#visualize({type=>"regulatory",background=>1,textonly=>1})
#visualize({type=>"regulatory",opts=>"..\..\..\opts.txt"})
#visualize({type=>"regulatory",opts=>"..\..\..\opts.txt",groups=>1})
#visualize({type=>"regulatory",opts=>"..\..\..\opts.txt",groups=>1,collapse=>1})
rhclark commented 7 years ago

Comment by rhclark: I see what you mean by adding component states for Issue 202, and I also see that the Molecule Types section shows that the beta component is supposed to have states. I suppose the right way to handle this issue would be to put out a message warning the user that they failed to specify a state for beta. I'm not sure, though, how much work that would be.

rhclark commented 7 years ago

Comment by jrfaeder:

t’s allowed not to refer to the component states, so there doesn’t need to be a warning. I’m guessing that the contact map in rulebender doesn’t handle that case though.

jrfaeder commented 6 years ago

seems to be fixed in version 2.2.1