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 DotPlot Element #6500

Open
1 task done
droumis opened this issue Jan 27, 2025 · 2 comments
Open
1 task done

Add DotPlot Element #6500

droumis opened this issue Jan 27, 2025 · 2 comments
Assignees
Labels
TRIAGE Needs triaging

Comments

@droumis
Copy link
Member

droumis commented Jan 27, 2025

Image

What I'm referring to as a DotPlot here is like a heatmap with an added dimension encoded by indicator (dot) sizing.

DotPlots are used commonly in genomics visualization, showing both expression magnitude for various genes and percentage of expressing cells, samples, or clusters. While it's mostly possible to create these using scatter/points plots in HoloViews, having a dedicated DotPlot element would make it a lot easier to create these and provide useful defaults.

Is your feature request related to a problem? Please describe.

The key problems this would solve is the manual data preparation to get things in a reasonable state of performance and applying many settings to recreate DotPlot convention default styling/behavior

Describe the solution you'd like

Add a dedicated DotPlot element to HoloViews with the following:

  • Support for sparse matrix inputs from AnnData objects
  • Dot size scaling that:
    • Maintains data space proportional size during zooming
    • Normalize max dot size to avoid dot-neighbor overlap. Dots should stay within their heatmap-square.
    • Supports different scaling methods (linear, log, sqrt)
  • Color scaling based on normalized mean expression
  • (maybe) Expression percentages above cutoff
  • (maybe) Default reds colormap for expression levels
  • Dot Size legend showing e.g. percentage of expressing cells
  • Color bar showing mean expression levels
  • Default inverted y-axis for consistency with existing convention

Describe alternatives you've considered

  1. Using existing Scatter or Points element to approximate a DotPlot, but with a lot of manual data preparation and .opts
  2. Creating this as a separate package. I received feedback from @philippjfr that this would likely make sense in HoloViews core, but I'm open to it loving elsewhere if it's getting too domain specific.

Additional context

I have a working implementation in a separate repository that demonstrates partial functionality:

@droumis
Copy link
Member Author

droumis commented Feb 18, 2025

update: Simon is working on this and will likely first go into holoviz-topics/hv-anndata instead of HoloViews to constrain the input data scope to anndata

@jbednar
Copy link
Member

jbednar commented Feb 18, 2025

Sounds good! I do think it should be in HoloViews eventually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TRIAGE Needs triaging
Projects
Status: Todo
Development

No branches or pull requests

3 participants