Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix notebook bugs and dependency issues (#281)
* Fix failing cell in integration.ipynb In the original cell the following code was specified: ``` data = snap.read_dataset( "colon.h5ads", update_data_locations = {"colon_transverse_SM-CSSDA": "colon_transverse_SM-CSSDA.h5ad"}, ) data ``` This raises the following error: ``` --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[25], line 1 ----> 1 data = snap.read_dataset( 2 "colon.h5ads", 3 update_data_locations = {"colon_transverse_SM-CSSDA": "colon_transverse_SM-CSSDA.h5ad"}, 4 ) 5 data TypeError: read_dataset() got an unexpected keyword argument 'update_data_locations' ``` Looking at the `read_dataset` function definition in pyanndata-0.3.2: https://docs.rs/pyanndata/0.3.2/pyanndata/anndata/fn.read_dataset.html It looks like the arg `update_data_locations` should actually be `adata_files_update`. * Address deprecated way of initializing AnnData in _scrublet.py While running SnapAtac2 notebooks the following warning was fairly frequently encountered when running `snap.pp.scrublet()`: ``` /usr/local/lib/python3.11/site-packages/anndata/_core/anndata.py:522: FutureWarning: The dtype argument is deprecated and will be removed in late 2024. ``` It looks like the `anndata` project plans to deprecate and completely remove the `dtype` argument to `AnnData` instantiation somewhat soon. See: scverse/anndata@85162c7 See also: scverse/anndata#1126 This commit removes the `dtype` argument from `AnnData` instantiation as it will be removed in future versions of `AnnData`. * Add dependencies to `recommend` so more notebooks run properly This commit adds some additional dependencies so that more notebooks under `docs/tutorials` can run properly when installing with `pip install snapatac2[recommend]`. In future work, it may make sense to remove dependencies like `scanorama` and `harmonypy` from `extra` `[project.optional-dependencies]` as `scanpy` already shares the exact same dependencies and it may be easier for future maintenance for `scanpy` to deal with versioning and pinning.
- Loading branch information