CA1 network model for place cell dynamics (Turi et al 2019)

 Download zip file   Auto-launch 
Help downloading and running models
Accession:246546
Biophysical model of CA1 hippocampal region. The model simulates place cells/fields and explores the place cell dynamics as function of VIP+ interneurons.
Reference:
1 . Turi GF, Li W, Chavlis S, Pandi I, O’Hare J, Priestley JB, Grosmark AD, Liao Z, Ladow M, Zhang JF, Zemelman BV, Poirazi P, Losonczy A (2019) Vasoactive Intestinal Polypeptide-Expressing Interneurons in the Hippocampus Support Goal-Oriented Spatial Learning Neuron
Citations  Citation Browser
Model Information (Click on a link to find other models with that property)
Model Type: Realistic Network;
Brain Region(s)/Organism: Hippocampus; Mouse;
Cell Type(s): Hippocampus CA1 pyramidal GLU cell; Hippocampus CA1 basket cell; Hippocampus CA1 basket cell - CCK/VIP; Hippocampus CA1 bistratified cell; Hippocampus CA1 axo-axonic cell; Hippocampus CA1 stratum oriens lacunosum-moleculare interneuron ; Hippocampal CA1 CR/VIP cell;
Channel(s): I A; I h; I K,Ca; I Calcium; I Na, leak; I K,leak; I M;
Gap Junctions:
Receptor(s): GabaA; GabaB; NMDA; AMPA;
Gene(s):
Transmitter(s):
Simulation Environment: NEURON; Brian;
Model Concept(s): Place cell/field;
Implementer(s): Chavlis, Spyridon [schavlis at imbb.forth.gr]; Pandi, Ioanna ;
Search NeuronDB for information about:  Hippocampus CA1 pyramidal GLU cell; GabaA; GabaB; AMPA; NMDA; I A; I K,leak; I M; I h; I K,Ca; I Calcium; I Na, leak;
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 27 09:08:09 2018.

@author: spiros
"""
import os
import sys
import numpy as np
from gridfield import gridfield

# Choose coordinates +1 for the value
# e.g., if you want 100-->myx = 101
# Apart from the case that one dimension is one


###############################################################################
# P A T H   C O N S T R U C T I O N  ##########################################
###############################################################################

myx = 201  # Choose +1 the points you want (apart from 1)
myy = 1

# Place field coordinations; all to all combinations
x_array = range(0, myx, 5)
y_array = [1]

my_run = int(sys.argv[1])

print(my_run)

maindir1 = 'runs_produced_by_python_speed_pos/'
maindir2 = 'runs_produced_by_python_speed_neg/'

dirname1 = maindir1+'run_'+str(my_run)
dirname2 = maindir2+'run_'+str(my_run)

os.system('mkdir -p ' + dirname1)
os.system('mkdir -p ' + dirname2)

np.random.seed(my_run)


nx = 1
ny = 1

p0 = [nx, ny]
k = 1

zold = 0

totlength = 0
if myy == 1:
    npoints = (myx-1)*myy
else:
    npoints = (myx-1)*(myy-1)


path = []
for i in range(1, npoints+1):
    if (ny > myy):
        break

    if ((i >= 70) and (i <= 95)) or ((i >= 105) and (i <= 130)):
        # random time at each point
        print('Enters/Leaves reward zone')
        mu = 140-np.abs(100-i)
        sigma = 2
        # random time at each point
        z = np.round(mu + np.random.randn(1).item()*sigma)
    elif (i > 95) and (i < 105):
        print('In reward zone')
        mu = 500-np.abs(100-i)
        sigma = 5
        # random time at each point
        z = np.round(mu + np.random.randn(1).item()*sigma)
    else:
        # random time at each point
        mu = 70
        sigma = 2
        # random time at each point
        z = np.round(mu + np.random.randn(1).item()*sigma)
        while (z < mu-20) or (z > mu+20):
            z = np.round(mu + np.random.randn(1).item()*sigma)

    time_at_the_same_point = z
    path += [p0]*int(time_at_the_same_point)

    nx = nx + k
    p0 = [nx, ny]

    if (nx > myx-1) and (ny % 2) != 0:
        ny = ny+1
        nx = myx-1
        p0 = [nx, ny]
        k = -1

    if (nx < 1) and (ny % 2) == 0:
        ny = ny+1
        nx = 1
        p0 = [nx, ny]
        k = 1

    zold += time_at_the_same_point

# save the path
path = np.array(path)
filename = dirname1+'/path.txt'
np.savetxt(filename, path, fmt='%.0f', delimiter=' ')

print('Done with the path')

###############################################################################
# G R I D    L I K E    I N P U T S  ##########################################
###############################################################################


ndend = 8  # Number of dendrites
theta_freq = 8  # in Hz
theta_phase = 0
my_field = 0

for xxx in x_array:
    for yyy in y_array:

        my_field += 1

        folder1 = dirname1+'/place_field_'+str(my_field)
        folder2 = dirname2+'/place_field_'+str(my_field)
        os.system('mkdir -p '+str(folder1))
        os.system('mkdir -p '+str(folder2))

        # d is the x,y point of the grid field of dend ni
        d = np.zeros((ndend, myx, myy))
        dd = np.zeros((myx, myy))

        angle = 0.0
        lambda_var = 3.0
        for ni in range(ndend):
            lambda_var += 0.5
            angle += 0.4
            for x in range(myx):
                for y in range(myy):
                    d[ni, x, y] = gridfield(angle, lambda_var, xxx, yyy, x, y)

        for ni in range(ndend):
            dd += d[ni, :, :]

        for ni in range(ndend):
            spikes1 = []
            spikes2 = []
            for i in range(len(path)):  # i represent the time in ms
                current_loc = path[i, :]-1

                prob = d[ni, current_loc[0], current_loc[1]]
                prob *= (np.sin(2.0*np.pi*theta_freq *
                                i/1000.0 + theta_phase)+1.0)/2.0

                r_cnt = 100  # reward center location
                lag1 = 5  # 2 seconds in bins

                # Positive modulation filter
                pp = 1 - 0.25*np.exp(-0.05*(current_loc[0] - (r_cnt+lag1))**2)

                # negative modulation filter
                pn = 1 + 0.25*np.exp(-0.05*(current_loc[0] - r_cnt-1)**2)

                p_pos = prob * pp
                p_neg = prob * pn

                rnd_num = np.random.rand(1).item()

                if (p_pos > 0.7) and (rnd_num < prob / 2.0):

                    # spikes is a vector with the locations/timespots
                    # where there is a spike
                    spikes1.append(i)

                if (p_neg > 0.7) and (rnd_num < prob / 2.0):

                    # spikes is a vector with the locations/timespots
                    # where there is a spike
                    spikes2.append(i)

            spikes1 = np.array(spikes1).reshape(-1, 1)
            spikes2 = np.array(spikes2).reshape(-1, 1)
            filename1 = folder1+'/s'+str(ni)+'.txt'
            filename2 = folder2+'/s'+str(ni)+'.txt'
            np.savetxt(filename1, spikes1, fmt='%.0d', delimiter=' ')
            np.savetxt(filename2, spikes2, fmt='%.0d', delimiter=' ')

        print('Done with Grid field ' + str(my_field))