Restore scGen batch-removal tutorial#66
Open
Zethson wants to merge 1 commit into
Open
Conversation
Re-add scgen_batch_removal.ipynb (removed in 4ef5318), updated for the current pertpy API and kang_2018 schema: - use the exposed `pt.tl.Scgen` name - `batch_key="label"`, `labels_key="cell_type"` (the old `batch`/`celltype` columns are gone) - log-normalize and subsample to 4,000 cells / 2,000 HVGs so it runs in ~2 minutes - `accelerator="cpu"` Outputs regenerated with pertpy's scGen, which now reproduces PyTorch scGen. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
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.
Restores
scgen_batch_removal.ipynb, which was removed in4ef5318(Nov 2023), and updates it for the current pertpy API andkang_2018schema.What changed vs the old notebook
pt.tl.Scgen(the oldpt.tl.SCGENalias isn't routed bypt.tl).batch_key="label"(ctrl/stim) +labels_key="cell_type"— the oldbatch/celltypecolumns no longer exist inkang_2018..raw.accelerator="cpu"intrain().ISG15(this is PBMC data; the oldINSis a pancreas gene).Why now
pertpy's JAX scGen previously did not reproduce PyTorch scGen (see scverse/pertpy#1028). With that fixed, the batch-removal demo is meaningful again.
Outputs were regenerated by executing the notebook end-to-end (no errors).
Pairs with a pertpy PR that bumps this submodule and adds the notebook to the tutorials gallery.
🤖 Generated with Claude Code