Current Dipole in Laminar Neocortex (Lee et al. 2013)

 Download zip file   Auto-launch 
Help downloading and running models
Accession:151685
Laminar neocortical model in NEURON/Python, adapted from Jones et al 2009. https://bitbucket.org/jonescompneurolab/corticaldipole
Reference:
1 . Lee S, Jones SR (2013) Distinguishing mechanisms of gamma frequency oscillations in human current source signals using a computational model of a laminar neocortical network. Front Hum Neurosci 7:869 [PubMed]
Model Information (Click on a link to find other models with that property)
Model Type: Realistic Network;
Brain Region(s)/Organism: Neocortex;
Cell Type(s):
Channel(s): I Na,t; I K; I M; I Calcium; I h; I T low threshold; I K,Ca;
Gap Junctions:
Receptor(s): GabaA; GabaB; AMPA; NMDA;
Gene(s):
Transmitter(s):
Simulation Environment: NEURON (web link to model); Python (web link to model); NEURON; Python;
Model Concept(s): Magnetoencephalography; Temporal Pattern Generation; Activity Patterns; Gamma oscillations; Oscillations; Current Dipole; Touch;
Implementer(s): Lee, Shane [shane_lee at brown.edu];
Search NeuronDB for information about:  GabaA; GabaB; AMPA; NMDA; I Na,t; I T low threshold; I K; I M; I h; I K,Ca; I Calcium;
""" spikefn.py - parsing spikes from the file written by the sim
    Copyright (C) 2013 Shane Lee and Stephanie Jones

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
"""

import numpy as np
import os
import fileio as fio

# returns lists of spiketimes for each cell of the simulation
def spikes_from_file(fspikes, gid_dict):
    src_list = []
    src_extinput_list = []
    src_unique_list = []

    # fill in 2 lists from the keys
    for key in gid_dict:
        if key.startswith('L2_') or key.startswith('L5_'):
            src_list.append(key)

        elif key == 'extinput':
            src_extinput_list.append(key)

        else:
            src_unique_list.append(key)

    # check to see if there are spikes in here, otherwise return an empty array
    if os.stat(fspikes).st_size:
        s = np.loadtxt(open(fspikes, 'rb'))

    else:
        s = np.array([], dtype='float64')

    # sorted here
    s_sorted = {}

    for t, gid_float in s[:]:
        gid = int(gid_float)
        if gid not in s_sorted:
            s_sorted[gid] = []
        s_sorted[gid].append(t)

    gids = [gid for gid in s_sorted]
    gids.sort()

    s_by_type = {}

    for key in src_list:
        if key not in s_by_type:
            s_by_type[key] = []

        for gid in gid_dict[key]:
            if gid in s_sorted:
                s_sorted[gid].sort()
                s_by_type[key].append(np.array(s_sorted[gid]))

            else:
                s_by_type[key].append(np.array([]))

    return s_by_type

if __name__ == '__main__':
    f = 'data/gammaweak/data.pkl'
    fspk = 'data/gammaweak/spikes.txt'
    x = fio.pkl_load(f)
    s = spikes_from_file(fspk, x['gid_dict'])

Loading data, please wait...