Skip to content

Functions on right hand side #203

@arazi2

Description

@arazi2

Hi
I just have a quick request to include a new functionality to the rulebender package.
Currently, in bngl files, we can have local function references only to the left hand side of a reaction and it would be great if we could add functions to the right hand side. It is very essential for our development. We are currently working to apply the required changes to the simulators, and my request is only to include this change in converting bngl file to xml file. I really appreciate it.

The following is an example:
Case 1:
XWBindCond1: %u:X(w,pUnphos) + W(x) -> X(w!1,pUnphos).W(x!1) kXWOn1*f_molYexist(u)

Case 2:
XWBindCond2: X(w,pUnphos) + W(x) -> %u:X(w!1,pUnphos).W(x!1) kXWOn1*f_molYexist(u)

Case 1 results in the following xml block

  <ReactionRule id="RR4" name="XWBindCond1" symmetry_factor="1">
    <ListOfReactantPatterns>
      <ReactantPattern id="RR4_RP1" label="u">
        <ListOfMolecules>
          <Molecule id="RR4_RP1_M1" name="X">
            <ListOfComponents>
              <Component id="RR4_RP1_M1_C1" name="w" numberOfBonds="0"/>
              <Component id="RR4_RP1_M1_C2" name="p" state="Unphos" numberOfBonds="0"/>
            </ListOfComponents>
          </Molecule>
        </ListOfMolecules>
      </ReactantPattern>
      <ReactantPattern id="RR4_RP2">
        <ListOfMolecules>
          <Molecule id="RR4_RP2_M1" name="W">
            <ListOfComponents>
              <Component id="RR4_RP2_M1_C1" name="x" numberOfBonds="0"/>
            </ListOfComponents>
          </Molecule>
        </ListOfMolecules>
      </ReactantPattern>
    </ListOfReactantPatterns>
    <ListOfProductPatterns>
      <ProductPattern id="RR4_PP1">
        <ListOfMolecules>
          <Molecule id="RR4_PP1_M1" name="X">
            <ListOfComponents>
              <Component id="RR4_PP1_M1_C1" name="w" numberOfBonds="1"/>
              <Component id="RR4_PP1_M1_C2" name="p" state="Unphos" numberOfBonds="0"/>
            </ListOfComponents>
          </Molecule>
          <Molecule id="RR4_PP1_M2" name="W">
            <ListOfComponents>
              <Component id="RR4_PP1_M2_C1" name="x" numberOfBonds="1"/>
            </ListOfComponents>
          </Molecule>
        </ListOfMolecules>
        <ListOfBonds>
          <Bond id="RR4_PP1_B1" site1="RR4_PP1_M1_C1" site2="RR4_PP1_M2_C1"/>
        </ListOfBonds>
      </ProductPattern>
    </ListOfProductPatterns>
    <RateLaw id="RR4_RateLaw" type="Function" name="_rateLaw1" totalrate="0">
      <ListOfArguments>
        <Argument id="u" type="ObjectReference" value="RR4_RP1"/>
      </ListOfArguments>
    </RateLaw>
    <Map>
      <MapItem sourceID="RR4_RP1_M1" targetID="RR4_PP1_M1"/>
      <MapItem sourceID="RR4_RP1_M1_C1" targetID="RR4_PP1_M1_C1"/>
      <MapItem sourceID="RR4_RP1_M1_C2" targetID="RR4_PP1_M1_C2"/>
      <MapItem sourceID="RR4_RP2_M1" targetID="RR4_PP1_M2"/>
      <MapItem sourceID="RR4_RP2_M1_C1" targetID="RR4_PP1_M2_C1"/>
    </Map>
    <ListOfOperations>
      <AddBond site1="RR4_RP1_M1_C1" site2="RR4_RP2_M1_C1"/>
    </ListOfOperations>
  </ReactionRule>

where the Case 2 is not accepted. I manually edited the xml file as follows:

  <ReactionRule id="RR4" name="XWBindCond2" symmetry_factor="1">
    <ListOfReactantPatterns>
      <ReactantPattern id="RR4_RP1">
        <ListOfMolecules>
          <Molecule id="RR4_RP1_M1" name="X">
            <ListOfComponents>
              <Component id="RR4_RP1_M1_C1" name="w" numberOfBonds="0"/>
              <Component id="RR4_RP1_M1_C2" name="p" state="Unphos" numberOfBonds="0"/>
            </ListOfComponents>
          </Molecule>
        </ListOfMolecules>
      </ReactantPattern>
      <ReactantPattern id="RR4_RP2">
        <ListOfMolecules>
          <Molecule id="RR4_RP2_M1" name="W">
            <ListOfComponents>
              <Component id="RR4_RP2_M1_C1" name="x" numberOfBonds="0"/>
            </ListOfComponents>
          </Molecule>
        </ListOfMolecules>
      </ReactantPattern>
    </ListOfReactantPatterns>
    <ListOfProductPatterns>
      <ProductPattern id="RR4_PP1" label="u">
        <ListOfMolecules>
          <Molecule id="RR4_PP1_M1" name="X" >
            <ListOfComponents>
              <Component id="RR4_PP1_M1_C1" name="w" numberOfBonds="1"/>
              <Component id="RR4_PP1_M1_C2" name="p" state="Unphos" numberOfBonds="0"/>
            </ListOfComponents>
          </Molecule>
          <Molecule id="RR4_PP1_M2" name="W">
            <ListOfComponents>
              <Component id="RR4_PP1_M2_C1" name="x" numberOfBonds="1"/>
            </ListOfComponents>
          </Molecule>
        </ListOfMolecules>
        <ListOfBonds>
          <Bond id="RR4_PP1_B1" site1="RR4_PP1_M1_C1" site2="RR4_PP1_M2_C1"/>
        </ListOfBonds>
      </ProductPattern>
    </ListOfProductPatterns>
    <RateLaw id="RR4_RateLaw" type="Function" name="_rateLaw1" totalrate="0">
      <ListOfArguments>
        <Argument id="u" type="ObjectReference" value="RR4_PP1"/>
      </ListOfArguments>
    </RateLaw>
    <Map>
      <MapItem sourceID="RR4_RP1_M1" targetID="RR4_PP1_M1"/>
      <MapItem sourceID="RR4_RP1_M1_C1" targetID="RR4_PP1_M1_C1"/>
      <MapItem sourceID="RR4_RP1_M1_C2" targetID="RR4_PP1_M1_C2"/>
      <MapItem sourceID="RR4_RP2_M1" targetID="RR4_PP1_M2"/>
      <MapItem sourceID="RR4_RP2_M1_C1" targetID="RR4_PP1_M2_C1"/>
    </Map>
    <ListOfOperations>
      <AddBond site1="RR4_RP1_M1_C1" site2="RR4_RP2_M1_C1"/>
    </ListOfOperations>
  </ReactionRule>

The only differences are

  • to move ( label="u") from the reactant pattern RR4_RP1 to the product pattern RR4_PP1
    -to change to

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions