Skip to content

Conversation

@ilia-kats
Copy link
Collaborator

This PR attempts to make .pl.scatter and pl.embedding more predictable while simplifying our code and fixing some bugs.

  • use_raw can no longer be None, it is either True or False. This is consistent with the scanpy API, leads to more predictable output, and allows us to considerably simplify our code.
  • a new argument gene_symbols is supported, with the same functionality as in scanpy.
  • the arguments layer, use_raw, and gene_symbols can be specified individually for each modality by passing dictionaries.

That way we can rely on AnnData for validation and error handling.
Closes scverse#162.
use_raw is now a non-optional boolean. This is consistent with the
scanpy API, simplifies our logic a lot and makes the output more
predictable.

Also implement a gene_symbols argument that specifies a column in .var
to use as index (closes scverse#124)
@ilia-kats ilia-kats requested a review from gtca August 15, 2025 14:35
@ilia-kats ilia-kats requested a review from ilan-gold October 9, 2025 16:10
Copy link
Contributor

@ilan-gold ilan-gold left a comment

Choose a reason for hiding this comment

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

Didn't get to finish this one and won't be around until next week (or maybe week after since I'll be conferencing most of next week), but generally just more checks on argument validities would be good. Maybe simple "does this error or not" tests.

x: str | None = None,
y: str | None = None,
color: str | Sequence[str] | None = None,
use_raw: bool | Mapping[str, bool] = False,
Copy link
Contributor

Choose a reason for hiding this comment

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

But how do you indicate this breaking change to users? I'm not familiar with the release process or your promises. I guess you;re not on a major version >=1 yet so it doesn't matter. Is there a changelog?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That is a good question :) I don't think we ever defined a formal release process, but perhaps @gtca knows more. We do have a changelog in the docs directory, I guess I can add this there.

@ilia-kats ilia-kats force-pushed the plot_fixes branch 3 times, most recently from cb715c2 to 4487094 Compare October 10, 2025 12:57
use_raw cannot be None anymore. This is consistent with the scanpy API
and leads to more predictable results. Also add a gene_symbols argument.
use_raw, layers, and gene_symbols now support being passed dictionaries
specifiying different values for different modalities.
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