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

trouble with pbmc notebook #277

Open
vjcitn opened this issue Mar 28, 2024 · 4 comments
Open

trouble with pbmc notebook #277

vjcitn opened this issue Mar 28, 2024 · 4 comments

Comments

@vjcitn
Copy link

vjcitn commented Mar 28, 2024

this is being run within the recommended container

for snap.pl.umap(data, color='leiden', interactive=False, height=500)

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
Cell In[17], line 1
----> 1 snap.pl.umap(data, color='leiden', interactive=False, height=500)

File [/usr/local/lib/python3.11/site-packages/snapatac2/plotting/__init__.py:265](http://127.0.0.1:8888/usr/local/lib/python3.11/site-packages/snapatac2/plotting/__init__.py#line=264), in umap(adata, color, use_rep, marker_size, marker_opacity, sample_size, **kwargs)
    234 """Plot the UMAP embedding.
    235 
    236 Parameters
   (...)
    261     returned, which can then be further customized using the plotly API.
    262 """
    263 from natsort import index_natsorted
--> 265 embedding = adata.obsm[use_rep] 
    267 if isinstance(color, str):
    268     groups = adata.obs[color].to_numpy()

File [/usr/local/lib/python3.11/site-packages/anndata/_core/aligned_mapping.py:196](http://127.0.0.1:8888/usr/local/lib/python3.11/site-packages/anndata/_core/aligned_mapping.py#line=195), in AlignedActualMixin.__getitem__(self, key)
    195 def __getitem__(self, key: str) -> V:
--> 196     return self._data[key]

KeyError: 'X_umap'```
@vjcitn
Copy link
Author

vjcitn commented Mar 28, 2024

Also looks like git is needed in container for sc.external.pp.magic(gene_matrix, solver="approximate")

    141     from magic import MAGIC, __version__
    142 except ImportError:
--> 143     raise ImportError(
    144         "Please install magic package via `pip install --user "
    145         "git+git://github.com/KrishnaswamyLab/MAGIC.git#subdirectory=python`"
    146     )

@njmei
Copy link
Contributor

njmei commented Mar 28, 2024

I will take a look at these errors this weekend. Thanks for your patience!

@vjcitn
Copy link
Author

vjcitn commented Mar 28, 2024

Thanks for rapid response! Do you intend to put the container in a registry like dockerhub? I saw a size of 7.1GB on the image I made, so it seems reasonable to do this once the compatibility issues are sorted.

@njmei
Copy link
Contributor

njmei commented Mar 30, 2024

@vjcitn I've submitted a PR to address the issues you've encountered. After it is merged, you would need to wait until the latest version of SnapAtac2 is published to PyPi (see: https://pypi.org/project/snapatac2/#history) and then re-run the docker image build step while changing the --build-arg SNAP_ATAC_VERSION=v2.6.*.

I'm only a volunteer helping out with some Docker related things so I don't know about plans for publishing containers to Dockerhub. I will say it's probably best to either build them yourself or wait for official images to be published. The possibility of supply chain attacks makes it hard for me to recommend pulling from random docker repositories that happen to have snapatac2 images.

EDIT: As a short-term workaround in the top of any Jupyter notebooks in a new cell you can run !pip install scanpy[scanorama, skmisc, magic, harmony], restart your python kernel, and then proceed to run the rest of the notebook's cells. Note that because this install step is not persisted, you would need to re-run it every time you start a new docker container.

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