You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Quick version: what's the best way of merging annData objects such that results of e.g. multiple t-SNE, marker detection etc parameterisations can be merged into the same object, and ultimately addData or Loom file? Is there a pre-baked solution somewhere?
Longer version: I forsee many cases in our future (I work in the Gene Expression group at the EBI) where we may want to 'scatter' Scanpy jobs, to deal with lists of parameterisations (e.g. t-SNE variants, differential comparisons over arbitrary lists of sub-groups etc), but then combine everything together so we can distribute the annData (or possibly Loom) file as a 'project'. I guess this is concatenate(), minus the matrices, and I'd like to not duplicate e.g. .var and .obs columns. So I'm basically assuming that matrices themselves are unchanged, but I need to unify .var, .obs, .obsm, .varm etc. I can figure this out myself, but I'm a bit fuzzy on annData still, so if there are pre-made solutions that would be awesome.
I think the short answer is that there isn't a canonical way of doing this right now. The main problem is that we don't have a system which is smart enough to only distribute the data that's needed at the moment. Definitely something we're talking about though.
A longer answer is that I've done this myself a few times, and can recommend a few ways to do this, depending on your exact requirements. None of this will necessarily be much better than some combination of itertools.product, some way to run jobs in parallel (like dask or multiprocessing), then writing results back into the AnnData like adata.obsm[f"p1-{param1}_p2-{param2}"] = results[(param1, param2)].
Thanks for the response @ivirshup . The parallelism I can cover with our cluster (though dask et al may well be useful in future). Really it's just the writing results back to AnnData I need right now. If you have some examples of that you can point me at that would be great. My current use case is the differential things, combining rank_genes_groups() results from arbitrary groupings.
This issue has been automatically marked as stale because it has not had recent activity.
Please add a comment if you want to keep the issue open. Thank you for your contributions!
Activity
ivirshup commentedon Dec 6, 2019
I think the short answer is that there isn't a canonical way of doing this right now. The main problem is that we don't have a system which is smart enough to only distribute the data that's needed at the moment. Definitely something we're talking about though.
A longer answer is that I've done this myself a few times, and can recommend a few ways to do this, depending on your exact requirements. None of this will necessarily be much better than some combination of
itertools.product, some way to run jobs in parallel (likedaskormultiprocessing), then writing results back into the AnnData likeadata.obsm[f"p1-{param1}_p2-{param2}"] = results[(param1, param2)].pinin4fjords commentedon Dec 6, 2019
Thanks for the response @ivirshup . The parallelism I can cover with our cluster (though dask et al may well be useful in future). Really it's just the writing results back to AnnData I need right now. If you have some examples of that you can point me at that would be great. My current use case is the differential things, combining rank_genes_groups() results from arbitrary groupings.
github-actions commentedon Jul 4, 2023
This issue has been automatically marked as stale because it has not had recent activity.
Please add a comment if you want to keep the issue open. Thank you for your contributions!
ivirshup commentedon Jul 4, 2023
This feature is now tracked by #658 (
ad.merge).I'm going to close this to consolidate conversation