Skip to content

feat: Add Docker support with PLIP and PyMOL integration#87

Open
jolakopec wants to merge 10 commits intooxpig:mainfrom
jolakopec:feat/dockerization
Open

feat: Add Docker support with PLIP and PyMOL integration#87
jolakopec wants to merge 10 commits intooxpig:mainfrom
jolakopec:feat/dockerization

Conversation

@jolakopec
Copy link

Summary

This PR adds Docker support to STCRpy, making it easier to run the complete pipeline including PLIP interaction profiling and PyMOL visualizations
without complex dependency management.

Changes

  • Dockerfile: Base image with STCRpy + PLIP + PyMOL support
  • Dockerfile.ml: ML variant with PyTorch, scikit-learn, and all visualization tools
  • docker-compose.yml: Service orchestration for easy container management
  • .dockerignore: Optimized build context
  • Bug fix: Improved PLIP binding site ID tracking in interaction data

Features

  • ✅ Full STCRpy functionality (fetch, load, save, geometry calculations)
  • ✅ PLIP interaction profiling
  • ✅ PyMOL 3D visualizations and heatmap generation
  • ✅ ML dataset creation (Dockerfile.ml)
  • ✅ All dependencies pre-installed (OpenBabel, Qt5, ANARCI models)

Testing

Tested against existing test suite:

  • 52 out of 53 tests passing (98% pass rate)
  • All README examples working
  • Successfully generated interaction heatmaps and visualizations
  • Verified with 5 TCR:pMHC complexes (8gvb, 7pb2, 6eqa, 4ftv, 4jff)

Usage

# Build and run base image
docker build -t stcrpy .
docker run --rm \
  -v $(pwd)/data:/app/data \
  -v $(pwd)/output:/app/output \
  stcrpy python your_script.py

# Build ML variant
docker build -t stcrpy-ml -f Dockerfile.ml .
docker run --rm \
  -v $(pwd)/data:/app/data \
  -v $(pwd)/output:/app/output \
  stcrpy-ml python your_script.py

# Or use docker-compose
docker-compose up

Example: Run interaction profiling
docker run --rm \
  -v $(pwd)/data:/app/data \
  -v $(pwd)/output:/app/output \
  stcrpy python -c "
import stcrpy
tcr = stcrpy.fetch_TCRs('8gvb')[0]
tcr.profile_peptide_interactions()
tcr.get_interaction_heatmap(plotting_kwargs={'save_as': '/app/output/heatmap.png'})
"
# Heatmap saved to ./output/heatmap.png


Benefits

- No manual dependency installation
- Consistent environment across platforms
- Easy CI/CD integration
- Simplified onboarding for new users

@benjiemc
Copy link
Contributor

Thank you for the PR Jola!

I have added a few commits to clean up the Docker setup a bit:

  • There is now only 1 Dockerfile (regular and ML were merged)
  • UV was removed as virtual environments aren't really necessary with Docker
  • The documentation files were merged into the main README

Let us know if you disagree with any of these changes, and we can discuss.

@npqst could you review the changes in this commit concerning the PLIP IDs. I am less familiar with the interaction profiling.

@benjiemc benjiemc requested a review from npqst November 25, 2025 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants