Skip to content

erinosb/WormLib

Repository files navigation

WormLib WormLib Logo

License: MIT Python 3.11+ BigFISH Cellpose

WormLib is a modular open-source image analysis library for quantifying microscopy images of Caenorhabditis elegans embryos. It provides an end-to-end pipeline from image loading, embryo and cell segmentation, cell identity prediction, spot detection, and spatial mRNA analysis.

You can learn more about Wormlib by reading the paper here and in the detailed documentation at READTHEDOCS.io. Please see install instructions below.

Example notebooks:

1 - Single-cell spot detection

Citation

If you use WormLib in your research, please cite:

Naly Torres, Luis de Lira Aguilera, Karissa Coleman, Richard Bruno, Brian Munsky, Erin Osborne Nishimura WormLib: A Modular Image Analysis Library for Quantifying C. elegans Microscopy. (In preparation)


Installation

If you already have an older or broken wormlib environment, remove it first:

conda deactivate
conda env remove -n wormlib
conda env create -f installation/wormlib.yml
conda activate wormlib

Option #1: Quick Install With Conda

This installs the core scientific stack through conda and the remaining WormLib dependencies through pip.

# Clone the repository
git clone https://github.com/erinosb/WormLib.git
cd WormLib

# Create and activate the tested WormLib environment
conda env create -f installation/wormlib.yml
conda activate wormlib

Dependencies

Package Version Purpose
BigFISH 0.6.2 smFISH spot detection & analysis
Cellpose 3.1.0 Deep learning cell segmentation
scikit-image 0.23.2 Image processing & morphology
scikit-learn Conda-managed Random Forest classifiers (transitive via joblib)
PyTorch 2.4.1 GPU backend for Cellpose
OpenCV 4.10.0.84 Contour & ellipse fitting
nd2 0.10.3 Nikon ND2 file reader
tifffile 2025.6.11 TIFF file I/O
PyYAML ≥ 6.0.1 YAML configuration parsing
ReportLab ≥ 4.0.8 PDF report generation
Pillow ≥ 10.0 Image handling for PDF reports

Option #2: NVIDIA GPU Install

For GPU-accelerated Cellpose segmentation on Linux/Windows with an NVIDIA GPU and CUDA 12.4-compatible drivers:

conda env create -f installation/wormlib_cuda.yml
conda activate wormlib

On Apple Silicon macOS, use the default installation/wormlib.yml. PyTorch MPS support is included in the regular macOS PyTorch wheels when available.

Verify Installation

python -c "import numpy as np; import torch; from cellpose import models; import bigfish; print('WormLib dependencies OK')"

If you see an error indicating that a module compiled with NumPy < 2.0 cannot run with NumPy ≥ 2.0, or _ARRAY_API not found, the active environment is not using the pinned WormLib environment. Recreate it from the YAML file above.

Run WormLib on a High Performance Cluster


License

This project is licensed under the MIT License. See LICENSE for details.


Support

About

Modular image analysis toolkit to quantify Caenorhabditis elegans microscopy images. This toolkit can be used for smFISH spot detection (mRNA), fluorescence markers (proteins), colocalization (both), and other appliations. It allows for segmenting C. elegans embryos into individual blastomeres in early stages.

Resources

License

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages