Skip to content

openworm/worm-functional-connectivity

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

worm-functional-connectivity

Functional connectivity atlas for the C. elegans brain

Author: Francesco Randi [email protected]

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

  • export_atlas_scalar - Export a scalar version of a functional connectivity matrix stored in atlas/.
usage: export_atlas_scalar [-h] [--mode MODE]
                           [--amplitude-threshold THRESHOLD]
                           [--matrix-output FILE] [--pairwise-output FILE]
                           [-p] [-v] [--version] [--atlas ATLAS]

Given an atlas (in ../atlas), 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. (default:
                        amplitude)
  --amplitude-threshold THRESHOLD
                        Amplitude values below the threshold will be set to zero.
                        (default: 0.0)
  --matrix-output FILE  Save the matrix to a tab delimited file (default: NONE)
  --pairwise-output FILE
                        Save the matrix with one line per neuron pair in a tab
                        delimited file (default: None)
  -p, --show-plot       Plot output (default: False)
  -v, --verbose         increase output verbosity (default: False)
  --version             show program's version number and exit
  --atlas ATLAS         Which atlas to export (must be in ../atlas).
                        Choices are: wild-type, unc-31, or mock (default:
                        wild-type)

As an alternative to the commandline, params can be placed in a file, one per
line, and specified on the commandline like 'export_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

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 85.1%
  • C++ 14.9%