Skip to content

Commit

Permalink
Modified ring models
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfaeder committed Feb 1, 2024
1 parent 1c0463c commit 29314bb
Show file tree
Hide file tree
Showing 11 changed files with 458 additions and 61 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file added Issues/.DS_Store
Binary file not shown.
20 changes: 9 additions & 11 deletions Issues/ringOpening_pawel/xyz_04.bngl
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ begin observables
end observables

begin functions
# f(xy) if(boundZ(xy)>0,1,0)
f(xy) boundZ(xy)
f(xy) if(boundZ(xy)==0,1,0)
end functions

begin reaction rules
Expand All @@ -37,17 +36,16 @@ begin reaction rules
# Here, the label xy is used to provide a pointer to the reactant complex that
# is passed to the local function f, which in turn passes it to the observable
# function boundZ. This observable counts the number of doubly bound Z molecules
# in the complex. Two versions of the function are provided. The first uses an
# if statement to set the rate to 1 if boundZ is present and 0 otherwise. The
# second sets the rate to be the number returned by boundZ. Note that the two
# functions would be equivalent if the boundZ observable were converted to a
# Species type instead of a Molecules type.
nonrestrictive: %xy::X(y!1).Y(x!1) -> %xy::X(y,z) + Y(x,z) f(xy)
# in the complex. The rate is set to 1 only if boundZ is 0; otherwise the rate
# is 0. Note that the network generated by generate_network will automatically
# exclude dissociation of the XYZ complex as described int xyz_01.bngl (because
# the product stoichiometry is not matched).
nonrestrictive: %xy::X(y!1).Y(x!1) -> %xy::X(y) + Y(x) f(xy)

end reaction rules

end model

