-
Notifications
You must be signed in to change notification settings - Fork 1
Add species pages with treefile lookup #74
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
Conversation
There was a problem hiding this 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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Motivation
TaxonomicAssignmentrecords matching a species to help navigation and filtering.Description
MARC_TREE_FPenvironment variable and helpertreefile_for_species()to map a species name to a{lower_with_underscores}.treefilefilename.@app.route('/species/<path:species_name>')that counts matchingTaxonomicAssignmentrows and reads the treefile fromMARC_TREE_FPif present, exposingtree_content,tree_path, andtree_errorto templates.app/templates/show_isolate.html,app/templates/show_taxonomic_assignment.html, andapp/templates/show_assembly.html.app/templates/show_species.htmlto display the assignment count and either the treefile contents, an error message, or guidance to setMARC_TREE_FP.app/nl_query.py(reworkedGENERATE_QUERY_PROMPTlambda formatting).Testing
black .which reformatted one file and completed successfully.pytest tests/and all automated tests passed (9 passedreported).Codex Task