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

Handling of reversible reaction across compartments #232

Open
dweindl opened this issue Jul 22, 2021 · 6 comments
Open

Handling of reversible reaction across compartments #232

dweindl opened this issue Jul 22, 2021 · 6 comments

Comments

@dweindl
Copy link

dweindl commented Jul 22, 2021

Hi, I am having trouble understanding how BioNetGen processes the following model:

model.bngl

begin model
begin parameters
  k1                 2
  k2                 3
end parameters

begin compartments
  C1  3  1
  C2  2  1  C1
  C3  3  1  C2
end compartments

begin molecule types
  A()
  C()
  B()
end molecule types

begin species
  A()@C1             1
  B()@C3             1
  C()@C3             1
end species

begin reaction rules
  R1: A()@C1 + B()@C3 <-> C()@C3   k1,k2
end reaction rules

end model

generate_network({overwrite=>1});

net file generated from BioNetGen2.6.0:

# Created by BioNetGen 2.6.0
begin parameters
    1 k1  2  # Constant
    2 k2  3  # Constant
end parameters
begin species
    1 @C1::A() 1
    2 @C3::B() 1
    3 @C3::C() 1
end species
begin reactions
    1 3 1,2 k2 #_reverse_R1
end reactions

I would have expected to see both the forward and reverse reaction instead of only the reverse reaction, i.e.:

begin reactions
    1 1,2 3 k1
    2 3 1,2 k2 #_reverse_R1
end reactions

Is this intended behaviour? Am I overlooking something? Thanks for your help.

@ASinanSaglam
Copy link
Collaborator

Molecules in two separate 3D containers can't bind (one is in C1 and the other is in C3), that's expected behavior. These types of reactions are generally done by first doing a compartment transfer on either of the molecules and then binding within the same compartment.

@dweindl
Copy link
Author

dweindl commented Jul 22, 2021

Thanks. That explains why the forward reaction is not considered.
I still don't quite get why the reverse reaction works then.
"Un-binding" across two 3D compartments is okay? Feels somewhat counter-intuitive.

@wshlavacek
Copy link

wshlavacek commented Jul 22, 2021 via email

@jrfaeder
Copy link
Contributor

Formally, BNG uses only the reactant properties to determine whether a reaction can take place. Here, the criteria are that for a bimolecular reaction to take place the reactants must be in adjacent compartments, as Sinan has described above. For the reverse reaction, the reactant pattern requires only that the reactant species be in C3. Once that criterion is satisfied, the product species can be located anywhere, which enables transport across the compartmental hierarchy. Care should be exercised in using such rules in models because they clearly represent a non-elementary process, but it can at least be rationalized in some cases.

@dweindl
Copy link
Author

dweindl commented Jul 22, 2021

Thanks @jrfaeder, that clarifies it.
It would be super helpful if some kind of warning was emitted if impossible reactions are specified in a model.

@jrfaeder
Copy link
Contributor

Interestingly, if the compartmental location of B is changed from C2 to C3, then both the forward and reverse reactions are generated, which is perhaps the originally expected behavior. In this case for the forward reaction, A and B are in adjacent compartments, so the reaction is allowed. As I think about this, I realize that in the original model the rule as written would never occur, so it would be appropriate and helpful to BNG to send a warning. We will look into that.

begin model
begin parameters
  k1                 2
  k2                 3
end parameters

begin compartments
  C1  3  1
  C2  2  1  C1
  C3  3  1  C2
end compartments

begin molecule types
  A()
  C()
  B()
end molecule types

begin species
  A()@C1             1
  B()@C2             1
  C()@C3             1
end species

begin reaction rules
  R1: A()@C1 + B()@C2 <-> C()@C3   k1,k2
end reaction rules

end model

generate_network({overwrite=>1})

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

4 participants