Implement genomic figure rendering and template management features#16
Merged
alsmith151 merged 16 commits intomainfrom Mar 25, 2026
Merged
Implement genomic figure rendering and template management features#16alsmith151 merged 16 commits intomainfrom
alsmith151 merged 16 commits intomainfrom
Conversation
- Implemented `render.py` to handle conversion from templates to plottable figures, including `ResolvedTrack` and `RenderPlan` classes. - Created `template.py` to define the structure for genomic figure specifications in YAML format, including track and group specifications. - Enhanced `bed.py` to adjust label positioning for better visibility. - Updated `region.py` to ensure proper string representation of genomic regions. - Modified `pyproject.toml` to include dynamic dependencies and improved package metadata. - Added `requirements.txt` for additional dependencies including `pyyaml` and `rich`. - Introduced CLI integration tests in `test_cli.py` for validating YAML templates and command outputs. - Developed grouping strategy tests in `test_grouping.py` to ensure correct grouping behavior. - Created inference tests in `test_inference.py` to validate track classification and color assignment. - Added rendering tests in `test_render.py` to verify template compilation and group handling. - Implemented template model tests in `test_template.py` for round-trip serialization and YAML output. - Removed obsolete `fix_conflicts.py` script as it is no longer needed.
…ion and rendering - Implemented `plotnado init` command to generate a YAML template from track files using inference heuristics. - Added `plotnado plot` command to render plots for specified genomic regions based on a template. - Introduced `plotnado validate` command to validate templates and check for missing files or group reference errors. - Enhanced `GenomicFigure` class with a method to create figures directly from templates. - Created a `TemplateCompiler` to handle the conversion of templates into render plans for plotting. - Updated `Template` and `TrackSpec` classes to use `TemplateTrackType` for better clarity and type safety. - Added comprehensive tests for the new commands and functionalities, ensuring robustness and correctness.
…emplateTrackType values
…etics and BaseMultiColorAesthetics
…to BaseAesthetics
…rom aesthetics migration
…orators fire on import
…s theme application
… per track; remove doc-inject side effect
…; remove from __all__
- Improved docstrings across multiple modules including `render.py`, `template.py`, `theme.py`, and various track classes to provide clearer descriptions and usage examples. - Updated the `CoolerTrack`, `CapcruncherTrack`, and `CoolerAverage` classes with detailed docstrings for better understanding of their functionalities. - Refactored the `generate_figure_overloads.py` and `generate_kwargs.py` scripts to accommodate new track types and improve type hinting. - Adjusted CLI tests to ensure compatibility with recent changes in the `CliRunner` initialization. - Added tests for new track types in `test_figure_refactor.py` to validate their integration within the `GenomicFigure`. - Updated references in test files to reflect changes in file structure and naming conventions.
…lity - Deleted outdated design specification document. - Updated troubleshooting instructions for Python version and documentation build commands. - Enhanced CLI plot command to correctly handle data source keyword arguments. - Modified GenomicFigure to utilize new data source handling in add_track method. - Introduced source_kwarg_name method in ResolvedTrack for better data source resolution. - Added test fixture for cooler file and included a sample cooler file for testing. - Expanded CLI tests to include plotting functionality for cooler templates and validate output. - Ensured all references to TemplateTrackType are replaced with TrackType across the codebase.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request significantly improves the documentation for the PlotNado project, focusing on clarifying the dual Python API and CLI workflows, updating installation and development instructions, and providing comprehensive usage guides for both interfaces. The changes introduce new AI coding guidelines, overhaul the README and CLI documentation, and enhance discoverability of key features and best practices.
Major documentation improvements:
Modernized and expanded the
README.mdto clearly present both the Python API and CLI workflows, add quick start examples for each, and update installation and development instructions. The README now better guides users to choose the workflow that fits their needs and provides concise code and command-line examples. [1] [2] [3] [4]Overhauled the CLI documentation in
docs/cli.mdto describe the standard workflow (init,validate,plot), provide usage examples and option explanations for each command, and clarify how the CLI integrates with the Python API.Clarification and expansion of workflow concepts:
docs/index.mdto introduce the parallel Python API and template-driven CLI workflows, with clear examples and improved navigation to relevant documentation sections. [1] [2]docs/best_practices.mdanddocs/api_reference.md, including updated commands for running tests and building docs, and clarified entry points for key classes and models. [1] [2]AI coding guidelines and architecture documentation:
AGENTS.mdandCLAUDE.md), detailing project architecture, design decisions, extension points, and common pitfalls. These are tailored for different agent conventions and provide step-by-step instructions for adding new track types and ensuring code quality. [1] [2]Most important changes:
1. Documentation structure and workflow clarity
README.mdto distinguish Python API vs. CLI workflows, add quick start examples for both, and improve installation/development instructions. [1] [2] [3] [4]docs/cli.mdto explain the CLI's template-driven workflow, command usage, and integration with the Python API.docs/index.mdto introduce and exemplify the two main usage patterns, and improve navigation to other docs. [1] [2]2. Developer and testing workflow improvements
uvindocs/best_practices.md, and clarified the API reference for key entry points. [1] [2]3. AI coding guidelines and architecture
AGENTS.mdandCLAUDE.mdwith detailed architecture diagrams, extension instructions, and best practices for AI coding agents and contributors. [1] [2]These changes collectively make the project easier to use, extend, and maintain, while providing clear guidance for both end users and developers.