/astroCAST

Package to classify astrocytic calcium events

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

astroCAST

astroCAST is a Python package designed for analyzing calcium fluorescence events in astrocytes. It provides various functionalities to process and explore calcium imaging data, identify events, and perform spatiotemporal analysis.

Features

  • Fast data preparation
  • Efficient event detection algorithm
  • Visualization tools for exploring calcium imaging data and events
  • Calculation of spatial statistics and cluster analysis
  • Modularity detection and analysis of astrocyte modules

Summary

Astrocytic calcium event analysis is challenging due to its complex nature, spatiotemporally overlapping events, and variable lengths. Our Astrocytic Calcium Signaling Toolkit (astroCAST) addresses these challenges by efficiently implementing event detection and variable length clustering. Leveraging dynamic thresholding, astroCAST captures diverse calcium fluctuations effectively. Designed for modularity, parallelization, and memory-efficiency, it enables fast and scalable event detection on large datasets.

Table of contents

  1. Installation
  2. Documentation
  3. Containers
    1. Docker container
    2. Singularity container
  4. Contributing

Installation

Conda: We recommend to first create a fresh conda environment to prevent conflicts with other packages.

conda create -n astrocast python=3.9
conda activate astrocast

Via pip:

pip install astrocast

From source:

git clone git@github.com:janreising/astroCAST.git
cd astroCAST
pip install poetry
poetry install

With optional features:

pip install astrocast[all]
# or using poetry
poetry install -E all

Containers

Now astroCAST implementation can run as stand-alone docker and singularity images.

Currently, we only support astroCAST in MacOS through docker, but other operating systems compatible docker may as well run astroCAST docker container. For more infomation on how to install docker and create an account, please visit https://docs.docker.com/engine/install/. For more information on how to install singularity(apptainer) and create an account visit https://apptainer.org/docs/admin/main/installation.html.

Docker container

Once docker has been installed, run the following commands in the terminal:

docker pull anacgon/astrocast:latest

This may take some minutes as the image is directly pulled from dockerhub. Once the image has been pulled locally, make sure it was correctly fetched by running:

docker image ls

You should be able to see the docker image listed.

To start a container using the image run:

docker run -v /path/to/your/data:/home/data -it -p 8888:8888 anacgon/astrocast:latest 

Note: "/path/to/your/data" must be replaced with your local path to the data you will use for the analysis. -p option allows the container to expose port 8888, necessary to run access jupyterlab from your browser.

To start a new jupyterlab notebook from inside the docker container, run:

jupyter-lab --allow-root --no-browser --port=8888 --ip="*"

Note: the explorer window will not be open automatically, you must copy and paste the URL provided in the console.

Singularity container

Singularity (apptainer) now supports direct conversion of docker images into singularity. To pull and run the image use the following commands: Pull singularity image directly from dockerhub.

singularity pull docker://anacgon/astrocast:latest

Once image has been pulled, a SIF file will be created in the directory where the previous command was executed. To run the singularity image:

singularity run --writable-tmpfs astrocast_latest.sif

note: singularity automatically mounts the host file system, therefore manual mounting is not required.

To start a new jupyterlab notebook from inside the singularity container, run:

jupyter-lab --ip "*" --no-browser

Please note that for this option to work, you will need to forward port 8888 (or customized port) of the cluster to your local computer when connecting via ssh. For example:

ssh -L 8888:host-node:8888 username@host-node

This will allow port 8888 in the host node to be forwarded to port 8888 in your local computer. Note: the explorer window will not be open automatically, you must copy and paste the URL provided in the console.

For more detailed examples and usage instructions, please refer to to the companion paper here (currently in preprint).

Documentation

Our documentation is hosted on readthedocs.

Contributing

Contributions to astroCAST are welcome! If you encounter any issues, have suggestions, or would like to contribute new features, please submit a pull request or open an issue in the GitHub repository.

License

astroCAST is released under the GNU General Public License v3.0.

Contact

For any inquiries or questions, please contact Jan Philipp Reising or Ana Cristina González.