Skip to content

pauladkisson/bam_microstim2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bam_microstim2

This projects adds microstimulation to the Wang 2002 Biophysical Attractor Model of decision-making, fully coded in MATLAB R2021A. This work improves upon the original bam_microstim with more realistic extracellular microstimulation model and more detailed analyses. A pre-print describing this work can be found here.

Installation

Simply clone the repository and navigate MATLAB to the bam_microstim2 directory.

Project Organization

The project is generally run by 4 code scripts:

  1. sim_constants.m defines the simulation-level parameters such as the simulation name, current amplitudes, etc. and then calls bam_constants, which defines all the low level biophysical constants, generates connectivities, neuron locations, etc. for a given simulation type ('connected', 'disconnected', etc.).
  2. main.m runs the main simulation program, which simulates leaky-integrate-and-fire dynamics, synaptic currents, task-related currents, background currents, and microstimulation currents for a variety of task conditions (coherences) and microstimulation inputs. Spike times for each neuron are stored in a containers.map variable called recspikes in .mat files.
  3. analyze_main.m runs analysis of the raw spike time data to generate data of interest such as accuracy and decision time, and stores them in "decisions.mat" files.
  4. plot_results.m plots the data generated by analyze_main.m, in a variety of visualizations. each of which calls various functions.
  • Note: bootstrap_decisions.m is an exception that generates bootstrapped decision-making plots separately from plot_results.m.

The data is stored in a different folder for each simulation ("Simulation X"), which is determined by the sim_name variable defined in bam_constants.m.

Usage

  1. Define name of simulation with sim_name variable in bam_constants.m (ex. "X")
  2. Adjust parameters as necessary
  3. Call sim_constants --> saves necessary constants
  4. Update sim_name in main.m
  5. Call main.m --> for each brain/stimulation condition/coherence/trial, saves data in "Simulation X/brainY/data/stim_ampnA_stim_cond/c=coherence/trialZ.mat"
  6. Update sim_name in analyze_main.m
  7. Call analyze_main --> saves analyzed variables in "Simulation X/brainY/data/stim_ampnAstim_cond/decisions.mat"
  8. Update sim_name in plot_results.m
  9. Call sections in plot_results for each visualization and statistical analyses

Data Storage

Data is stored in an organized nested folder structure with the following levels

  • Simulation name ("Simulation Test"), which contains
    • conductances.mat, which stores matrices with connection conductances for ampa (AMPA), gaba (GABA), nmda (NMDA) synapses
    • bam_constants.mat, which stores a variety of useful constants
    • adja.mat, which stores connection adjacency matrix adja
    • spikes, which contains the task-related and background input spikes for each trial/coherence under
      • c=coherence (ex. "c=-1.000")
        • trialX.mat (ex. "trial1.mat"), which contains a variable with all the input spikes called spikes
    • ustim, which contains
      • r.mat, which stores the locations of each 'affected' P1 neuron (ball_r)
      • stim_ampuAstim_cond.mat (ex. "-1.40uA_galvanic.mat"), which stores the instantaneous microstimulation current for each neuron (I_ustim)
      • data, which contains the data for each trial in a nested structure
        • stim_ampuA_stim_cond (ex. "-1.40uA_galvanic") for each stimulation condition
          • decisions.mat, which stores all of the analyzed variables from analyze_main.m
          • c=coherence ex. ("c=-1.000") for each coherence
            • trialX.mat (ex. "trial1.mat"), which stores the spike times for each neuron in a containers.map variable (recspikes), in which the keys are the neuron number as a string (ex. '1') and the values are a vector containing the time indices when the neuron fired an action potential (ex. t(recspikes('1')) = [0.521, 1.001, 2.325, 2.9, 2.997, 3.053]).

Cable Model Validation

The code used to validate LIF microstimulation approximations against a cable equation model is housed in a separate folder called CableModelValidation. The main script to run this code is called cable_validation.m

Contact

Paul Adkisson: [email protected]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages