Skip to content
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

Add secondTreeOptions for GroupSource #1114

Open
joverlee521 opened this issue Jan 30, 2025 · 4 comments
Open

Add secondTreeOptions for GroupSource #1114

joverlee521 opened this issue Jan 30, 2025 · 4 comments
Labels
enhancement New feature or request source: office hours Issue mentioned during office hours

Comments

@joverlee521
Copy link
Contributor

Context

A user of Nextstrain Groups asked in office hours if it there was a configuration to add the second tree drop-down in the sidebar of datasets.
For example, when viewing the core seasonal-flu/h3n2/ha/2y build, there is a "seasonal-flu/h3n2/na/2y" option available:

Image

Based on Auspice docs, the secondTreeOptions should be returned by the /charon/getAvailable endpoint. The nextstrain.org/charon/getAvailable endpoint does return the secondTreeOptions from the source. However, the GroupSource does not have a secondTreeOptions method, so it will always return an empty array of the base Source class.

From a high level, it seems feasible to add a secondTreeOptions method to the GroupSource that parses the Group's available datasets and use generateSecondTreeOptions to return valid second tree options.

@joverlee521 joverlee521 added enhancement New feature or request source: office hours Issue mentioned during office hours labels Jan 30, 2025
@joverlee521
Copy link
Contributor Author

joverlee521 commented Jan 30, 2025

Ah, I see the core source depends on the hard-coded manifest.json to define segment level keys in order to generate the valid second tree options. So this is not as straightforward for Groups datasets because we don't know which part of the URL defines the segments...

@tsibley
Copy link
Member

tsibley commented Jan 30, 2025

Yeah. Elsewhere, @jameshadfield and I have previously discussed this too, though I can't remember where exactly. I think in GitHub issues/PRs; should dig. There are some options, and I think it's mostly a matter of prioritizing this feature. It's good to know that it was asked about!

@tsibley
Copy link
Member

tsibley commented Jan 30, 2025

@jameshadfield
Copy link
Member

I think there's short answers and long answers. Short term we could use some heuristic to filter other datasets in that group down to a meaningful set (e.g. the options represent "other segments") and offer them as options. Or we could offer them all as potential second trees, and perhaps rejig the dropdown in auspice to allow typing to filter (like the "Filter Data" dropdown currently does).

The longer answer is perhaps best summarised in this (internal) google doc which is talking about how to change the (main) dataset, but I think is also applicable to the second tree options. Concrete example where the current approach is limiting: in avian-flu/h5n1/ha/all-time the second tree options are the other 7 segments, but it's very useful to compare h5n1 vs h5nx, or perhaps all-time vs 2y, options which are only currently available by editing the URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request source: office hours Issue mentioned during office hours
Projects
None yet
Development

No branches or pull requests

3 participants