-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Including global variables that participate in MassActionJumps in spatial systems #364
Comments
Say, you want a reaction that consumes species
And would would pass in a matrix for reaction rates, whose
To change the reaction from You might wonder how you can know what site has what index. If you are using a Hopefully, this helps. You might also want to look at the tests (e.g. this one), this tutorial and this comment |
This doesn't address my question. Perhaps I was unclear: I want to include a So, let me be clearer and describe species as I want to include reactions where Alternatively, I could solve this problem without adding this extra vertex if I could have a global variable that refers to the population of I don't know how I could solve this problem while also being able to use the specialised spatial solvers |
I don't think this can be done currently unfortunately, but @Vilin97 can hopefully better comment on this. Allowing such reactions is definitely on our TODO list, but I'm not sure we can say it will be available anytime soon. Basically we ultimately would like to allow
But I don't think any of these are supported currently. |
Non local reactions are not implemented and are not currently in the works AFAIK, although it is a long term TODO. But can this special case perhaps be done with a callback that triggers when B[i] -> C[i] fires and decrements A_pool by 1, @isaacsas ? |
How is the information in the change in the rate due to the change in the number of |
@Vilin97 I was thinking about non-local reactions. What do you think about formalizing our "update" API, and then making it available to users via affect functions. The idea being that they have to take responsibility for registering the "updates" they've made, and then we handle the efficient updating using that information inside the internal data structures? It seems like something like that might give the most flexibility in the types of reactions we can accept, since then users can tell us the updates that have been made (i.e. species and locations). |
@isaacsas, I missed your comment about the change in number of |
But the constant rate PR doesn't allow users to register where they are making updates right? It assumes they are made at a specific node only I thought? I was suggesting we consider/design a way to register that one has made updates of specific species at specific locations within an affect function (and use this ourselves in the solvers), and then we process this list automatically. This would allow a user to say that they've updated species 10 at location 1 and species 2 locations 10,15 for example, and we would know where our data structures need updating. It seems like this is a more general way to work towards allowing non-local reactions. With that said, I don't have a good feel if this can be done in a way that doesn't have a significant impact on speed. For @alexeychizh's problem, what would probably be the most efficient way to do it would be if he could have one constant rate jump for selecting the reaction across the whole domain, and an affect function he writes that samples the location of the reaction when it occurs somewhere (which would require access to our internal information probably, and a way to tell us where he is making updates). This would then only need to update the one "global" reaction, and the one site where the reaction occurs, within our data structures. I don't see how in our current constant rate setup we wouldn't require recalculating rates everywhere, since this reaction would have to be represented as |
Now I see what you are saying. After merging the three outstanding PRs let's think what the interface should look like and then I'll try implementing it. |
Sounds good. I'm working on Torkel's spatial PR again finally, hopefully we will merge it soon even it is not really in a good final form, and then I will circle back to your PRs. |
I have a grid (membrane) where species (molecules) can hop around, react, and interact/exchange with a global, well-mixed pool (cytoplasm). Species
A
,B
andC
can transition between the global pool and grid sites with ratesk_on
,k_off
.Suppose the mass-action reaction we consider is
A + B <--> C
. Alongside reactions betweenA
andB
molecules at specific grid sites, how can I include a MassActionJump that consumes, say, aB
in a specific grid site and anA
in the global pool (that is equally accessible to all the grid sites), to create +1C
in the grid site? Likewise, the reverse case, where a grid siteC
can dissociate to form a global poolA
and grid siteB
.Very similarly, I would like to include recruitment, where a global pool
A
can be recruited to a grid site at a rate proportional to the number ofA
at that site (or, from the perspective of the grid site,A --> 2A
at ratek_fb * A_pool
, whereA_pool
is the population ofA
in the pool, which is depleted by 1 with each recruitment).I would ideally like to do this with the existing spatial solvers.
The text was updated successfully, but these errors were encountered: