728x90
반응형
🙆♂️ biophysics 값들 설정
현재 값은 대왕오징어의 생물학적 값으로 대입되어있어서 다시 재설정을 해줘야합니다.
축 저항 값과 막 용량 값을 재설정 합니다.
class BallAndStick:
def __init__(self, gid):
self._gid = gid
self.soma = h.Section(name='soma', cell=self)
self.dend = h.Section(name='dend', cell=self)
self.all = [self.soma, self.dend] #전체 속성 값 배열
self.dend.connect(self.soma)
self.soma.L = self.soma.diam = 12.6157
self.dend.L = 200
self.dend.diam = 1
for sec in self.all:
sec.Ra = 100 #축 저항
sec.cm = 1 #막 용량
def __repr__(self):
return 'BallAndStick[{}]'.format(self._gid)
my_cell = BallAndStick(0)
중간에 보면 self.all을 사용했는데 이는 for문을 통해서 쉽게 값을 불러오기 위함입니다.
class BallAndStick:
def __init__(self, gid):
self._gid = gid
self._setup_morphology()
self._setup_biophysics()
def _setup_morphology(self):
self.soma = h.Section(name='soma', cell=self)
self.dend = h.Section(name='dend', cell=self)
self.all = [self.soma, self.dend]
self.dend.connect(self.soma)
self.soma.L = self.soma.diam = 12.6157
self.dend.L = 200
self.dend.diam = 1
def _setup_biophysics(self):
for sec in self.all:
sec.Ra = 100 # Axial resistance in Ohm * cm
sec.cm = 1 # Membrane capacitance in micro Farads / cm^2
def __repr__(self):
return 'BallAndStick[{}]'.format(self._gid)
my_cell = BallAndStick(0)
현재 코드가 복잡해지고 있어서 여러 함수로 나누면 위와 같은 모습으로 작성할 수 있습니다.
위의 코드와 하는 것은 같고 생성자 부분을 축소 시키고 다른 부분을 함수화 시켜 불러오고 있습니다.
class BallAndStick:
def __init__(self, gid):
self._gid = gid
self._setup_morphology()
self._setup_biophysics()
def _setup_morphology(self):
self.soma = h.Section(name='soma', cell=self)
self.dend = h.Section(name='dend', cell=self)
self.all = [self.soma, self.dend]
self.dend.connect(self.soma)
self.soma.L = self.soma.diam = 12.6157
self.dend.L = 200
self.dend.diam = 1
def _setup_biophysics(self):
for sec in self.all:
sec.Ra = 100 # Axial resistance in Ohm * cm
sec.cm = 1 # Membrane capacitance in micro Farads / cm^2
self.soma.insert('hh')
for seg in self.soma:
seg.hh.gnabar = 0.12 # Sodium conductance in S/cm2
seg.hh.gkbar = 0.036 # Potassium conductance in S/cm2
seg.hh.gl = 0.0003 # Leak conductance in S/cm2
seg.hh.el = -54.3 # Reversal potential in mV
def __repr__(self):
return 'BallAndStick[{}]'.format(self._gid)
my_cell = BallAndStick(0)
그리고 Hodgkin-Huxley (hh)를 추가해서 나트륨 전도도(gnabar)와 칼륨 전도도(gkbar) 값을 설정하고
누출 전도도(g1)와 역전저위(e1) 값을 설정합니다.
현재 soma가 1개인데 왜 for문을 돌리지라는 의문이 생길 수 있지만 추후에 사용할 수 있으니 for문으로 작성했다고 합니다.
class BallAndStick:
def __init__(self, gid):
self._gid = gid
self._setup_morphology()
self._setup_biophysics()
def _setup_morphology(self):
self.soma = h.Section(name='soma', cell=self)
self.dend = h.Section(name='dend', cell=self)
self.all = [self.soma, self.dend]
self.dend.connect(self.soma)
self.soma.L = self.soma.diam = 12.6157
self.dend.L = 200
self.dend.diam = 1
def _setup_biophysics(self):
for sec in self.all:
sec.Ra = 100 # Axial resistance in Ohm * cm
sec.cm = 1 # Membrane capacitance in micro Farads / cm^2
self.soma.insert('hh')
for seg in self.soma:
seg.hh.gnabar = 0.12 # Sodium conductance in S/cm2
seg.hh.gkbar = 0.036 # Potassium conductance in S/cm2
seg.hh.gl = 0.0003 # Leak conductance in S/cm2
seg.hh.el = -54.3 # Reversal potential in mV
self.dend.insert('pas')
for seg in self.dend:
seg.pas.g = 0.001 # Passive conductance in S/cm2
seg.pas.e = -65 # Leak reversal potential mV
def __repr__(self):
return 'BallAndStick[{}]'.format(self._gid)
my_cell = BallAndStick(0)
이제 dend에 passive 채널을 입력해서 수동적 전도도(g)와 누출 역전 전위 값을 설정합니다.
print(h.units('gnabar_hh'))
값들의 단위는 units()속성을 통해서 확인할 수 있습니다.
for sec in h.allsec():
print('%s: %s' % (sec, ', '.join(sec.psection()['density_mechs'].keys())))
그리고 psection()함수를 통해서 적용된 값들을 확인해볼 수 있습니다.
3개가 나오긴하는데 일단 패스이구요. 원래느 2개 나왔는데 코드를 바꾸다보니 이렇게 됐습니다.
728x90
반응형
'AI > neuron' 카테고리의 다른 글
[neuron][파이썬] 15. 여러 개 시뮬레이션2 - Run the simulations (0) | 2022.07.22 |
---|---|
[neuron][파이썬] 14. 여러 개 시뮬레이션1 - Run the simulation (0) | 2022.07.21 |
[neuron][파이썬] 12. 스타일 정의 - Define stylized geometry (0) | 2022.07.21 |
[neuron][파이썬] 11. 섹션 연결 - Connect the sections (0) | 2022.07.21 |
[neuron][파이썬] 10. 여러 섹션 만들기 - Create the sections (0) | 2022.07.21 |