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

Fix heatmap passing of uns data to scanpy.pl.heatmap #110

Merged
merged 4 commits into from
Sep 25, 2023
Merged

Fix heatmap passing of uns data to scanpy.pl.heatmap #110

merged 4 commits into from
Sep 25, 2023

Conversation

jpintar
Copy link
Contributor

@jpintar jpintar commented Sep 25, 2023

In chromosome_heatmap, remove unnecessary existence test and copying of adata.uns[f"{groupby}_colors"] to tmp_adata.uns (which was already defined to be equal to adata.uns in PR #72).

In chromosome_heatmap_summary, set tmp_adata.uns equal to adata.uns at definition, just as in chromosome_heatmap, and remove unnecessary test, as above. This prevents scanpy.pl.heatmap from issuing a dendrogram data not found warning and recomputing dendrogram when tmp_adata is passed with dendrogram=True.

jpintar and others added 3 commits September 25, 2023 10:17
Remove unnecessary existence test and copying of adata.uns[f"{groupby}_colors"] from chromosome_heatmap (tmp_adata.uns was already equal to adata.uns).

In chromosome_heatmap_summary, copy adata.uns to tmp_adata.uns. This prevents scanpy.pl.heatmap from recomputing dendrogram data when tmp_adata is passed with dendrogram=True.
Explicitly set type of tmp_obs.index to str to avoid anndata ImplicitModificationWarning.
@jpintar
Copy link
Contributor Author

jpintar commented Sep 25, 2023

I've also explicitly set tmp_obs index type to str. This avoids AnnData issuing ImplicitModificationWarning: Transforming to str index when tmp_adata is created.

Copy link
Member

@grst grst left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

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