Using Traub's parallel gap junction in Python
Posted: Mon Mar 27, 2017 9:08 am
I am trying to implement Traub's parallel gap junction code (see https://senselab.med.yale.edu/ModelDB/S ... hoc#tabs-2) in Python. So far I have the following for par_gap_create and par_gap_create1 (implemented as methods within a "Net" class):
When I try to run my program, I keep getting an error on the line pc.source_var(cell.soma(0.5)._ref_v, source_src_gid). The error is "Pointer to v is not in the currently accessed section." But as far as I can tell, using cell.soma(0.5)._ref_v is standard when using Python. Also, the same syntax is used in this forum post: viewtopic.php?f=31&t=2738&p=10998&hilit ... hon#p10998. So I'm not really sure what is going on here. Thanks for the help.
Code: Select all
def par_gap_create(self,gid_one,cellone_section,gid_two,celltwo_section,gmax):
'''create gap junction between two cells, that works with parallel simulations'''
if(pc.gid_exists(gid_one)):
self.par_gap_create1(gid_one, cellone_section, self.gap_src_gid + 1, self.gap_src_gid, gmax)
if(pc.gid_exists(gid_two)):
self.par_gap_create1(gid_two, celltwo_section, self.gap_src_gid, self.gap_src_gid + 1, gmax)
self.gap_src_gid += 2
def par_gap_create1(self,gid,cellsection,target_src_gid,source_src_gid,gmax):
'''create individual gap junction'''
cell=pc.gid2cell(gid)
if(cellsection==0): #let cellsection==0 specify that the gap junction be located on the soma; can add other sections in future
gapj = h.gGapPar(cell.soma(0.5))
self.par_gaps.append(gapj)
pc.target_var(gapj._ref_vgap, target_src_gid)
pc.source_var(cell.soma(0.5)._ref_v, source_src_gid)
gapj.g=gmax
if(cellsection != 0):
pass