Repository navigation
Store dispersion trend coefficients as a dict so the dataset can be written to h5ad - #477
Open
raashish1601 wants to merge 1 commit into
Open
raashish1601 wants to merge 1 commit into
raashish1601 wants to merge 1 commit into
Conversation
…ritten to h5ad Fixes scverse#254
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #477 +/- ##
==========================================
+ Coverage 86.05% 86.07% +0.02%
==========================================
Files 15 15
Lines 1276 1278 +2
==========================================
+ Hits 1098 1100 +2
Misses 178 178
🚀 New features to boost your workflow:
|
Author
|
The |
This branch has not been deployed
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.
Reference Issue or PRs
Fixes #254.
What does your PR implement? Be specific.
dds.write_h5ad()still fails afterdeseq2()with the current anndata (0.13.4):The cause is
uns["trend_coeffs"](anduns["vst_trend_coeffs"]aftervst()), which are stored as apd.Series. Thevarm["replaced"]part of the issue is already gone sincereplacedmoved tovar.This stores both as a plain
{"a0": ..., "a1": ...}dict, which anndata can write and read back. Indexing by"a0"/"a1"keeps working for users.dispersion_trendnow accepts a dict (Series and arrays still work), andvst_transformreads the coefficients by key, because unpacking a dict would give the keys.Added
test_write_h5ad, which fits, runs VST, writes to h5ad, reads it back and checks the coefficients. It fails onmainwith the error above.tests/test_pydeseq2.pyandtests/test_edge_cases.pypass, and ruff and mypy are clean.