Skip to content

Conversation

@Ulthran
Copy link
Contributor

@Ulthran Ulthran commented Jan 28, 2026

Motivation

  • Provide per-species pages so users can click species names and view related data and trees.
  • Allow the app to load iqtree/newick treefiles from a configurable filesystem root via an env var.
  • Surface counts of TaxonomicAssignment records matching a species to help navigation and filtering.

Description

  • Add MARC_TREE_FP environment variable and helper treefile_for_species() to map a species name to a {lower_with_underscores}.treefile filename.
  • Add route @app.route('/species/<path:species_name>') that counts matching TaxonomicAssignment rows and reads the treefile from MARC_TREE_FP if present, exposing tree_content, tree_path, and tree_error to templates.
  • Link suspected organism and taxonomic classification values to the new species page by updating app/templates/show_isolate.html, app/templates/show_taxonomic_assignment.html, and app/templates/show_assembly.html.
  • Add new template app/templates/show_species.html to display the assignment count and either the treefile contents, an error message, or guidance to set MARC_TREE_FP.
  • Small prompt-formatting tweak in app/nl_query.py (reworked GENERATE_QUERY_PROMPT lambda formatting).

Testing

  • Ran black . which reformatted one file and completed successfully.
  • Ran pytest tests/ and all automated tests passed (9 passed reported).

Codex Task

Copilot AI review requested due to automatic review settings January 28, 2026 17:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds per-species pages to the web interface, enabling users to view taxonomic assignment counts and associated phylogenetic tree files for each species. The implementation reads tree files from a configurable directory via the MARC_TREE_FP environment variable.

Changes:

  • Added /species/<path:species_name> route that queries taxonomic assignment counts and reads corresponding tree files
  • Converted species/organism names in templates to clickable links that navigate to the new species pages
  • Added treefile_for_species() helper function that maps species names to treefile filenames using a lowercase-with-underscores convention

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
app/app.py Added MARC_TREE_FP environment variable, treefile_for_species() helper, and show_species() route with database query and file reading logic
app/templates/show_species.html New template displaying species name, taxonomic assignment count, and tree file content with error handling
app/templates/show_taxonomic_assignment.html Made classification field a clickable link to species page
app/templates/show_isolate.html Made suspected organism field a clickable link to species page
app/templates/show_assembly.html Made classification values in taxonomic assignments table clickable links to species pages
app/nl_query.py Minor formatting change wrapping lambda assignment in parentheses (no functional change)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Ulthran Ulthran merged commit c6ff42c into main Jan 28, 2026
5 checks passed
@Ulthran Ulthran deleted the codex/add-tree-display-and-species-links branch January 28, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant