olfactorybulb.model

The main class to build and run the network model. The class constructor builds the model using one of the specified parameter classes. If autorun==True, the model will be simulated after building. Otherwise, run(tstop) is used to run the simulation.

MPI/multi-core simulations can be performed using initslice.py found in the repo root. For example, the following command will build and run the network model using the GammaSignature parameter set using 16 cores:

# From repo root, run this shell command (replace 16 with the number of cores you would like to use):
mpiexec -np 16 python initslice.py -paramset GammaSignature -mpi

Simulation results will be stored under [repo]/olfactorybulb/results/GammaSignature. The last folder in the path uses the name of the parameter class.

See the LFP Wavelet Analysis.ipynb notebook for examples of how the results are analyzed.

class olfactorybulb.model.OlfactoryBulb(params='ParameterSetBase', autorun=True)[source]

Bases: object

The main class used to build and simulate the olfactory bulb network model.

__init__(params='ParameterSetBase', autorun=True)[source]
Parameters
  • params – The name of the class defined in olfactorybulb.paramsets that defines the network parameters

  • autorun – When true, after the network model is built, starts the simulation

add_gap_junctions(in_name, g_gap)[source]

Adds gap junctions between tufted dendrites of specified cells

Parameters
  • in_name – A part of a cell class name (e.g. ‘Mitral’) used to select a cell to which the GJ is added

  • g_gap – The conductance of the gap junctions

add_inputs(odor, t, rel_conc)[source]

Add odor stimulation to the tufts of the principal cells

Parameters
  • odor – The name of the odor

  • t – Onset time

  • rel_conc – Relative concentration 0-1

create_gap_junction(seg_1_info, seg_2_info, g_gap)[source]

Creates a gap junction between two segments

Parameters
  • seg_1_info – Tuple of the name and gid of the first segment

  • seg_2_info – Tuple of the name and gid of the second segment

  • g_gap – Gap junction conductance

create_gap_junctions_between(input_segs, g_gap)[source]

Creates gap junctions between a list of specified segments. GJs are connected in a chain (e.g. Seg1 <-GJ1-> Seg2 <-GC2-> Seg3)

Parameters
  • input_segs – List of segments to connect by gap junctions

  • g_gap – Gap junction conductance

create_lfp_electrode(x, y, z, sampling_period, method='Line')[source]

Uses the LFPsimpy package to add an LFP electrode at the specified x,y,z location

See LFPsimpy package.

Parameters
  • x – y, z coordinates in um

  • sampling_period – How often to compute the LFP signal in ms

  • method – One of ‘Line’, ‘Point’, or ‘RC’.

Returns

an LFPsimpy LfpElectrode object

get_gaussian_spike_train(spikes=50, start_time=100, duration=10)[source]

Gets a spike train from a gaussian probability distribution whose 99% range starts at the specified time and lasts for the specified duration.

Parameters
  • spikes – The number of spikes to generate

  • start_time – The onset time of the gaussian

  • duration – The duration of the gaussian

Returns

A numpy array of spike times in chronological order

get_lfp()[source]

Returns the LFP signal in nV

Returns

a tuple of LFP times, and voltages (nV)

get_model_inputsegs()[source]

Queries the model database to get the ‘root’ segments of the tufted dendrites of the mitral and tufted cells

Returns

A dict that maps the cell model’s class name to the name of the root tufted dendrite section

get_nseg_count(root_dict)[source]

Recursively counts the number of segments of a cell provided its BlenderNEURON root segment dict

Parameters

root_dict – The root segment dict of a cell as saved by BlenderNEURON

Returns

The total number of segments of the cell

load_cells(cell_type)[source]

Load the cells of the specified type onto least busy MPI ranks.

‘Busyness’ of a rank is the sum of all cell complexities on that rank, as measured by the number of segments of each cell.

Parameters

cell_type – One of ‘MC’, ‘GC’, ‘TC’

load_glom_cells()[source]

Loads a dict that maps glomeruli ids to cells that are attached to each glomerulus

load_synapse_set(synapse_set)[source]

Uses BlenderNEURON to load a previously saved set of synapses between a population of cells

Parameters

synapse_set – One of ‘GCs__MCs’ or ‘GCs__TCs’ as seen in the olfactorybulb.slices.DorsalColumnSlice folder.

print_status()[source]

Prints the current simulation time on the same line (no new line)

record_from_somas(cell_type)[source]

Adds NEURON vector recorders to the somas of the specified cell types

Parameters

cell_type – One of ‘MC’, ‘GC’, ‘TC’

run(tstop)[source]

Runs the NEURON simulation until the specified stop time

Parameters

tstop – Simulation stop time

save_recorded_vectors()[source]

Saves soma voltage traces and odor input spike times to Pickle files for later processing

Saves to the results directory as ‘soma_vs.pkl’ and ‘input_times.pkl’

setup_status_reporter()[source]

Sets up the NEURON simulation to report the simulation time

stable_hash(source, digits=9)[source]

Creates a hash code of digits long that is stable across different machines.

Parameters
  • source – The string to hash, in this case a section name

  • digits – The number of digits to keep of the hash

Returns

The hash code as an integer

stim_glom_segments(time, input_segs, intensity)[source]

Adds input synapses onto glomerular tufts at specified start time and intensity

The inhalation part of a sniff cycle is modeled as a gaussian probability that is centered at the midpoint of the inhalation onset and end. The probability is translated into spikes. The spikes then trigger the excitatory synapses placed at the mitral/tufted cell tufts.

Intensity regulates how many spikes to pick from the gaussian.

Parameters
  • time – the inhalation onset time in ms

  • input_segs – a list containing tuples of: a) The name of the segment to stimulate as it appears on the current MPI rank b) segment gid c) segment name as it appears when there is only one rank. If not using MPI a) and c) are same.

  • intensity – 0-1 representing odor intensity

Returns

None

olfactorybulb.model.random() → x in the interval [0, 1).