scverse / scverse/scanpy

[Proposal] Integrate Marsilea to visualize AnnData

Open
#2,444 9 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area - Plotting 🌺
Dominant language
Python
Stars
2.6k
Forks
779
Avg merge
1d 4h
Merged PRs (30d)
27

Description

  • New plotting function: A kind of plot you would like to seein sc.pl?
  • External tools: Do you know an existing package that should go into sc.external.*?

Hi, thanks for developing such a fantastic framework for analyzing single-cell data, it really helps a lot in my research. I'm the developer of Heatgraphy, which is a python package to visualize multi-dimensional data using the x-layout system. You may think of it as python's version of complexHeatmap, but Heatgraphy can do much more.

Personally, I think Heatgraphy can help visualize the AnnData intuitively. Here is an example of visualization of the PBMC3K dataset using Heatgraphy. The structure of AnnData fits the structure of this visualization quite well. We can plot the .X as the heatmap, and other attributes in .obs/.var or .obsm/.varm as side plots.

Therefore, I propose adding a new API using Heatgraphy to help visualize AnnData.

If adding to sc.pl, the API may look like this:

sc.pl.heatgraphy(adata, left=[("cell_type", "color"), ("cell_type", "label")], right=[("gene_name", "label")])

If added as an extra class, the API can be more flexible and offer much more customization. It may look like this:

viz = AnnDataViz(adata)
viz.add_left(key="cell_type", plot="color", cmap="Set2")  # use a key from .obs and plot as color strip
viz.add_left(key="cell_type", plot="label")
viz.render()

It can also be applied to specific visualization for analysis.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing sc.pl and sc.external APIs, then examine how AnnData attributes such as .X, .obs, .var, .obsm, and .varm are used for visualization. Evaluate the proposed Heatgraphy integration and the two example API shapes; the work is done only after the API scope and integration approach are agreed.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.