Add annotation plots above intersection bars - #23
Conversation
Add comprehensive development documentation including project architecture, essential commands, testing infrastructure, and key dependencies for Claude Code integration. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add preprocess_annotation_data() to aggregate attributes by intersection - Add create_intersection_summary() for intersection metadata - Add validate_annotation_attributes() for input validation - Support preserving original item data for annotation plots - Handle missing values and edge cases gracefully
- Create AnnotationSpec class for plot configuration - Implement boxplot, violin, strip, and bar chart annotation types - Add create_annotation_plot() with support for custom colors and tooltips - Support flexible annotation specification parsing (dict/list formats) - Enable color encoding by categorical attributes - Align annotation plots with main UpSet x-axis for proper layout
- Add integrate_annotation_charts() function for vertical layout management - Stack annotation charts above intersection bars and main plot - Maintain proper spacing and alignment between all components - Support empty annotation lists with fallback to original layout
- Add annotations parameter to UpSetAltair() function with flexible input formats
- Support dict format: {'attribute': {'type': 'boxplot', 'height': 100}}
- Support list format with AnnotationSpec objects
- Integrate annotation processing with existing validation pipeline
- Update UpSetChart class to store annotation data for access
- Maintain full backward compatibility with existing API
- Export AnnotationSpec class for advanced usage
- Add 22 test cases covering all annotation plot types and features - Test basic annotations: boxplot, violin, strip, bar charts - Test genomic use cases: expression levels, fold changes, p-values - Test data handling: missing values, empty intersections, aggregation - Test integration: sorting, custom colors, abbreviations compatibility - Test error handling: invalid attributes, unsupported types - Test custom specifications and layout alignment - All tests pass with 78% code coverage
|
Claude finished @edmundmiller's task —— View job PR Review AnalysisI've completed a comprehensive review of this PR that adds annotation plots functionality. Here's my detailed analysis: Review Checklist
Overall Assessment: Strong Implementation ✅This is a well-architected feature addition that maintains high code quality standards. The implementation is clean, well-documented, and properly integrated with the existing codebase. 🎯 StrengthsCode Quality & Architecture
Implementation Details
Testing
🔍 Detailed Code Review
|
Summary
Add support for annotation plots above intersection bars, similar to the ComplexUpset R library functionality. This enables visualization of additional data attributes (like expression levels, p-values, fold changes) alongside set intersection analysis.
Key Features
Example Usage
Implementation Details
Files Changed
altair_upset/annotations.py- New annotation plot generatorsaltair_upset/preprocessing.py- Data aggregation and validationaltair_upset/components.py- Chart integration and layoutaltair_upset/upset.py- Extended main API with annotations parameteraltair_upset/__init__.py- Export AnnotationSpec classtests/test_annotations.py- Comprehensive test suiteTest Coverage
✅ All annotation plot types (boxplot, violin, strip, bar)
✅ Genomic use cases (expression, fold change, p-values)
✅ Data handling (missing values, empty intersections)
✅ Integration with existing features (sorting, colors, abbreviations)
✅ Error handling (invalid inputs, edge cases)
✅ Custom specifications and layout alignment
✅ Backward compatibility (all existing tests pass)
🤖 Generated with Claude Code