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

 Download zip file   Auto-launch 
Help downloading and running models
Biophysical model of CA1 hippocampal region. The model simulates place cells/fields and explores the place cell dynamics as function of VIP+ interneurons.
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
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;
Simulation Environment: NEURON; Brian;
Model Concept(s): Place cell/field;
Implementer(s): Chavlis, Spyridon [schavlis at]; 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 Fri Mar 30 11:30:35 2018

@author: spiros
import pickle
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import sem
import matplotlib
from place_cell_metrics import field_size

matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42

nTrials = 10

fdname0 = folder1+'/metrics/'
fdname1 = folder1+'/metrics_interneurons/'
fdname2 = folder1+'/figures_interneurons/'

learning = ['prelearning_1','postlearning_1','postlearning_2']
my_list = ['Control', 'No_VIPcells', 'No_VIPCR', 'No_VIPCCK', 'No_VIPPVM', 'No_VIPNVM']
cells   = ['aacell', 'bcell','bscell', 'olm', 'vipcr', 'vipcck', 'vipcrnvm', 'pvsoma']
trials  = xrange(1, nTrials+1)
npath_x = 200
npath_y = 1

col = ['blue', 'green', 'orange', 'red']

for learn in ['postlearning_2']:
    means_all_cells = {}
    sems_all_cells  = {}
    means_out_cells = {}
    sems_out_cells  = {}
    means_rwd_cells = {}
    sems_rwd_cells  = {}
    for cell in cells:
        means1 = []
        sems1  = []
        means2 = []
        sems2  = []
        means3 = []
        sems3  = []
        for case in my_list:
            print case

            rtmaps   = []
            for ntrial in trials:
                if cell=='pvsoma':
                    with open(fdname0+learn+'/pickled_sn_'+case+'_'+str(ntrial)+'.pkl', 'rb') as f:
                        loaded_data = pickle.load(f)
                    nCells = loaded_data['maps'].shape[0]
                    for i in xrange(nCells):
                        fmax = np.max(loaded_data['maps'][i,:,:].squeeze())
                        size = field_size(loaded_data['maps'][i,:,:], relfreq=0.10*fmax)[0]
                        # Keep only Place cells
                        if fmax>=3 and size>=4:
                            rtmaps += list(loaded_data['maps'][i,:,:].T)
                    with open(fdname1+learn+'/pickled_sn_'+cell+'_'+case+'_'+str(ntrial)+'.pkl', 'rb') as f:
                        loaded_data = pickle.load(f)
                    nCells = loaded_data['maps'].shape[0]
                    if np.sum(loaded_data['maps']) != 0:
                        for i in xrange(nCells):
                            fmax = np.max(loaded_data['maps'][i,:,:].squeeze())
                            size = field_size(loaded_data['maps'][i,:,:], relfreq=0.10*fmax)[0]
                            # Keep all neurons.
                            if fmax>=0 and size>=0:
                                rtmaps += list(loaded_data['maps'][i,:,:].T)

            rtmaps = np.array(rtmaps).squeeze()
            if rtmaps.shape[0]!=0:
                maps_all = list(np.mean(rtmaps, axis=1))
                maps_rwd = list(np.mean(rtmaps[:,40:56], axis=1))
                maps_out = list(np.mean(np.delete(rtmaps, range(40,56), axis=1), axis=1))
        means_all_cells[cell] = means1
        means_rwd_cells[cell] = means2
        means_out_cells[cell] = means3

    for cell in cells:
        N = len(my_list)
        all_means = [np.mean(x) for x in means_all_cells[cell]]
        all_sems  = [sem(x).item() for x in means_all_cells[cell]]
        ind = np.arange(N)  # the x locations for the groups
        width = 0.25       # the width of the bars
        fig, ax = plt.subplots()
        rects1 =, all_means, width, color='r', yerr=all_sems)
        rwd_means = [np.mean(x) for x in means_rwd_cells[cell]]
        rwd_sems  = [sem(x).item() for x in means_rwd_cells[cell]]
        rects2 =, rwd_means, width, color='y', yerr=rwd_sems)
        out_means = [np.mean(x) for x in means_out_cells[cell]]
        out_sems  = [sem(x).item() for x in means_out_cells[cell]]
        rects3 =*width, out_means, width, color='b', yerr=out_sems)
        # add some text for labels, title and axes ticks
        ax.set_ylabel('Mean firing rate [Hz]')
        ax.set_xticks(ind + width / 2)
        ax.legend((rects1[0], rects2[0], rects3[0]), ('Track', 'Reward zone', 'Outside reward'))
        plt.savefig(fdname2+learn+'/'+cell+'.pdf', format='pdf', dpi=600)

# Figure 7 D
#N = len(cells)
#all_sems = []
#for cell in cells:
#    if cell != 'pvsoma':
#        all_means.append(np.mean([np.mean(x) for x in means_all_cells[cell][0]]))
#        all_sems.append(np.std([np.mean(x) for x in means_all_cells[cell][0]]))
#plt.figure(), all_means, width,color='r', yerr=all_sems)
#plt.xticks(np.arange(N-1), tuple(cells[:-1]))
#plt.savefig(fdname2+learn+'/figure7.pdf', format='pdf', dpi=600)

Loading data, please wait...