Skip to content

Conversation

Copy link

Copilot AI commented Nov 20, 2025

The issue requested locating the highlighter plot code in the repository. This PR documents all files containing highlighter plot implementation and integration.

Key Files Located

Core implementation:

  • phylobook/projects/utils/highlighter.py (951 lines)
    • Highlighter class: sequence alignment analysis, mismatch/match detection, APOBEC/G→A mutations, stop codons, glycosylation sites
    • HighlighterPlot class: SVG/PNG generation via ReportLab, LANL/ML color schemes, tree-based sorting

Django integration:

  • phylobook/projects/models.py: file naming methods, has_svg_highlighter() plot generation
  • phylobook/projects/views.py: highlighter data parsing and serving
  • phylobook/projects/templates/displayproject.html: plot rendering with legends
  • phylobook/projects/utils/tree.py: SVG generation utilities
  • phylobook/projects/management/commands/prerun_svgs.py: batch SVG pregeneration

Architecture

The highlighter plot system analyzes sequence alignments against reference sequences and visualizes mutations as colored marks. Supports both nucleotide and amino acid sequences with configurable color schemes, sorting strategies (similarity/tree-based), and special mutation markers (circles for APOBEC, diamonds for G→A).

# Core usage pattern from models.py:742-778
mutation_plot = highlighter.HighlighterPlot(alignment, seq_type=seq_type, tree=tree)
mutation_plot.draw_mismatches(output_file, apobec=True, g_to_a=True, 
                               glycosylation=True, sort="tree", scheme="LANL")
Original prompt

Search this repo for the code for the highlighter plot


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Search repository for highlighter plot code Document highlighter plot code locations Nov 20, 2025
Copilot AI requested a review from c-barry November 20, 2025 10:57
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