icbi-lab / infercnvpy

Infer copy number variation (CNV) from scRNA-seq data. Plays nicely with Scanpy.
https://infercnvpy.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
122 stars 27 forks source link

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

Closed jpintar closed 9 months ago

jpintar commented 9 months ago

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 commented 9 months ago

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.