question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

State mapping in reaction rules?

See original GitHub issue

Hi, BNGL supports state mapping using “%” in reaction rules, e.g. A(a%x) -> B(a%x), to indicate that the state of A is transferred to B. I was wondering if there exists anything comparable in pysb? I see that it is straightforward to generate all the rules programmatically, but it would be convenient if that could be avoided.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
lh64commented, May 26, 2020

@FFroehlich The basic reason is that the syntax for molecule and complex tags isn’t consistent with the syntax for component state tags, that’s all. A tag is conceptually like a pointer to an object. They can be used to map reactants to products (needed for extracting base operations from the rules, e.g., bind, change state, etc.) and for defining the context for performing pattern matching in Observables. Observables produce numbers (the number of matches to a molecule or complex) but the tag itself is not a number.

In the state-mapping example, the tag in A(a%x) -> B(a%x) represents a number, which is the problem. We thought about modifying the syntax so the rule would look something like A(a~?%x) -> B(a~valueOf(x)), where %x would point to the state (as an object) of a and then a new builtin function (that we’d have to implement) valueOf would extract the value of the state from the tag x. But we never came to an agreement on exactly how to do this so it didn’t happen. For example, should we tag the state, like I did above, or the component, as in something like A(a%x) -> B(a~x.getState())?

Anyway, we threw around ideas like this for a while but nothing ever came of it. So the original state-mapping syntax is still in there if it’s useful but I’d be careful about using it because it could change at some point in a new BNG release.

0reactions
FFroehlichcommented, May 26, 2020

@lh64 Thank you for the detailed explanation, that definitely makes sense.

Read more comments on GitHub >

github_iconTop Results From Across the Web

12.3: The Connection between Reaction Mechanisms and ...
Analyzing a reaction mechanism to determine the type of rate law that is ... order in A (in the limit that the steady...
Read more >
Calculation of reaction rules for EC 2.6.1.5. (A) The atom ...
(A) The atom mapping highlights reacting atoms labelled 8, 11, 16 and 19. (B) Calculation of the EC 2.6.1.5 rules for diameters D...
Read more >
Reaction Maps Now Available - Master Organic Chemistry
Reaction Map PDF from Master Organic Chemistry (MOC) has 29 "maps" of the reactions of functional groups including over 100 reactions.
Read more >
Automatic Determination of Reaction Mappings and Reaction ...
The complete mapping for each atom of the reactants to an atom of the products of a given reaction is called the atomic...
Read more >
Extraction of organic chemistry grammar from unsupervised ...
During the last few hundred years, chemists compiled the language of chemical synthesis inferring a series of “reaction rules” from knowing how atoms...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found