Skip to content

feat: generate taxa tree from assemblies and display accurate assembly count in sunburst (#522) #550

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

Merged
merged 9 commits into from
May 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ export const NodeDetails: React.FC<NodeDetailsProps> = ({
// Create the appropriate display text based on node type
let filterLinkText = "Browse All Assemblies";
if (!isRoot) {
filterLinkText = `View assemblies for ${nodeName}`;
const assemblyCount = node.data.assembly_count;
const assemblySuffix = assemblyCount > 1 ? "ies" : "y";
Copy link
Preview

Copilot AI May 24, 2025

Choose a reason for hiding this comment

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

The pluralization logic treats 0 as singular ("Assembly"). Change the condition to assemblyCount !== 1 so that 0, 2+ use the plural form.

Suggested change
const assemblySuffix = assemblyCount > 1 ? "ies" : "y";
const assemblySuffix = assemblyCount !== 1 ? "ies" : "y";

Copilot uses AI. Check for mistakes.

filterLinkText = `View ${assemblyCount} Assembl${assemblySuffix} for ${nodeName}`;
}

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ import data from "catalog/output/ncbi-taxa-tree.json";
* Interface representing a node in the NCBI taxonomy tree
*/
export interface TaxonomyNode {
/**
* The number of assemblies for the taxon that are present in the catalog
*/
assembly_count: number;

/**
* Child nodes in the taxonomy tree
*/
Expand Down
2,284 changes: 1,142 additions & 1,142 deletions catalog/build/intermediate/genomes-from-ncbi.tsv

Large diffs are not rendered by default.

34 changes: 17 additions & 17 deletions catalog/build/intermediate/outbreak-taxonomy-mapping.tsv
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
taxonomy_id name rank
5207 Cryptococcus neoformans SPECIES
11050 Flaviviridae FAMILY
11320 Influenza A virus
4827 Mucorales ORDER
5052 Aspergillus GENUS
11018 Togaviridae FAMILY
199306 Coccidioides posadasii SPECIES
12058 Picornaviridae FAMILY
5037 Histoplasma capsulatum SPECIES
1980415 Nairoviridae FAMILY
3418604 Betacoronavirus pandemicum SPECIES
11158 Paramyxoviridae FAMILY
38574 Leishmania donovani species complex SPECIES_GROUP
1773 Mycobacterium tuberculosis SPECIES
5807 Cryptosporidium parvum SPECIES
1980418 Phenuiviridae FAMILY
1980413 Hantaviridae FAMILY
11266 Filoviridae FAMILY
11018 Togaviridae FAMILY
10244 Monkeypox virus SPECIES
5763 Naegleria fowleri SPECIES
1980416 Peribunyaviridae FAMILY
5833 Plasmodium falciparum SPECIES
1980418 Phenuiviridae FAMILY
3418604 Betacoronavirus pandemicum SPECIES
498019 Candidozyma auris SPECIES
11158 Paramyxoviridae FAMILY
38574 Leishmania donovani species complex SPECIES_GROUP
5763 Naegleria fowleri SPECIES
10244 Monkeypox virus SPECIES
1980413 Hantaviridae FAMILY
5207 Cryptococcus neoformans SPECIES
5807 Cryptosporidium parvum SPECIES
11320 Influenza A virus
5052 Aspergillus GENUS
1980416 Peribunyaviridae FAMILY
11050 Flaviviridae FAMILY
1980415 Nairoviridae FAMILY
4827 Mucorales ORDER
11617 Arenaviridae FAMILY
5037 Histoplasma capsulatum SPECIES
3 changes: 3 additions & 0 deletions catalog/build/py/build-files-from-ncbi.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
1913637: "Mucoromycota",
}

# TAXONOMIC_LEVELS_FOR_TREE should be listed in order, as the order is used in building the taxonomy tree;
# higher-level categories should be listed earlier than lower-level categories (while categories that are
# at the same level, such as domain and realm, can be listed in any order relative to each other)
TAXANOMIC_LEVELS_FOR_TREE = [
"domain",
"realm",
Expand Down
Loading
Loading