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

Triger AttributeError "X not found" when use layer parameter in mu.tl.embedding #29

Closed
liuzj039 opened this issue Jun 18, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@liuzj039
Copy link

liuzj039 commented Jun 18, 2021

Describe the bug
Triger AttributeError "X not found" when use layer parameter in mu.tl.embedding.

To Reproduce
mu.pl.embedding( md, "X_umap", color=[*some gene*], cmap="Reds", layer="sct_corrected", )

then a attribute error was triggered


AttributeError Traceback (most recent call last)

~/softwares/anaconda3/lib/python3.8/site-packages/muon/_core/plot.py in embedding(data, basis, color, use_raw, layer, >**kwargs)
120 if layer is not None:
121 if layer in data.mod[m].layers:
--> 122 fmod_adata.X = data.mod[m][:, mod_keys].layers[layer].X
123 if use_raw:
124 warnings.warn(f"Layer='{layer}' superseded use_raw={use_raw}")

~/softwares/anaconda3/lib/python3.8/site-packages/scipy/sparse/base.py in getattr(self, attr)
685 return self.getnnz()
686 else:
--> 687 raise AttributeError(attr + " not found")
688
689 def transpose(self, axes=None, copy=False):

AttributeError: X not found

Additional context
This error appears to be caused by a typo. In fact a simple deletion of the .X will fix this bug.https://github.com/PMBio/muon/blob/e77bbf3a2acb1c92dae4c13419cd7335602c2735/muon/_core/plot.py#L122

Thanks developers for providing such a great tool.

@liuzj039 liuzj039 added the bug Something isn't working label Jun 18, 2021
@liuzj039
Copy link
Author

ilia-kats added a commit that referenced this issue Jun 18, 2021
@ilia-kats
Copy link
Collaborator

This should be fixed in master, could you test it and report back?

@liuzj039
Copy link
Author

Muon is also working well in my environment now.
Thank you for your quick reply!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants