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

Drag-n-drop metadata shows in second tree #1489

Merged
merged 2 commits into from
Mar 21, 2022
Merged

Conversation

jameshadfield
Copy link
Member

Tips present only in the second tree will be correctly coloured, and
appear in the legend. However there are two (long-standing) bugs /
shortcomings related to the second tree which are relevant here:

  1. Trait values which only appear in tips in the second tree will not be
    available as filtering options (they will be correctly shown on the tree
    and in the legend, however).

  2. The tip-counts, as they appear in the header, only consider the main
    (left) tree. For instance, if you have a metadata CSV with information
    on 100 tips in the left tree, and 150 tips in the right tree (and 100
    are in both), and you filter to the strains which appear in the dropped
    CSV (the colouring is the same name as the file). The header will now
    indicate "Showing 100 of XXX genomes", despite the fact that all 150
    strains in the second tree are displayed.

Both of these bugs are not specific to drag-n-drop metadata, the same
situations happen with any colouring / filter.

Closes #1488

The reducer was previously responding to a whole range of actions even
if there was no second tree! There were enough checks in the code
that this didn't result in bugs, but it's conceptually simpler
to avoid trying to modify the second tree when it doesn't exist!
Tips present only in the second tree will be correctly coloured, and
appear in the legend. However there are two (long-standing) bugs /
shortcomings related to the second tree which are relevant here:

1. Trait values which only appear in tips in the second tree will not be
available as filtering options (they will be correctly shown on the tree
and in the legend, however).

2. The tip-counts, as they appear in the header, only consider the main
(left) tree. For instance, if you have a metadata CSV with information
on 100 tips in the left tree, and 150 tips in the right tree (and 100
are in both), and you filter to the strains which appear in the dropped
CSV (the colouring is the same name as the file). The header will now
indicate "Showing 100 of XXX genomes", despite the fact that all 150
strains in the second tree are displayed.

Both of these bugs are not specific to drag-n-drop metadata, the same
situations happen with any colouring / filter.

Closes #1488
@nextstrain-bot nextstrain-bot temporarily deployed to auspice-bug-csv-two-tre-ucwxdr March 17, 2022 22:02 Inactive
@emmahodcroft
Copy link
Member

This is really fantastic James, thank you!
I notice the tip-labels function also changes between the two, which is also fantastic (switch between sample name & internal ID). Even with the caveats, this making looking at trees with drag-and-drop data way more cool and better!

@jameshadfield jameshadfield merged commit ff8114f into master Mar 21, 2022
@jameshadfield jameshadfield deleted the bug/csv-two-trees branch March 21, 2022 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Allow drag-n-drop files to work on both tanglegram trees
3 participants