Skip to content

Parallelism and merging question #266

Closed as not planned
Closed as not planned

Description

@pinin4fjords

Hi!

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.

Thanks in advance for pointers.

Activity

  1. ivirshup commented on Dec 6, 2019

    @ivirshup
    Member

    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)].

  2. pinin4fjords commented on Dec 6, 2019

    @pinin4fjords
    Author

    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.

  3. github-actions commented on Jul 4, 2023

    @github-actions

    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!

  4. ivirshup commented on Jul 4, 2023

    @ivirshup
    Member

    This feature is now tracked by #658 (ad.merge).

    I'm going to close this to consolidate conversation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions