10000 [WIP] Add overlay command for multi-structure visualizations by t03i · Pull Request #13 · t03i/FlatProt · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[WIP] Add overlay command for multi-structure visualizations #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jun 10, 2025

Conversation

t03i
Copy link
Owner
@t03i t03i commented Jun 6, 2025

Summary

Adds a new flatprot overlay command that combines multiple protein structures into single visualization with automatic clustering and alignment capabilities.

This replaces the example klk_overlay.py script with a production-ready CLI command fully integrated into FlatProt's ecosystem.

Features

  • Multiple file input via glob patterns (e.g., "folder/*.cif")
  • Automatic Foldseek-based clustering with opacity scaling
  • Two alignment modes: family-identity and inertia-based
  • Multiple output formats: SVG, PNG, PDF (PNG/PDF require Cairo)
  • Configurable canvas size, DPI, and styling
  • Built-in error handling and validation

Implementation

  • CLI command: src/flatprot/cli/overlay.py
  • Core utilities: src/flatprot/utils/overlay_utils.py
  • Comprehensive test suite: 41 tests (5 CLI + 19 integration + 17 unit)
  • Documentation: docs/commands/overlay.md
  • Integration with main CLI via src/flatprot/cli/main.py

Examples

# Basic overlay from glob pattern
flatprot overlay "structures/*.cif" -o overlay.png

# Family-aligned overlay with high DPI
flatprot overlay *.cif --family 3000114 --dpi 600 -o result.pdf

# Inertia-based alignment without clustering
flatprot overlay file1.cif file2.cif --alignment-mode inertia --no-clustering -o simple.svg

Testing Status

✅ All 357 tests passing
✅ Complete test coverage for overlay functionality
✅ Integration tests for CLI interface
✅ Unit tests for utility functions
✅ Error handling and edge cases covered

Requirements

For PNG/PDF output, Cairo graphics library is required:

  • macOS: brew install cairo
  • Ubuntu: sudo apt-get install libcairo2-dev
  • Windows: Install Cairo binaries or use conda

TODO

  • Review and feedback
  • Production deployment testing
  • Performance benchmarking on large datasets

t03i added 11 commits June 6, 2025 17:08
Add comprehensive overlay functionality that combines multiple protein
structures into single visualization with automatic clustering and
alignment capabilities.

Features:
- Multiple file input via glob patterns (e.g., "folder/*.cif")
- Automatic Foldseek-based clustering with opacity scaling
- Two alignment modes: family-identity and inertia-based
- Multiple output formats: SVG, PNG, PDF (PNG/PDF require Cairo)
- Configurable canvas size, DPI, and styling
- Built-in error handling and validation

Implementation:
- CLI command: src/flatprot/cli/overlay.py
- Core utilities: src/flatprot/utils/overlay_utils.py
- Comprehensive test suite: 41 tests (5 CLI + 19 integration + 17 unit)
- Documentation: docs/commands/overlay.md
- Integration with main CLI via src/flatprot/cli/main.py

Replaces example script klk_overlay.py with production-ready command
integrated into FlatProt's CLI ecosystem.
@t03i t03i marked this pull request as ready for review June 10, 2025 10:19
@t03i t03i merged commit 7a09088 into main Jun 10, 2025
3 checks passed
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.

1 participant
0