generate_network({overwrite=>1})
writeSBML()
#simulate({method=>"nf",t_end=>10,n_steps=>10})
#generate_network({overwrite=>1})
#writeSBML()
simulate({method=>"nf",t_end=>10,n_steps=>10})
5 changes: 5 additions & 0 deletions Issues/ringOpening_pawel/xyz_04.species
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# nfsim generated species list for system: 'xyz_04'
# warning! this feature is not yet fully tested!
X(y!1,z!2).Y(x!1,z!3).Z(x!2,y!3) 1
X(y,z) 1
Y(x,z) 1
194 changes: 194 additions & 0 deletions Issues/ringOpening_pawel/xyz_04.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created by BioNetGen 2.9.0 -->
<sbml xmlns="http://www.sbml.org/sbml/level3" level="3" version="1">
<model id="xyz_04">
<ListOfParameters>
</ListOfParameters>
<ListOfMoleculeTypes>
<MoleculeType id="X">
<ListOfComponentTypes>
<ComponentType id="y"/>
<ComponentType id="z"/>
</ListOfComponentTypes>
</MoleculeType>
<MoleculeType id="Y">
<ListOfComponentTypes>
<ComponentType id="x"/>
<ComponentType id="z"/>
</ListOfComponentTypes>
</MoleculeType>
<MoleculeType id="Z">
<ListOfComponentTypes>
<ComponentType id="x"/>
<ComponentType id="y"/>
</ListOfComponentTypes>
</MoleculeType>
</ListOfMoleculeTypes>
<ListOfCompartments>
</ListOfCompartments>
<ListOfSpecies>
<Species id="S1" concentration="1" name="X(y!1,z!2).Y(x!1,z!3).Z(x!2,y!3)">
<ListOfMolecules>
<Molecule id="S1_M1" name="X">
<ListOfComponents>
<Component id="S1_M1_C1" name="y" numberOfBonds="1"/>
<Component id="S1_M1_C2" name="z" numberOfBonds="1"/>
</ListOfComponents>
</Molecule>
<Molecule id="S1_M2" name="Y">
<ListOfComponents>
<Component id="S1_M2_C1" name="x" numberOfBonds="1"/>
<Component id="S1_M2_C2" name="z" numberOfBonds="1"/>
</ListOfComponents>
</Molecule>
<Molecule id="S1_M3" name="Z">
<ListOfComponents>
<Component id="S1_M3_C1" name="x" numberOfBonds="1"/>
<Component id="S1_M3_C2" name="y" numberOfBonds="1"/>
</ListOfComponents>
</Molecule>
</ListOfMolecules>
<ListOfBonds>
<Bond id="S1_B1" site1="S1_M1_C1" site2="S1_M2_C1"/>
<Bond id="S1_B2" site1="S1_M1_C2" site2="S1_M3_C1"/>
<Bond id="S1_B3" site1="S1_M2_C2" site2="S1_M3_C2"/>
</ListOfBonds>
</Species>
<Species id="S2" concentration="1" name="X(y!1,z).Y(x!1,z)">
<ListOfMolecules>
<Molecule id="S2_M1" name="X">
<ListOfComponents>
<Component id="S2_M1_C1" name="y" numberOfBonds="1"/>
<Component id="S2_M1_C2" name="z" numberOfBonds="0"/>
</ListOfComponents>
</Molecule>
<Molecule id="S2_M2" name="Y">
<ListOfComponents>
<Component id="S2_M2_C1" name="x" numberOfBonds="1"/>
<Component id="S2_M2_C2" name="z" numberOfBonds="0"/>
</ListOfComponents>
</Molecule>
</ListOfMolecules>
<ListOfBonds>
<Bond id="S2_B1" site1="S2_M1_C1" site2="S2_M2_C1"/>
</ListOfBonds>
</Species>
</ListOfSpecies>
<ListOfReactionRules>
<ReactionRule id="RR1" name="nonrestrictive" symmetry_factor="1">
<ListOfReactantPatterns>
<ReactantPattern id="RR1_RP1" label="xy">
<ListOfMolecules>
<Molecule id="RR1_RP1_M1" name="X">
<ListOfComponents>
<Component id="RR1_RP1_M1_C1" name="y" numberOfBonds="1"/>
</ListOfComponents>
</Molecule>
<Molecule id="RR1_RP1_M2" name="Y">
<ListOfComponents>
<Component id="RR1_RP1_M2_C1" name="x" numberOfBonds="1"/>
</ListOfComponents>
</Molecule>
</ListOfMolecules>
<ListOfBonds>
<Bond id="RR1_RP1_B1" site1="RR1_RP1_M1_C1" site2="RR1_RP1_M2_C1"/>
</ListOfBonds>
</ReactantPattern>
</ListOfReactantPatterns>
<ListOfProductPatterns>
<ProductPattern id="RR1_PP1" label="xy">
<ListOfMolecules>
<Molecule id="RR1_PP1_M1" name="X">
<ListOfComponents>
<Component id="RR1_PP1_M1_C1" name="y" numberOfBonds="0"/>
</ListOfComponents>
</Molecule>
</ListOfMolecules>
</ProductPattern>
<ProductPattern id="RR1_PP2">
<ListOfMolecules>
<Molecule id="RR1_PP2_M1" name="Y">
<ListOfComponents>
<Component id="RR1_PP2_M1_C1" name="x" numberOfBonds="0"/>
</ListOfComponents>
</Molecule>
</ListOfMolecules>
</ProductPattern>
</ListOfProductPatterns>
<RateLaw id="RR1_RateLaw" type="Function" name="_rateLaw1" totalrate="0">
<ListOfArguments>
<Argument id="xy" type="ObjectReference" value="RR1_RP1"/>
</ListOfArguments>
</RateLaw>
<Map>
<MapItem sourceID="RR1_RP1_M1" targetID="RR1_PP1_M1"/>
<MapItem sourceID="RR1_RP1_M1_C1" targetID="RR1_PP1_M1_C1"/>
<MapItem sourceID="RR1_RP1_M2" targetID="RR1_PP2_M1"/>
<MapItem sourceID="RR1_RP1_M2_C1" targetID="RR1_PP2_M1_C1"/>
</Map>
<ListOfOperations>
<DeleteBond site1="RR1_RP1_M1_C1" site2="RR1_RP1_M2_C1"/>
</ListOfOperations>
</ReactionRule>
</ListOfReactionRules>
<ListOfObservables>
<Observable id="O1" name="XY" type="Molecules">
<ListOfPatterns>
<Pattern id="O1_P1">
<ListOfMolecules>
<Molecule id="O1_P1_M1" name="X">
<ListOfComponents>
<Component id="O1_P1_M1_C1" name="y" numberOfBonds="1"/>
</ListOfComponents>
</Molecule>
<Molecule id="O1_P1_M2" name="Y">
<ListOfComponents>
<Component id="O1_P1_M2_C1" name="x" numberOfBonds="1"/>
</ListOfComponents>
</Molecule>
</ListOfMolecules>
<ListOfBonds>
<Bond id="O1_P1_B1" site1="O1_P1_M1_C1" site2="O1_P1_M2_C1"/>
</ListOfBonds>
</Pattern>
</ListOfPatterns>
</Observable>
<Observable id="O2" name="boundZ" type="Molecules">
<ListOfPatterns>
<Pattern id="O2_P1">
<ListOfMolecules>
<Molecule id="O2_P1_M1" name="Z">
<ListOfComponents>
<Component id="O2_P1_M1_C1" name="x" numberOfBonds="+"/>
<Component id="O2_P1_M1_C2" name="y" numberOfBonds="+"/>
</ListOfComponents>
</Molecule>
</ListOfMolecules>
</Pattern>
</ListOfPatterns>
</Observable>
</ListOfObservables>
<ListOfFunctions>
<Function id="f">
<ListOfArguments>
<Argument id="xy"/>
</ListOfArguments>
<ListOfReferences>
<Reference name="xy" type="Local"/>
<Reference name="boundZ" type="Observable"/>
</ListOfReferences>
<Expression> if((boundZ(xy)==0),1,0) </Expression>
</Function>
<Function id="_rateLaw1">
<ListOfArguments>
<Argument id="xy"/>
</ListOfArguments>
<ListOfReferences>
<Reference name="f" type="Function"/>
<Reference name="xy" type="Local"/>
</ListOfReferences>
<Expression> f(xy) </Expression>
</Function>
</ListOfFunctions>
</model>
</sbml>
21 changes: 1 addition & 20 deletions Issues/ringOpening_pawel/xyz_04_sbml.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
<listOfParameters>
<!-- Independent variables -->
<parameter id="_nonrestrictive_local1" value="1"/>
<parameter id="_nonrestrictive_local2" value="0"/>
<!-- Observables -->
<parameter id="XY" constant="false"/>
<parameter id="boundZ" constant="false"/>
Expand Down Expand Up @@ -54,24 +53,6 @@
</listOfRules>
<listOfReactions>
<reaction id="R1" reversible="false">
<listOfReactants>
<speciesReference species="S1"/>
</listOfReactants>
<listOfProducts>
<speciesReference species="S3"/>
<speciesReference species="S4"/>
</listOfProducts>
<kineticLaw>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply>
<times/>
<ci> _nonrestrictive_local1 </ci>
<ci> S1 </ci>
</apply>
</math>
</kineticLaw>
</reaction>
<reaction id="R2" reversible="false">
<listOfReactants>
<speciesReference species="S2"/>
</listOfReactants>
Expand All @@ -83,7 +64,7 @@
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply>
<times/>
<ci> _nonrestrictive_local2 </ci>
<ci> _nonrestrictive_local1 </ci>
<ci> S2 </ci>
</apply>
</math>
Expand Down
20 changes: 10 additions & 10 deletions Issues/ringOpening_pawel/xyz_04b.bngl
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ end species

begin observables
Molecules XY X(y!1).Y(x!1)
Species boundZ Z(x!+,y!+)
Molecules boundZ Z(x!+,y!+)
end observables

begin functions
# f(xy) if(boundZ(xy)>0,1,0)
f(xy) boundZ(xy)
# f(xy) if(boundZ(xy)==0,1,0)
f(xy) 1-boundZ(xy)
end functions

begin reaction rules
Expand All @@ -38,16 +38,16 @@ begin reaction rules
# is passed to the local function f, which in turn passes it to the observable
# function boundZ. This observable counts the number of doubly bound Z molecules
# in the complex. Two versions of the function are provided. The first uses an
# if statement to set the rate to 1 if boundZ is present and 0 otherwise. The
# second sets the rate to be the number returned by boundZ. Note that the two
# if statement to set the rate to 1 if boundZ is 0 and 0 otherwise. The
# second sets the rate to be 1 - number returned by boundZ. Note that the two
# functions would be equivalent if the boundZ observable were converted to a
# Species type instead of a Molecules type.
nonrestrictive: %xy::X(y!1).Y(x!1) -> %xy::X(y,z) + Y(x,z) f(xy)
# Species type instead of a Molecules type (except that this seems to break NFsim).
nonrestrictive: %xy::X(y!1).Y(x!1) -> %xy::X(y) + Y(x) f(xy)

end reaction rules

end model

generate_network({overwrite=>1})
writeSBML()
#simulate({method=>"nf",t_end=>10,n_steps=>10})
#generate_network({overwrite=>1})
#writeSBML()
simulate({method=>"nf",t_end=>10,n_steps=>10})
5 changes: 5 additions & 0 deletions Issues/ringOpening_pawel/xyz_04b.species
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# nfsim generated species list for system: 'xyz_04b'
# warning! this feature is not yet fully tested!
X(y!1,z!2).Y(x!1,z!3).Z(x!2,y!3) 1
X(y,z) 1
Y(x,z) 1
Loading

0 comments on commit 29314bb

Please sign in to comment.