Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
version: 2

build:
os: "ubuntu-20.04"
os: "ubuntu-22.04"
tools:
python: "3.11"

python:
# Install our python package before building the docs
install:
- method: pip
path: .
extra_requirements:
- docs
commands:
# Install uv
- pip install uv
# Sync dependencies with uv (includes docs extras)
- uv sync --extra docs
# Build docs
- uv run sphinx-build -b html docs $READTHEDOCS_OUTPUT/html
39 changes: 32 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,43 @@ Extensive documentation and tutorials are available at [read the docs](https://s

## Installing

To install SCENIC+ (in a Linux environment):
### Recommended: Install with uv (Fast & Cross-Platform)

We highly recommend to install SCENIC+ in a new conda environment.
[uv](https://github.com/astral-sh/uv) is a fast Python package installer and resolver. It's the recommended way to install SCENIC+ as it handles dependencies efficiently and works on macOS, Linux, and Windows.

**Requirements:**
- Python 3.11 (Python 3.12 not yet supported due to dependency incompatibilities)
- HDF5 library (see platform-specific instructions in [UV_SETUP.md](UV_SETUP.md))

**Quick Start:**

```bash
# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh

# Clone the repository
git clone https://github.com/aertslab/scenicplus
cd scenicplus

$ conda create --name scenicplus python=3.11 -y
$ conda activate scenicplus
$ git clone https://github.com/aertslab/scenicplus
$ cd scenicplus
$ pip install .
# Install dependencies and SCENIC+
uv sync

# Run Python with uv
uv run python your_script.py
```

For detailed setup instructions, troubleshooting, and platform-specific requirements, see [UV_SETUP.md](UV_SETUP.md).

### Alternative: Install with conda/pip

If you prefer conda, you can install SCENIC+ in a new conda environment:

```bash
conda create --name scenicplus python=3.11 -y
conda activate scenicplus
git clone https://github.com/aertslab/scenicplus
cd scenicplus
pip install .
```

## Questions?
Expand Down
103 changes: 103 additions & 0 deletions UV_SETUP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# UV Setup for SCENIC+

This project is now configured to use `uv`, a fast Python package installer and resolver.

## Prerequisites

1. **Python Version**: This project currently requires **Python 3.11**. Python 3.12 is not yet supported due to the `sinfo` package incompatibility (used by `scanpy`).

2. Install HDF5 (required for tables package):

**macOS:**
```bash
brew install hdf5
```

**Linux:**
```bash
# Ubuntu/Debian
sudo apt-get install libhdf5-dev

# Fedora/RHEL
sudo dnf install hdf5-devel
```

**Windows:**

On Windows, the pre-built wheels for `tables` 3.10+ should work without manually installing HDF5. If you encounter issues, you can install HDF5 via conda:
```bash
conda install -c conda-forge hdf5
```

## Installation

1. Install uv:
```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
```

2. Sync dependencies:
```bash
uv sync
```

The project includes a dependency override for the `tables` package to use version 3.10+ instead of the problematic 3.9.2, avoiding compilation issues on macOS.

## Running Python with uv

Use `uv run` to execute Python commands in the managed environment:

```bash
uv run python your_script.py
uv run python -c "import scenicplus"
```

## How It Works

The `pyproject.toml` file includes a `[tool.uv]` section with an override:

```toml
[tool.uv]
override-dependencies = [
"tables>=3.10"
]
```

This ensures that even though some dependencies (like `scanpy`) pin `tables==3.9.2`, uv will use version 3.10+ which has pre-built wheels for Apple Silicon and avoids compilation errors.

## Troubleshooting

### tables Compilation Errors

If you see compilation errors mentioning `fdopen` or `zutil.c`, the `tables` package is trying to build from source. This should not happen with the current setup, but if it does:

1. Ensure your `pyproject.toml` has the override-dependencies section shown above
2. Delete `uv.lock` and regenerate:
```bash
rm uv.lock
uv lock
uv sync
```

### Verifying Installation

Check that tables 3.10+ is installed:
```bash
uv run python -c "import tables; print(tables.__version__)"
```

You should see version 3.10.2 or later.

## Development

The project uses:
- Python 3.11 (3.12 support blocked by `sinfo` package used by `scanpy`)
- uv for package management and virtual environment
- All dependencies specified in `requirements.txt`
- Dependency overrides in `pyproject.toml` for compatibility:
- `tables>=3.10` (fixes macOS compilation issues)
- `ray>=2.51.0` (adds Python 3.12 wheel support, ready for when Python 3.12 is supported)

### Python 3.12 Status

Python 3.12 support is currently blocked by the `sinfo` package (v0.3.4), which uses `configparser.SafeConfigParser` (removed in Python 3.12). This package is a dependency of `scanpy` v1.8.2 and is only used for the optional `sc.logging.print_versions()` function. Once `scanpy` updates or removes this dependency, Python 3.12 will be supported.
1 change: 1 addition & 0 deletions constraints.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tables>=3.10
11 changes: 7 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ authors = [
description = "SCENIC+ is a python package to build gene regulatory networks (GRNs) using combined or separate single-cell gene expression (scRNA-seq) and single-cell chromatin accessibility (scATAC-seq) data."
readme = "README.md"
version = "1.0a2"
requires-python = ">=3.8,<=3.11.8"
requires-python = ">=3.11,<3.12"
keywords = ["scATAC", "GRN inference", "eGRN inference"]
license = { file = "LICENCE.txt" }
classifiers = [
Expand All @@ -23,9 +23,6 @@ classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering :: Bio-Informatics",
]
Expand All @@ -34,6 +31,12 @@ dynamic = ["dependencies"]
[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}

[tool.uv]
override-dependencies = [
"tables>=3.10",
"ray>=2.51.0"
]

[project.optional-dependencies]
docs = [
"sphinx_rtd_theme",
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,8 @@ seaborn==0.13.2
# pycistopic
# scanpy
# scenicplus (pyproject.toml)
sinfo==0.3.4
# sinfo==0.3.4 removed - not compatible with Python 3.12
# scanpy will work without it (only used for session_info.show() function)
# via scanpy
six==1.16.0
# via
Expand Down
Loading