Accessing state variables of one mechanisn in another mechanism

NMODL and the Channel Builder.
Post Reply
bdut
Posts: 10
Joined: Thu Sep 05, 2019 11:53 am

Accessing state variables of one mechanisn in another mechanism

Post by bdut »

I have a mechanism that has a state variable cAMP. Is it possible to access this state variable in another mechanism (.mod file)? The second mechanism has a state variable depending on cAMP.

Thanks
ted
Site Admin
Posts: 6287
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Accessing state variables of one mechanisn in another mechanism

Post by ted »

One way would be to make the dependent mechanisms' cAMP variables be POINTERs. Read about setpointer in the Programmer's Reference. For an example, see caL.mod and kir2.mod in ModelDB entry 39949. These mechanisms specify ion channels whose properties are modulated by a second messenger, the concentration of which is perturbed by synaptic activation of a particular dopamine receptor. damsg.mod describes the properties of the DAsyn class, each instance of which has its own state variable msg. caL.mod and kir2.mod are density mechanisms that have a POINTER variable called mu, which is linked to a DAsyn instance's msg by a setpointer statement.

If your model has significant spatial extent, you will need to make sure that spatial discretization is adequate (do you have any idea of how far or fast a perturbation of cAMP spreads?) and that each instance of the dependent mechanism(s) is coupled to the anatomically corresponding cAMP variable. This will involve running tests on simplified models.
bdut
Posts: 10
Joined: Thu Sep 05, 2019 11:53 am

Re: Accessing state variables of one mechanisn in another mechanism

Post by bdut »

Thank you for the details, Ted. I have gone through the modeldb entry you indicated, But, this code has a POINT PROCESS which is accessed by 2 .mod files. Is there a way to interact between the 2 mechanisms directly, without the POINT PROCESS?

Thanks and regards
ted
Site Admin
Posts: 6287
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Accessing state variables of one mechanisn in another mechanism

Post by ted »

The example is to be read as an illustration of the use of pointers to link variables in different mechanisms. Period. There's nothing about pointers that requires that any point processes be involved at all. If mechanism B has some variable y whose value is actually computed in mechanism A, then revise mechanism B so that y is declared to be a POINTER. In your model setup code, make sure that setpointer statements couple the the correct instances of B's y to the corresponding instances of A's y. Keep in mind the facts that
  • STATE variables are automatically RANGE
  • a PARAMETER is automatically GLOBAL unless it is declared to be RANGE
  • an ASSIGNED variable must be declared RANGE or GLOBAL in order to be visible to hoc or Python
bdut
Posts: 10
Joined: Thu Sep 05, 2019 11:53 am

Re: Accessing state variables of one mechanisn in another mechanism

Post by bdut »

Thank you Ted for the detailed reply. It really helped.
Post Reply