Repository navigation
fix(pl): plotting fixes from the 0.7.0 review - #218
Merged
Merged
Conversation
scanpy then stores the group colours it picks in the caller's uns, as in 0.6.1, without an ImplicitModificationWarning or another dense copy.
save='.png' wrote heatmap.png.pdf and save='' saved nothing in the fast mode. A saved figure is now closed unless it is returned or drawn into a given ax, as in 0.6.1. Legacy mode saves through the same code, so autosave no longer overwrites the heatmap with a blank figure and save=True no longer raises scanpy's FutureWarning.
sc.pl.embedding no longer saves (with autosave it closed the figure, and the second save wrote a blank image); saving and showing go through the heatmap's code, so save=True does not raise scanpy's FutureWarning. Region panels are found by position, so title= keeps their colour bar label, and only they are centred at 0. The panels have an equal aspect and the y axis pointing down, as sc.pl.spatial draws them without an image.
The dendrogram is now scanpy.tl.dendrogram with its defaults, as legacy and 0.6.1 compute it: with more windows than N_PCS, from the group means of a PCA of all cells, not of the raw group means. For a lazy matrix the PCA comes from the covariance of the windows in one pass. The summary clusters every group mean 10 times in name order, as legacy does. standard_scale='var' scales each window with its minimum and maximum over all cells instead of the drawn rows.
The message tells the caller of scanpy.tl.dendrogram to set use_rep, which does not apply to chromosome_heatmap.
The fast heatmaps now compute the PCA behind scanpy's dendrogram from the covariance of the windows in one pass for all matrices, not only lazy ones, instead of running scanpy's PCA on a copy of the cells. The group order matches legacy. The result is stored in uns['dendrogram_<groupby>'] as scanpy.tl.dendrogram writes it, as legacy does, so later calls (also legacy ones) reuse it.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #218 +/- ##
==========================================
+ Coverage 93.17% 93.62% +0.45%
==========================================
Files 21 21
Lines 1611 1631 +20
==========================================
+ Hits 1501 1527 +26
+ Misses 110 104 -6
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary: The second of three PRs with fixes from the review of the 0.7.0 refactor. This one covers the plotting functions.
Changes:
savefig_or_showdoes.pl.spatial_cnvsaves the figure once and draws the tissue the waysc.pl.spatialdoes.standard_scale='var'now match the legacy output.uns, and the docs describe how. scanpy no longer warns about a PCA fallback.FixedFormatterinstead of custom code.Testing: the full test suite passes on the cluster (679 passed, 12 skipped).