-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ad.merge function #658
Labels
Milestone
Comments
|
Just noting that the scirpy use-case is obsolete in favor of MuData after scverse/scirpy#356 gets merged. |
This was referenced Jul 28, 2023
This would be very nice to have, we produce a lot of heavy objects redundantly due to parametrisation of runs. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I would like to add a
anndata.merge
function, with similar functionality toxarray.merge
.Example
Use cases
Partial-AnnDatas returned from functions
Many
scanpy
function take an anndata object, produce a number of elements, and add them back to the original anndata object. We could instead produce a new object which only holds the new elements, thenad.merge
the results together. By itself, this is the exact same thing, but this refactoring would allow a few new uses.Instead of updating the original, we could keep the results seperate. This would be useful for generating multiple parameterizations, or having a lightweight object to pass to further objects – as opposed to mutating or copying the whole original object.
Seperating parts of analyses
We could want to keep elements from annotation or analysis seperate until we need them. We could avoid keeping the large arrays in
layers
for a velocity analysis, until we actually want them.scirpy
Scirpy has a function for doing this specifically with immense receptor data:
scirpy.pp.merge_with_ir
. This would be a more general case. The IRAnnData
here is a bit like the "partial-AnnDatas" discussed above.(please let me know if this isn't the case @grst)
Previous discussion
This has been suggested and discussed a number of places.
ad.merge(adata, {"obs": df})
, i.e. other objects to merge can just be mappings.Requirements
This would require full support for
adata.X = None
#467Implimenting this would fit well with an
anndata.align
(#531) function (e.g. pass multiple anndata objects, return them with axes aligned). As the updates and reindexing are orthogonal.The text was updated successfully, but these errors were encountered: