Repository navigation
Conversation
… in the heatmap OUTPUT CHANGE (heatmap PNG only; no CNA values, calls or tables change): above 4,096 cells the heatmap draws an evenly spaced subset of the ordered cells, and the 20k-200k-cell ordering embedding is computed from the collapsed bins matrix. The image looks the same (same genome-wide structure and prediction sidebar), but individual pixel rows show different cells and the k-means block order can differ. Plotting was the run's memory peak by far: mat[:, cell_order] copied the float64 bins x cells matrix, and imshow copied it twice more (masked copy, then astype) before resampling it to the ~2,000-pixel-tall axes, where nearest-neighbour rendering shows one cell per pixel row anyway. The block ordering also made a float32 copy of the whole matrix for its TruncatedSVD. Xenium 80k, 32 threads, with the heatmap: plotting +24.2 GB -> +1.6 GB; whole-run peak 33.7 GB -> 11.1 GB. Xenium 30k: +9.1 GB -> +1.6 GB, run 98.9 s -> 86.1 s. The legend still lists every category present among the plotted cells. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Above 4,096 cells the heatmap draws an evenly spaced subset of the ordered cells, and the 20k-200k-cell ordering embedding is computed from the collapsed bins matrix. The image looks the same (same genome-wide structure and prediction sidebar), but individual pixel rows show different cells and the k-means block order can differ. The legend still lists every category present among the plotted cells.
Plotting was the run's memory peak by far:
mat[:, cell_order]copied the float64 bins x cells matrix, andimshowcopied it twice more (masked copy, thenastype) before resampling it to the ~2,000-pixel-tall axes, where nearest-neighbour rendering shows one cell per pixel row anyway. The block ordering also made a float32 copy of the whole matrix for its TruncatedSVD.Performance (32 threads, with the heatmap; development runs)
Tests
tests/test_heatmap_rows.py.How to check
This script runs
mainand this branch on the built-in example dataset and lists which output files are byte-for-byte identical, then prints each step's runtime for both versions. The example has 302 cells, below the 4,096-cell cap, so every file is expected to beidenticalhere. To try your own data, replaceload_example_data()with a path to a genes x cells .csv/.tsv count matrix. It needs git and a Python environment with CopyKAT-Python's dependencies.🤖 Generated with Claude Code