lparsons / worm-functional-connectivity

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

worm-functional-connectivity

Functional connectivity atlas for the C. elegans brain

Author: Francesco Randi francesco.randi@gmail.com

Installation

  1. Install from GitHub

    python -m pip install git+https://github.com/leiferlab/worm-functional-connectivity

Usage

  • The main class in the python module is FunctionalAtlas.

    • Use the FunctionalAtlas.from_file() method to load a pickled instance from file.

    • There are docstrings and comments for documentation.

    • The class has two main methods:

      1. get_standard_stimulus() to generate one of the standard stimuli from the parameters chosen by the user.

      2. get_responses() that returns the responses that need to be plotted. The method get_responses() expects a stimulus (e.g. generated by get_standard_stimulus()) and either a list of neuron IDs whose response the user wants to plot, or a threshold to ask for all the responses above that threshold. See the docstring for any temporary behavior for this mock atlas.

Command line utilities

  • use_mock_atlas_scalar - Uses the mock functional atlas stored in atlas/mock.pickle to generate a scalar version of the functional connectivity matrix.
usage: use_mock_atlas_scalar [-h] [--mode MODE]
                             [--amplitude-threshold THRESHOLD]
                             [--matrix-output FILE] [--pairwise-output FILE]
                             [-p] [-v]

Use the mock atlas and return a scalar version of the functional connectivity
matrix (amplitude, timescales, or other)

optional arguments:
  -h, --help            show this help message and exit
  --mode MODE           Type of scalar quantity to extract from functional
                        connectivity. Can be amplitude or timescales.
  --amplitude-threshold THRESHOLD
                        Amplitude values below the threshold will be set to
                        zero.
  --matrix-output FILE  Save the matrix to a tab delimited file
  --pairwise-output FILE
                        Save the matrix with one line per neuron pair in a tab
                        delimited file
  -p, --show-plot       Plot output
  -v, --verbose         increase output verbosity

As an alternative to the commandline, params can be placed in a file, one per
line, and specified on the commandline like 'use_mock_atlas_scalar
@params.conf'.

Example scripts

  • scripts/generate_mock_atlas.py - Example showing how to generate a mock functional connectivity atlas.

  • scripts/use_mock_atlas.py - Example of how to generate a stimulus using FunctionalAtlas.get_standard_stimulus() and then provide that stimulus to FunctionAtlas.get_responses() to get the neuronal responses to that stiumuls.

About


Languages

Language:Python 85.7%Language:C++ 14.3%