Installation

Prerequisites

Before using scHopfield, you need:

  1. Single-cell RNA-seq data in AnnData format

  2. RNA velocity computed (e.g., using scVelo)

    • adata.layers['Ms'] - spliced counts

    • adata.layers['velocity_S'] - RNA velocity

    • adata.var['gamma'] - degradation rates

  3. Cell type annotations (e.g., adata.obs['cell_type'])

  4. Highly variable genes selected (recommended: 50-200 genes)

Installation Methods

Standard Installation

git clone https://github.com/Bernaljp/scHopfield.git
cd scHopfield
pip install .

With Optional Dependencies

For enhanced functionality (seaborn, igraph, dynamo):

pip install -e ".[optional]"

For development tools:

pip install -e ".[dev]"

For all features:

pip install -e ".[all,dev,docs]"

Dependencies

Core Dependencies

These are automatically installed:

  • Numerical computing: numpy >= 1.20.0, scipy >= 1.7.0, pandas >= 1.3.0

  • Visualization: matplotlib >= 3.4.0

  • Single-cell analysis: anndata >= 0.8.0, scanpy >= 1.9.0

  • Deep learning: torch >= 1.9.0

  • Network analysis: networkx >= 2.6.0

  • Dimensionality reduction: umap-learn >= 0.5.0, scikit-learn >= 1.0.0

  • Utilities: tqdm >= 4.62.0, h5py >= 3.0.0, hoggorm >= 0.13.0

Optional Dependencies

For enhanced performance and features:

seaborn (>= 0.11.0)

For boxplot visualizations

python-igraph (>= 0.9.0)

For 10-100× faster network centrality computation on large networks

pip install python-igraph
dynamo-release (>= 1.0.0)

For RNA velocity integration

System Requirements

  • Python: >= 3.8

  • OS: Linux, macOS, Windows

  • Memory: Recommended 16GB+ RAM for large datasets

  • GPU: Optional (CUDA-compatible GPU for faster training with device='cuda')

Verify Installation

After installation, verify it works:

import scHopfield as sch
print(sch.__version__)  # Should print: 0.1.0

# Check available modules
print(dir(sch))  # Should show: pp, inf, tl, pl, dyn, etc.

Troubleshooting

PyTorch Installation Issues

Install PyTorch separately first:

# CPU version
pip install torch --index-url https://download.pytorch.org/whl/cpu

# CUDA version (replace cu118 with your CUDA version)
pip install torch --index-url https://download.pytorch.org/whl/cu118

Then install scHopfield:

pip install -e .

igraph Installation Issues

python-igraph requires C libraries:

On macOS:

brew install igraph
pip install python-igraph

On Ubuntu/Debian:

sudo apt-get install libigraph0-dev
pip install python-igraph

On Windows:

pip install python-igraph
# If that fails, download pre-built wheel from:
# https://www.lfd.uci.edu/~gohlke/pythonlibs/#python-igraph

Note

The package will work fine without igraph, it will just use networkx (slower for large networks)

Using Conda Environment

If using conda, create a clean environment:

conda create -n schopfield python=3.10
conda activate schopfield
pip install -e .

Next Steps

Once installed, proceed to the Quick Start guide to begin analyzing your data.