Skip to content
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

Converting to adata.X #8

Open
dmiyagi opened this issue Jun 29, 2023 · 1 comment
Open

Converting to adata.X #8

dmiyagi opened this issue Jun 29, 2023 · 1 comment

Comments

@dmiyagi
Copy link

dmiyagi commented Jun 29, 2023

If I'm wanting to pass the 'X_harmony" array downstream to other scanpy external packages like scanpy.external.pp.magic (https://scanpy.readthedocs.io/en/stable/generated/scanpy.external.pp.magic.html) or scanpy.external.tl.phate (https://scanpy.readthedocs.io/en/stable/generated/scanpy.external.tl.phate.html) how would I convert it to take the place of adata.X? sort of like how correct_scanpy() works in Scanorama (https://github.com/brianhie/scanorama) ? Thank you!!

@yihming
Copy link
Member

yihming commented Jan 7, 2024

@dmiyagi Sorry that I just saw your issue.

The normal use case of Harmony algorithm is to apply it to some embedding, such as PCA matrix. Therefore, The "X_harmony" array is usually of shape (n_cells, n_comps), where n_comps is the number of components. This is different from adata.X which is of shape (n_cells, n_genes).

So I don't think the direct conversion could work. Otherwise, you may think of creating another AnnData object of shape (n_cells, n_comps) with X_harmony matrix being its adata.X.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants