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

[ENH] Allow stratifying phenotypic column histogram by session #106

Merged
merged 8 commits into from
Nov 8, 2023

Conversation

alyssadai
Copy link
Collaborator

@alyssadai alyssadai commented Nov 7, 2023

Closes #95

Changes proposed in this pull request:

  • Add switch that allows toggling whether the histogram for a selected column is stratified by session
    • When on, counts for different sessions within the same value bin are shown as side-by-side bars, color-coded by session
  • Add a box subplot (that can also be stratified by session) for continuous data columns only, to easily expose session-specific distribution stats
  • Disable displaying histogram bar values as text, to avoid over-cluttering the plot (values are still available on hover)

Checklist

  • PR has an interpretable title with a prefix ([ENH], [FIX], [REF], [TST], [CI], [MNT], [INF], [MODEL], [DOC]) (see https://neurobagel.org/contributing/pull_requests for more info)
  • PR links to GitHub issue with mention Closes #XXXX
  • Tests pass
  • Checks pass

For new features:

  • Tests have been added

For bug fixes:

  • There is at least one test that would fail under the original bug conditions.

@alyssadai alyssadai requested review from nikhil153 and removed request for nikhil153 November 7, 2023 03:34
@alyssadai
Copy link
Collaborator Author

Hey @nikhil153, looping you in here in case you have any functional feedback on the new feature (no worries if not). 🙂

@nikhil153
Copy link
Contributor

Thanks @alyssadai !
Functionally looks good based on our previous conversation. For future ENH, I would curious to know if would be easy to label outlier subjects (e.g. the left side data-points in the horizontal boxplots) either in the figure or in the stats on side.

@surchs surchs self-requested a review November 8, 2023 15:12
@alyssadai
Copy link
Collaborator Author

Hey @nikhil153, I've pushed a change that displays, on hover, the participant ID of outlier points in the box plot along with the column value. I've also jittered the points so outliers can be differentiated more easily.

Let me know if that's what you were looking for 🙂

Copy link
Contributor

@surchs surchs left a comment

Choose a reason for hiding this comment

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

Very cool PR @alyssadai 🎉

I tested it out locally, seems to do all the things you say! Seeing how much of a pain these selenium tests are for UI testing, I won't suggest you add any, maybe we can take some time after OHBM and see if there is an easier way.

Good to go 🧑‍🍳

proc_dash/plotting.py Show resolved Hide resolved
proc_dash/plotting.py Show resolved Hide resolved
@nikhil153
Copy link
Contributor

@alyssadai - That's perfect! Thanks :)

@alyssadai alyssadai merged commit 01a83fe into main Nov 8, 2023
2 checks passed
@alyssadai alyssadai deleted the add-session-toggle-for-hist branch November 8, 2023 17:53
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.

Add toggle switch for stratifying phenotypic column histogram by session
3 participants