Skip to content

MarziyehPourmousavi/EMANPI

Repository files navigation

EMANPI

EMpathy ANalysis PIpeline for pre-processing and analyzing calcium imaging data.

Overview

EMANPI is a Python-based pipeline for preprocessing and analyzing calcium imaging data. It automates several tasks, including video preprocessing, baseline correction, and neural activity analysis.

Developed by Marziyeh Pourmousavi in collaboration with Armen Saghatelyan's laboratory, Benoit Labonté's Lab, and Dynamica Research Lab.

Features

  • Tiff preprocessing: compression, black frame removal, merging
  • Delta F/F analysis with windowing
  • Neural activity filtering and visualization
  • Finding patterns in neural activity

Requirements

  • Conda for environment management and package installation.
  • Python version: 3.7 or higher
  • Python packages: All required packages will be automatically installed by following the installation instructions below. These include, but are not limited to:
    • MiniAn: Package for analyzing calcium imaging data.
    • Cascade: Package for spike inference from calcium imaging data.

Python Environment Compatibility

This pipeline involves two main tools, Minian and Cascade, which require different Python versions:

  • Minian: Python 3.8
  • Cascade: Python 3.7

Due to this incompatibility, you need to define and work within two separate Conda environments.

Workflow Instructions

  1. Set Up the Environments

    • Create a Conda environment for Minian with Python 3.8.
    • Create a Conda environment for Cascade with Python 3.7.
  2. Pipeline Execution

    • Open the Minian environment.
    • Run all pipeline steps up to the Running Cascade cell.
    • Close the Minian environment.
  3. Spike Inference

    • Open the Cascade environment.
    • Run the spike inference step.
    • Close the Cascade environment.
  4. Return to the Pipeline

    • Reopen the Minian environment.
    • Continue with the remaining steps of the pipeline.

By following this approach, you ensure compatibility with the specific Python versions required for each tool while maintaining a smooth workflow.

Installation

1. Install Conda:

If you don't have conda installed, you can download and install it from https://conda.io/miniconda.html (Miniconda is a minimal installer).

2. Create the main environment:

conda env create -f environment.yml

3. Activate and deactivate the main environment:

conda activate emanpi
conda deactivate emanpi

4. Create the MiniAn environment:

conda env create -f environment-minian.yml

Demo Pipeline

To get started with EMANPI, check out the demo notebook:

conda emanpi-minian
jupyter notebook demo_pipeline.ipynb

The notebook provides a step-by-step guide on using the pipeline for calcium imaging analysis, including:

  • Preprocessing TIFF files
  • Baseline correction
  • Neural activity analysis using Minian (An open-source miniscope analysis pipeline)
  • Computing ΔF/F
  • Spike probability of neurons calculation using Cascade (Calibrated spike inference from calcium imaging data)
  • Calculation of different measures of the timeseries, including Amplitude (ΔF/F), Frequency (spike rate), and Coherence (similarity to the mean amplitude)
  • Clustering neurons based on their activity

About

EMpathy ANalysis PIpeline for pre-processing and analyzing calcium imaging data.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors