Installation¶
Requirements¶
online-fdr requires Python 3.10 or higher and has minimal dependencies:
numpy >= 1.20.0scipy >= 1.9.0
Install from PyPI (Recommended)¶
The easiest way to install online-fdr is using pip:
Install with Optional Dependencies¶
For development and extended functionality:
pytest >= 7.0 - pytest-cov >= 4.0 - ruff >= 0.1.0 - mypy >= 1.0 - build >= 1.2 git clone https://github.com/OliverHennhoefer/online-fdr.git
cd online-fdr
uv sync --group dev --group parity
rpy2 >= 3.5 for the live Bioconductor parity tests. mkdocs-material >= 9.0 - mkdocstrings[python] >= 0.20 - mkdocs-git-revision-date-localized-plugin >= 1.2 - mkdocs-minify-plugin >= 0.6 Live R Parity Setup (Developers)¶
The parity suite compares Python results against Bioconductor onlineFDR through rpy2. New contributors only need this setup when they run the live R parity tests.
- Install R
4.5.xand make sureRandRscriptare onPATH. - macOS: install R from CRAN or with Homebrew, then open a new shell.
- Windows: install R for Windows and run the commands below in PowerShell.
- Ubuntu/WSL: install R
4.5.x; ifrpy2needs native libraries, installbuild-essential libffi-dev libtirpc-dev r-base-dev. - Install Python development and parity dependencies:
- Install the pinned Bioconductor package:
Rscript -e "options(repos = c(CRAN = 'https://cloud.r-project.org')); if (!requireNamespace('BiocManager', quietly = TRUE)) install.packages('BiocManager')"
Rscript -e "BiocManager::install(version = '3.22', ask = FALSE, update = FALSE)"
Rscript -e "BiocManager::install('onlineFDR', version = '3.22', ask = FALSE, update = FALSE)"
Rscript -e "stopifnot(as.character(utils::packageVersion('onlineFDR')) == '2.18.0')"
- Verify the bridge from Python to R:
Rscript --version
uv run python -c "import rpy2.robjects as ro; print(ro.r('R.version.string')[0])"
uv run python -m pytest -m live_r_parity tests/test_onlinefdr_parity.py tests/test_async_methods.py -q
If Bioconductor reports that version 3.22 requires R 4.5, upgrade R and rerun the Rscript commands.
Install from Source¶
For the latest development version or to contribute:
Using Git¶
Using uv (Recommended for Development)¶
uv provides faster and more reliable dependency management:
# Install uv if you haven't already
pip install uv
# Clone and install
git clone https://github.com/OliverHennhoefer/online-fdr.git
cd online-fdr
uv sync --group dev --group docs
Development Setup¶
For contributors, set up a complete development environment:
git clone https://github.com/OliverHennhoefer/online-fdr.git
cd online-fdr
# Install development and documentation dependencies
uv sync --group dev --group docs
# Run tests to verify installation
uv run python -m pytest -q
Verify Installation¶
Test your installation by running:
import online_fdr
from online_fdr.p_values import Addis
# Create a simple test
addis = Addis(alpha=0.05, wealth=0.025, lambda_=0.25, tau=0.5)
result = addis.test_one(0.01)
print(f"ADDIS test result: {result}") # Should print: True
print(f"Package version: {online_fdr.__version__}")
Troubleshooting¶
Common Issues¶
Import Error: No module named 'online_fdr'
- Ensure you've activated the correct virtual environment
- Try reinstalling:
pip uninstall online-fdr && pip install online-fdr
numpy/scipy Version Conflicts
- Update your dependencies:
pip install --upgrade numpy scipy - For conda users:
conda update numpy scipy
Permission Denied During Installation
- Use a virtual environment:
python -m venv venv && source venv/bin/activate - Or install for current user only:
pip install --user online-fdr
Platform-Specific Notes¶
- Use PowerShell or Command Prompt
- If using Anaconda, activate your environment first:
- Xcode command line tools may be required for compiling dependencies
- Install with:
xcode-select --install
- Most distributions work out of the box
- For older systems, ensure you have a recent Python version
Virtual Environments¶
We strongly recommend using virtual environments to avoid dependency conflicts:
Next Steps¶
Once installed successfully:
- Read the Quick Start Guide for your first online FDR experiment
- Browse Examples to see real-world applications
- Explore API Documentation for detailed method references
- Study Theory to understand the mathematical foundations
Need Help?¶
- Check existing issues: GitHub Issues
- Ask questions: GitHub Discussions
- Report bugs: Submit a new issue