Open vjcitn opened 8 months ago
@vjcitn Since I had added those Dockerfiles, I'll try to take a look over this weekend when I have some time! Thanks for your patience. Can you provide a link to the annotation.ipynb
that you're referring to in your opening post?
NVM I think I found it. Just to confirm it's this? https://github.com/kaizhang/SnapATAC2/blob/main/docs/tutorials/annotation.ipynb
@vjcitn So it turns out that you were a bit unlucky when you built the image as the error you encountered looks to be a dependency issue with a package upstream of scvi-tools
.
If you rebuild your Docker images today (2024-03-09), they should now work properly.
If you want the full details of the issue you encountered, please see: https://github.com/scverse/scvi-tools/issues/2530
@kaizhang I think this issue can be closed now.
Thanks, there's been more progress, but
sc.pp.filter_genes(data, min_cells=5)
sc.pp.highly_variable_genes(
data,
n_top_genes = 5000,
flavor="seurat_v3",
batch_key="batch",
subset=True
)
fails with
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
File [/usr/local/lib/python3.11/site-packages/scanpy/preprocessing/_highly_variable_genes.py:63](http://127.0.0.1:8888/usr/local/lib/python3.11/site-packages/scanpy/preprocessing/_highly_variable_genes.py#line=62), in _highly_variable_genes_seurat_v3(adata, flavor, layer, n_top_genes, batch_key, check_values, span, subset, inplace)
62 try:
---> 63 from skmisc.loess import loess
64 except ImportError:
ModuleNotFoundError: No module named 'skmisc'
During handling of the above exception, another exception occurred:
ImportError Traceback (most recent call last)
back (most recent call last)
Cell In[5], line 2
1 sc.pp.filter_genes(data, min_cells=5)
----> 2 sc.pp.highly_variable_genes(
3 data,
4 n_top_genes = 5000,
5 flavor="seurat_v3",
6 batch_key="batch",
7 subset=True
8 )
File [/usr/local/lib/python3.11/site-packages/legacy_api_wrap/__init__.py:80](http://127.0.0.1:8888/usr/local/lib/python3.11/site-packages/legacy_api_wrap/__init__.py#line=79), in legacy_api.<locals>.wrapper.<locals>.fn_compatible(*args_all, **kw)
77 @wraps(fn)
78 def fn_compatible(*args_all: P.args, **kw: P.kwargs) -> R:
79 if len(args_all) <= n_positional:
---> 80 return fn(*args_all, **kw)
82 args_pos: P.args
83 args_pos, args_rest = args_all[:n_positional], args_all[n_positional:]
File [/usr/local/lib/python3.11/site-packages/scanpy/preprocessing/_highly_variable_genes.py:626](http://127.0.0.1:8888/usr/local/lib/python3.11/site-packages/scanpy/preprocessing/_highly_variable_genes.py#line=625), in highly_variable_genes(adata, layer, n_top_genes, min_disp, max_disp, min_mean, max_mean, span, n_bins, flavor, subset, inplace, batch_key, check_values)
624 sig = signature(_highly_variable_genes_seurat_v3)
625 n_top_genes = cast(int, sig.parameters["n_top_genes"].default)
--> 626 return _highly_variable_genes_seurat_v3(
627 adata,
628 flavor=flavor,
629 layer=layer,
630 n_top_genes=n_top_genes,
631 batch_key=batch_key,
632 check_values=check_values,
633 span=span,
634 subset=subset,
635 inplace=inplace,
636 )
638 cutoff = _Cutoffs.validate(
639 n_top_genes=n_top_genes,
640 min_disp=min_disp,
(...)
643 max_mean=max_mean,
644 )
645 del min_disp, max_disp, min_mean, max_mean, n_top_genes
File [/usr/local/lib/python3.11/site-packages/scanpy/preprocessing/_highly_variable_genes.py:65](http://127.0.0.1:8888/usr/local/lib/python3.11/site-packages/scanpy/preprocessing/_highly_variable_genes.py#line=64), in _highly_variable_genes_seurat_v3(adata, flavor, layer, n_top_genes, batch_key, check_values, span, subset, inplace)
63 from skmisc.loess import loess
64 except ImportError:
---> 65 raise ImportError(
66 "Please install skmisc package via `pip install --user scikit-misc"
67 )
68 df = pd.DataFrame(index=adata.var_names)
69 data = _get_obs_rep(adata, layer=layer)
ImportError: Please install skmisc package via `pip install --user scikit-misc
this is on ubuntu
@vjcitn Hi, that is rather weird. So it looks like the error is complaining that about the scikit-misc
package not being installed. However, I specifically had the following added to snapATAC2
's pyproject.toml
file recently:
https://github.com/kaizhang/SnapATAC2/blob/b73dcfd2f9b1cc9d592522927af0ca8d52031792/snapatac2-python/pyproject.toml#L60
Here is the relevant commit that got merged in: https://github.com/kaizhang/SnapATAC2/commit/b73dcfd2f9b1cc9d592522927af0ca8d52031792
This should make it so that when . Since you've been building your Docker image from source, can you check that the state of your snapATAC2
is installed with pip install snapatac2[recommend]
it should automatically also include scikit-misc
snapATAC2
repo is up to date (e.g. do a git pull
and check that your local version of the snapATAC2
pyproject.toml
has that line I highlighted)?
EDIT: I see what is going on now, the changes in https://github.com/kaizhang/SnapATAC2/commit/b73dcfd2f9b1cc9d592522927af0ca8d52031792 haven't been released to PyPi
yet as it looks like v2.6.0
is still the latest that has been released. You'll need to wait until @kaizhang releases v2.6.1
of SnapATAC2
to PyPi
The recommended interactive container built nicely on ubuntu 22.04 but attempt to run first chunk of annotation.ipynb led to