def load(self, secs, dx_3d_size, rxds=None): """ Must be called after all secs are set. :param secs: :param dx_3d_size: If 3D geometry is True, define the size of the single compartment size. :param rxds: dictionary which contains previously added RxDTool objects """ rxdca = rxds['RxDCa'] # PMCA Pump self.pmca = rxd.Species(regions=rxdca.cyt, initial=760 * nM, name='pmca', charge=0, d=0) self.pmca_ca = rxd.Species(regions=rxdca.cyt, initial=120 * nM, name='pmca_ca', charge=0, d=0) self.pmca_ca_reaction = rxd.Reaction(rxdca.ca + self.pmca, self.pmca_ca, 0.05e-3 / (nM * ms), 9e-3 / (nM * ms)) self.pmca_ca__pmca_reaction = rxd.Reaction(self.pmca_ca, self.pmca, 3.0e-3 / (nM * ms), 0) # CaOut
def load(self, secs, dx_3d_size, rxds=None): """ Must be called after all secs are set. :param secs: List of sections (real HOC objects) :param dx_3d_size: If 3D geometry is True, define the size of the single compartment size. :param rxds: dictionary which contains previously added RxDTool objects """ self.cyt = rxd.Region(secs=secs, nrn_region='i', dx=dx_3d_size) # 1/nM = 1 × 1/10^-9M = 10^3/10^3 × 1/10^-9M = 1000/(10^3×10^-9M) = 1000/10^-6M = 1000/uM # Ca2+ self.ca = rxd.Species(regions=self.cyt, initial=75 * nM, name='ca', charge=2, d=174.3 / sec) # Calbindin buffer self.calbindin = rxd.Species(regions=self.cyt, initial=159982 * nM, name='calbindin', charge=0, d=9.3 / sec) self.calbindin_ca = rxd.Species(regions=self.cyt, initial=18 * nM, name='calbindin_ca', charge=0, d=9.3 / sec) self.calbindin_ca_reaction = rxd.Reaction(self.ca + self.calbindin, self.calbindin_ca, 0.028e-3 / (nM * ms), 19.6 / (nM * ms)) # Calmodulin buffer self.calmodulin = rxd.Species(regions=self.cyt, initial=12600 * nM, name='calmodulin', charge=0, d=4 / sec) self.calmodulin_ca2 = rxd.Species(regions=self.cyt, initial=200 * nM, name='calmodulin_ca2', charge=0, d=4 / sec) self.calmodulin_ca4 = rxd.Species(regions=self.cyt, initial=3 * nM, name='calmodulin_ca4', charge=0, d=4 / sec) self.calmodulin_ca2_reaction = rxd.Reaction( 2 * self.ca + self.calmodulin, self.calmodulin_ca2, 6e-6 / (nM * ms), 9.1e-3 / (nM * ms)) self.calmodulin_ca4_reaction = rxd.Reaction( 2 * self.ca + self.calmodulin_ca2, self.calmodulin_ca4, 0.1e-3 / (nM * ms), 1000e-3 / (nM * ms))
c.soma_caer = Vector(tstop / h.dt) c.soma_caer.record(ca[er].nodes(c.soma)(0.5)[0]._ref_concentration) c.Adend3_caer = Vector(tstop / h.dt) c.Adend3_caer.record(ca[er].nodes(c.Adend3)(0.5)[0]._ref_concentration) CB_init = dconf["CB_init"] CB_frate = dconf["CB_frate"] CB_brate = dconf["CB_brate"] CBDiff = 0.043 # um^2 / msec CB = rxd.Species(cyt, d=CBDiff, name='CB', charge=0, initial=CB_init) # CalBindin (Anwar) caCB = rxd.Species(cyt, d=CBDiff, name='caCB', charge=0, initial=0.0) # Calcium-CB complex kCB = [CB_frate, CB_brate] # forward,backward buffering rates buffering = rxd.Reaction(ca + CB <> caCB, kCB[0], kCB[1], regions=cyt) def setreccacb( ): # setup recording of caCB for each pyramidal cell in Adend3,soma center for c in ce: if ice(c.ty): continue c.soma_caCB = Vector(tstop / h.dt) c.soma_caCB.record(caCB.nodes(c.soma)(0.5)[0]._ref_concentration) c.Adend3_caCB = Vector(tstop / h.dt) c.Adend3_caCB.record(caCB.nodes(c.Adend3)(0.5)[0]._ref_concentration) setreccaer() # NB: only record from RXD variables after ALL species setup! setreccacb() # otherwise, the pointers get messed up. setrecip3()
from neuron.units import mM, ms sim_time = 100 axon_terminal = h.Section(name="axon_terminal") #synaptic_cleft = rxd.Region([axon_terminal], nrn_region='o') axon_terminal_region = rxd.Region([axon_terminal], nrn_region='i') ca_intra = rxd.Species(axon_terminal_region, name="ca", charge=2, d=0, initial=5e-4, atolscale=1e-6) F = rxd.Species(axon_terminal_region, name="F", initial=0.001) FA = rxd.Species(axon_terminal_region, name="FA", initial=0) kb = rxd.Parameter(axon_terminal_region, name="kb", value=1e16 / (mM**4 * ms)) ku = rxd.Parameter(axon_terminal_region, name="ku", value=0.1 / ms) myreaction = rxd.Reaction(F + 4 * ca_intra, FA, kb, ku) #, regions=axon_terminal_region) tvec = h.Vector().record(h._ref_t) Fvec = h.Vector().record(F.nodes._ref_concentration) FAvec = h.Vector().record(FA.nodes._ref_concentration) h.finitialize(-65) h.continuerun(10) pyplot.plot(tvec, Fvec) pyplot.plot(tvec, FAvec) pyplot.show()
C=0.207614 * nM, CN=1.34728 * nM, ) MTtranscription = rxd.Rate(MT, vsT * KIT**n / (KIT**n + CN**n)) MPtranscription = rxd.Rate(MP, vsP * KIP**n / (KIP**n + CN**n)) MTdegradation = rxd.Rate(MT, -(vmT * MT / (KmT + MT) + kd * MT)) MPdegradation = rxd.Rate(MP, -(vmP * MP / (KmP + MP) + kd * MP)) T0production = rxd.Rate(T0, ksT * MT) T0degradation = rxd.Rate(T0, -kd * T0) T1degradation = rxd.Rate(T1, -kd * T1) T2degradation = rxd.Rate(T2, -kd * T2) T2degradation_due_to_light = rxd.Rate(T2, -vdT * T2 / (KdT + T2)) T0toT1 = rxd.Reaction(T0, T1, V1T * T0 / (K1T + T0), V2T * T1 / (K2T + T1), custom_dynamics=True) T1toT2 = rxd.Reaction(T1, T2, V3T * T1 / (K3T + T1), V4T * T2 / (K4T + T2), custom_dynamics=True) P0production = rxd.Rate(P0, ksP * MP) P0degradation = rxd.Rate(P0, -kd * P0) P1degradation = rxd.Rate(P1, -kd * P1) P2degradation = rxd.Rate(P2, -kd * P2 - vdP * P2 / (KdP + P2)) P0toP1 = rxd.Reaction(P0, P1, V1P * P0 / (K1P + P0), V2P * P1 / (K2P + P1),
nrn_region="i", geometry=rxd.Shell(0.8, 1)) species_x = rxd.Species( [ecs, soma_cell_1, soma_cell_2], name="species_x", d=1, charge=1, initial=1, ecs_boundary_conditions=0, ) Species_y = rxd.Species( [soma_cell_1, ecs], name="species_y", d=1, charge=1, initial=1, ecs_boundary_conditions=0, ) Species_z = rxd.Species([soma_cell_1], name="species_z", d=1, charge=1, initial=1, ecs_boundary_conditions=0) reaction_1 = rxd.Reaction(Species_y > Species_z + species_x, 0.058, regions=[soma_cell_1]) h.finitialize() h.continuerun(10)
charge=0, initial=initvalues[ispec], atolscale=tolscales[ispec])) cAMP_flux_rate = rxd.Parameter(cyt, initial=0) #specs[0] cAMP #specs[1] PKA2cAMP #specs[2] PKA4cAMP #specs[3] PKA #specs[4] PKAr #specs[5] PKAc #specs[6] AMP #specs[7] ATP #specs[8] PDE4 #specs[9] PDE4cAMP reaction1 = rxd.Reaction(specs[3] + specs[0] * 4 <> specs[2], ks[0], ks[1]) reaction3 = rxd.Reaction(specs[2] <> specs[4] + specs[5] * 2, ks[4] * specs[2], ks[5] * specs[4] * specs[5], custom_dynamics=True) reaction4 = rxd.Reaction(specs[6] > specs[7], ks[6]) reaction5 = rxd.Reaction(specs[8] + specs[0] <> specs[9], ks[7], ks[8]) reaction6 = rxd.Reaction(specs[9] > specs[7] + specs[8], ks[9]) reaction_cAMP_flux = rxd.Rate(specs[0], cAMP_flux_rate) # cAMP vec_t = h.Vector() vecs = [] vec_t = h.Vector() vec_t.record(h._ref_t)
soma = h.Section(name="soma") dend = h.Section(name="dend") soma.L = 100 soma.diam = 1 soma.nseg = 101 dend.L = 100 dend.diam = 1 dend.nseg = 101 soma.connect(dend) r = rxd.Region(h.allsec()) Ca = rxd.Species(r, name='Ca', d=Dca) Buf = rxd.Species(r, name='Buf', d=Db) CaBuf = rxd.Species(r, name='CaBuf', d=Dcab) buffering = rxd.Reaction(Ca + Buf, CaBuf, kf, kb) # # set initial concentrations to ca0, b0, cab0 in soma, # and to 0.001 in dend # Ca.initial = lambda node: (ca0 if node.sec._sec == soma else 0.001) Buf.initial = lambda node: (b0 if node.sec._sec == soma else 0.001) CaBuf.initial = lambda node: (cab0 if node.sec._sec == soma else 0.001) h.init() species_0_trace = h.Vector() species_0_trace.record(Ca.nodes(soma)(.5)[0]._ref_concentration) species_1_trace = h.Vector() species_1_trace.record(Buf.nodes(soma)(.5)[0]._ref_concentration)
from neuron import h, rxd h.load_file("stdrun.hoc") cell = h.Section(name="cell") r = rxd.Region([cell]) Ca = rxd.Species(r, name="ca", charge=2, initial=60e-3) reaction_decay = rxd.Reaction(Ca, 0 * Ca, 1e-8) tvec = h.Vector().record(h._ref_t) cavec = h.Vector().record(Ca.nodes[0]._ref_concentration) h.finitialize(-70) h.continuerun(10) if __name__ == "__main__": from matplotlib import pyplot pyplot.plot(tvec, cavec) pyplot.show()