This guide provides step-by-step instructions for setting up a fresh machine for GenePT data curation and analysis. Most of these are standard setups, this file just collects them all here in case you forgot how to do them.
- OS: Ubuntu/Linux (tested on Ubuntu with Linux 6.14.0)
- Python: 3.10 (required for scGPT compatibility)
- Storage: At least 200GB free space for datasets
- RAM: 16GB minimum, 32GB+ recommended for large datasets
# Create main data directory
sudo mkdir -p /data
sudo chown $USER:$USER /data
cd /datagit clone https://github.com/honicky/GenePT-tools.git
cd GenePT-tools/# Install UV for Python package management
curl -LsSf https://astral.sh/uv/install.sh | sh
# Add UV to PATH
source $HOME/.local/bin/env
# Verify installation
uv --version# Install NVM (Node Version Manager)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
# Load NVM
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
# Install latest Node.js
nvm install node
# Install Claude Code CLI
npm install -g @anthropic-ai/claude-codecd /data/GenePT-tools
# Install base dependencies
uv sync
# Install development tools (includes JupyterLab, pytest, formatters)
uv sync --extra dev
# Install package in editable mode
uv pip install -e '.[dev]'# UV automatically manages the environment, but if you need manual activation:
source /data/GenePT-tools/.venv/bin/activate# Create AWS config directory
mkdir -p ~/.aws
# Create AWS config file
cat > ~/.aws/config << 'EOF'
[default]
region = us-east-1
output = json
EOF
# Create AWS credentials file
cat > ~/.aws/credentials << 'EOF'
[default]
aws_access_key_id = YOUR_ACCESS_KEY_ID
aws_secret_access_key = YOUR_SECRET_ACCESS_KEY
EOF
# Set proper permissions
chmod 600 ~/.aws/credentials# Copy example environment file
cp .env.example .env
# Edit .env file and add your keys:
# OPENAI_API_KEY=your_openai_key_here
# HF_TOKEN=your_huggingface_token_here
# HF_WRITE_TOKEN=your_huggingface_write_token_here
# WANDB_API_KEY=your_wandb_key_here# Create data storage directories
mkdir -p data/cellxgene
mkdir -p data/GenePT_embedding_v2
mkdir -p save
mkdir -p img# Example: Download Tabula Sapiens or other datasets
# These will be downloaded automatically when running notebooks# Start JupyterLab (with uv)
uv run python -m jupyterlab --no-browser --port=8888
# Or with specific options
uv run jupyter lab --port=8888 --no-browser --ip=0.0.0.0# Format Python code
uv run yapf --in-place --recursive src/ test/
# Sort imports
uv run isort --gitignore .
# Format notebooks
uv run black --target-version py310 notebooks/# Run all tests
uv run pytest
# Run specific test file
uv run pytest test/test_inference.py -v# Already included in dev dependencies
# Run DuckDB CLI
uv run duckdb# Install any additional packages as needed
uv pip install package_nameRun these commands to verify your setup:
# Check Python version
python --version # Should be 3.10.x
# Check UV installation
uv --version
# Check virtual environment
which python # Should point to .venv/bin/python
# Check key dependencies
uv pip list | grep -E "torch|anndata|openai|pandas|scanpy"
# Test imports
python -c "import torch, anndata, openai, pandas, scanpy; print('All imports successful')"
# Check AWS access (if configured)
aws s3 ls # Should list buckets if configured
# Check git status
git status- Start JupyterLab:
uv run jupyter lab - Open browser at provided URL
- Start with
notebooks/notebook_setup.ipynb - Follow notebook documentation in
notebooks/README.md
# Use the optimized shuffle script for large embeddings
uv run python scripts/shuffle_embeddings_optimized.py --help- Configure API keys in
.env - Run
notebooks/generate_genept_embeddings.ipynb - Upload to HuggingFace using
notebooks/create_hf_repos.ipynb
-
UV command not found
source $HOME/.local/bin/env # Or add to .bashrc/.zshrc
-
Python version mismatch
# UV will handle Python 3.10 automatically uv python pin 3.10 -
Memory issues with large datasets
- Use
AnnDataChunkerfor processing - Increase swap space if needed
- Use sparse matrix operations
- Use
-
JupyterLab kernel issues
uv run python -m ipykernel install --user --name genept
- Never commit
.envfile or AWS credentials - Keep API keys secure and rotate regularly
- Use read-only tokens when possible
- Review code before running from notebooks
- Review
CLAUDE.mdfor project-specific guidelines - Explore notebooks in order (see
notebooks/README.md) - Run tests to ensure everything works
- Start with small datasets before scaling up