Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functions on right hand side #203

Open
arazi2 opened this issue May 22, 2017 · 2 comments
Open

Functions on right hand side #203

arazi2 opened this issue May 22, 2017 · 2 comments

Comments

@arazi2
Copy link

arazi2 commented May 22, 2017

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
@arazi2
Copy link
Author

arazi2 commented May 22, 2017

-to change Argument id="u" type="ObjectReference" value="RR4_RP1" to Argument id="u" type="ObjectReference" value="RR4_PP1"

@jrfaeder
Copy link
Contributor

Sorry for overlooking this comment until now. We will look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants