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

Reveal selected samples from a selected node in a tandem plot #243

Merged
merged 12 commits into from
Jul 10, 2020

Conversation

ElDeveloper
Copy link
Member

Users can now reveal selected samples by clicking on a node in the tree. Selections are shown when a node is clicked, and hidden when the node's menu is removed from the screen.

node-select

This was paired-programmed with @kwcantrell 🥇

@ElDeveloper ElDeveloper requested review from esayyari and fedarko July 8, 2020 19:00
@fedarko
Copy link
Collaborator

fedarko commented Jul 8, 2020

This is really exciting!

Haven't gone through the code yet but when I click on the root node I get the following browser error:

bruh

... and, after this, I can't select any nodes (the menus don't even come up; I just get the same error again, for both tips and internal nodes):

bruh2

Looks like Emperor is breaking somewhere? Not sure.

@ElDeveloper
Copy link
Member Author

@fedarko thanks for catching this, this is related to #237 once that's merged this shouldn't be a problem.

Copy link
Collaborator

@fedarko fedarko left a comment

Choose a reason for hiding this comment

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

This looks cool. I have a few (mostly minor) suggestions, but once those are addressed (and once the matching PR (#237) is merged in to master and we verify that it fixes the issues with this I brought up earlier), then this should be good to merge.

empress/support_files/js/empress.js Outdated Show resolved Hide resolved
empress/support_files/js/empress.js Outdated Show resolved Hide resolved
empress/support_files/js/empress.js Outdated Show resolved Hide resolved
empress/support_files/js/empress.js Outdated Show resolved Hide resolved
empress/support_files/js/empress.js Outdated Show resolved Hide resolved
empress/core.py Outdated
@@ -24,6 +24,8 @@
TEMPLATES = os.path.join(SUPPORT_FILES, 'templates')
SELECTION_CALLBACK_PATH = os.path.join(SUPPORT_FILES, 'js',
'selection-callback.js')
TIP_CLICK_CALLBACK_PATH = os.path.join(SUPPORT_FILES, 'js',
'tip-click-callback.js')
Copy link
Collaborator

Choose a reason for hiding this comment

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

This callback is called tip-click-callback, but it looks like this information is also sent over for internal nodes. Should this just be renamed to node-click-callback or something?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry, it looks like this conversation was marked as resolved but I don't think this change was applied...

empress/support_files/js/select-node-menu.js Show resolved Hide resolved

ec.decViews.scatter.setEmissive(0x000000, samples);
ec.sceneViews[0].needsUpdate = true;
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

This code looks OK, but would suggest renaming the module to node-click-callback or something (see the comment in core.py).

Copy link
Collaborator

Choose a reason for hiding this comment

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

(sorry, this was marked as resolved but i don't think has been addressed... if i'm misunderstanding something just let me know)

tests/python/test_core.py Outdated Show resolved Hide resolved
tests/python/test_core.py Show resolved Hide resolved
@ElDeveloper
Copy link
Member Author

@fedarko should be ready for another pass, thanks!

Copy link
Collaborator

@fedarko fedarko left a comment

Choose a reason for hiding this comment

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

There are a couple unresolved things that I don't think have been addressed? Once those are handled this should be fine. (I remember this happened a while back, and it turns out that GitHub just broke or something for me and wasn't showing the updated things... but I pulled all of the latest code and I think some things really are missing. But if I'm wrong, just let me know.)

Thanks!

empress/support_files/js/select-node-menu.js Show resolved Hide resolved
empress/core.py Outdated
@@ -24,6 +24,8 @@
TEMPLATES = os.path.join(SUPPORT_FILES, 'templates')
SELECTION_CALLBACK_PATH = os.path.join(SUPPORT_FILES, 'js',
'selection-callback.js')
TIP_CLICK_CALLBACK_PATH = os.path.join(SUPPORT_FILES, 'js',
'tip-click-callback.js')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry, it looks like this conversation was marked as resolved but I don't think this change was applied...


ec.decViews.scatter.setEmissive(0x000000, samples);
ec.sceneViews[0].needsUpdate = true;
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

(sorry, this was marked as resolved but i don't think has been addressed... if i'm misunderstanding something just let me know)

@fedarko fedarko self-requested a review July 9, 2020 23:26
Copy link
Collaborator

@fedarko fedarko left a comment

Choose a reason for hiding this comment

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

Changes look good to me. Once #237 is in and we've verified that it addresses the issues discussed earlier, we can merge this.

empress/core.py Outdated
filter_extra_samples,
ignore_missing_samples,
Copy link
Collaborator

Choose a reason for hiding this comment

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

this order disagrees with the parameter names in validate_and_match. I got around this by switching the param order in tools.match_inputs() as done in this other branch's commit:

empress/empress/tools.py

Lines 58 to 67 in aa40f2b

def match_inputs(
bp_tree,
table,
sample_metadata,
feature_metadata=None,
ordination=None,
filter_extra_samples=False,
ignore_missing_samples=False,
filter_missing_features=False
):

empress/support_files/js/node-click-callback.js Outdated Show resolved Hide resolved
@fedarko fedarko merged commit 5cbe7a3 into biocore:master Jul 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants