From 17bccb001c507ce0be737baed8f9bdfe688c865c Mon Sep 17 00:00:00 2001 From: Kevin Rue-Albrecht Date: Wed, 12 Jun 2024 10:17:35 +0100 Subject: [PATCH] update conda environments and workflows to fix issue similar to devel --- DESCRIPTION | 6 +- NEWS.md | 7 + R/basilisk.R | 1066 +++++++++++++++++++++++++++++++++--- R/scvelo.R | 83 ++- man/scvelo.Rd | 35 +- vignettes/velociraptor.Rmd | 15 +- 6 files changed, 1110 insertions(+), 102 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index db6054c..17f9ab1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: velociraptor Title: Toolkit for Single-Cell Velocity -Version: 1.14.0 -Date: 2024-01-29 +Version: 1.14.1 +Date: 2024-06-12 Authors@R: c(person("Kevin", "Rue-Albrecht", role = c("aut", "cre"), email = "kevinrue67@gmail.com", comment = c(ORCID = "0000-0003-3899-3872")), person("Aaron", "Lun", role="aut", email="infinite.monkeys.with.keyboards@gmail.com", comment = c(ORCID = '0000-0002-3564-4813')), person("Charlotte", "Soneson", role="aut", email="charlottesoneson@gmail.com", comment = c(ORCID = '0000-0003-3833-2169')), @@ -46,7 +46,7 @@ Suggests: StagedInstall: no License: MIT + file LICENSE Encoding: UTF-8 -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.1 URL: https://github.com/kevinrue/velociraptor BugReports: https://github.com/kevinrue/velociraptor/issues biocViews: SingleCell, GeneExpression, Sequencing, Coverage diff --git a/NEWS.md b/NEWS.md index d8c7dd3..a29231b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,10 @@ +# velociraptor 1.14.1 + +* Update scvelo environment to version `0.3.2` on Linux/Mac. +* Update scvelo environment to version `0.2.5` on Windows. +* Use `scanpy.pp.neighbors` to calculate neighbors due to deprecation of automatic neighbor calculation in `scvelo.pp.moments`. +* Update vignette to document the change of default value for n_neighbors from scvelo (30) to scanpy (15). + # velociraptor 1.13.1 * Robust fallback mechanism using `basiliskRun` option `testload=`. diff --git a/R/basilisk.R b/R/basilisk.R index c3c2898..5078521 100644 --- a/R/basilisk.R +++ b/R/basilisk.R @@ -1,77 +1,997 @@ -# scvelo 0.2.2 and latest version of dependencies in zellkonverter::AnnDataDependencies() succesfully tested. -.scvelo_dependencies <- c("alabaster==0.7.12", - "anndata==0.7.4", - "Babel==2.8.0", - "brotlipy==0.7.0", - "certifi==2020.6.20", - "cffi==1.14.1", - "chardet==3.0.4", - "colorama==0.4.3", - "cryptography==3.1", - "cycler==0.10.0", - "decorator==4.4.2", - "docutils==0.16", - "h5py==2.10.0", - "idna==2.10", - "imagesize==1.2.0", - "importlib-metadata==1.7.0", - "Jinja2==2.11.2", - "joblib==0.16.0", - "kiwisolver==1.2.0", - "llvmlite==0.34.0", - "loompy==2.0.16", - "MarkupSafe==1.1.1", - "matplotlib==3.3.1", - "mock==4.0.2", - "natsort==7.0.1", - "networkx==2.5", - "numba==0.51.2", - "numexpr==2.7.1", - "numpy==1.19.1", - "olefile==0.46", - "packaging==20.4", - "pandas==1.1.2", - "patsy==0.5.1", - "Pillow==7.2.0", - "pip==20.2.3", - "pycparser==2.20", - "Pygments==2.7.0", - "pyOpenSSL==19.1.0", - "pyparsing==2.4.7", - "PySocks==1.7.1", - "python==3.8", - "python-dateutil==2.8.1", - "pytz==2020.1", - "requests==2.24.0", - "scanpy==1.6.0", - "scikit-learn==0.23.2", - "scipy==1.5.2", - "scvelo==0.2.2", - "seaborn==0.11.0", - "setuptools-scm==4.1.2", - "sinfo==0.3.1", - "six==1.15.0", - "snowballstemmer==2.0.0", - "Sphinx==3.2.1", - "sphinxcontrib-applehelp==1.0.2", - "sphinxcontrib-devhelp==1.0.2", - "sphinxcontrib-htmlhelp==1.0.3", - "sphinxcontrib-jsmath==1.0.1", - "sphinxcontrib-qthelp==1.0.3", - "sphinxcontrib-serializinghtml==1.1.4", - "statsmodels==0.12.0", - "stdlib-list==0.6.0", - "threadpoolctl==2.1.0", - "toml==0.10.1", - "tornado==6.0.4", - "tqdm==4.49.0", - "typing_extensions==3.10.0.0", - "umap-learn==0.4.6", - "urllib3==1.25.10", - "wheel==0.35.1", - "zipp==3.1.0") +.scvelo.dependencies.Windows <- list( + channels = c("bioconda", "conda-forge"), + packages = c( + 'anndata==0.10.5.post1', + 'array-api-compat==1.6', + 'blosc==1.21.5', + 'brotli==1.1.0', + 'brotli-bin==1.1.0', + 'bzip2==1.0.8', + 'ca-certificates==2024.2.2', + 'cached-property==1.5.2', + 'cached_property==1.5.2', + 'certifi==2024.2.2', + 'colorama==0.4.6', + 'contourpy==1.2.1', + 'cycler==0.12.1', + 'exceptiongroup==1.2.0', + 'fonttools==4.51.0', + 'freetype==2.12.1', + 'glib==2.80.2', + 'glib-tools==2.80.2', + 'gst-plugins-base==1.24.3', + 'gstreamer==1.24.3', + 'h5py==3.8.0', + 'hdf5==1.14.0', + 'icu==73.2', + 'importlib-metadata==7.1.0', + 'importlib_metadata==7.1.0', + 'intel-openmp==2024.1.0', + 'joblib==1.4.2', + 'kiwisolver==1.4.5', + 'krb5==1.21.2', + 'lcms2==2.16', + 'legacy-api-wrap==1.4', + 'lerc==4.0.0', + 'libaec==1.1.3', + 'libblas==3.9.0', + 'libbrotlicommon==1.1.0', + 'libbrotlidec==1.1.0', + 'libbrotlienc==1.1.0', + 'libcblas==3.9.0', + 'libclang13==18.1.5', + 'libcurl==8.8.0', + 'libdeflate==1.20', + 'libffi==3.4.2', + 'libglib==2.80.2', + 'libhwloc==2.10.0', + 'libiconv==1.17', + 'libintl==0.22.5', + 'libintl-devel==0.22.5', + 'libjpeg-turbo==3.0.0', + 'liblapack==3.9.0', + 'libogg==1.3.4', + 'libpng==1.6.43', + 'libsqlite==3.45.3', + 'libssh2==1.11.0', + 'libtiff==4.6.0', + 'libvorbis==1.3.7', + 'libwebp-base==1.4.0', + 'libxcb==1.15', + 'libxml2==2.12.7', + 'libzlib==1.2.13', + 'llvmlite==0.40.1', + 'loompy==2.0.16', + 'lz4-c==1.9.4', + 'm2w64-gcc-libgfortran==5.3.0', + 'm2w64-gcc-libs==5.3.0', + 'm2w64-gcc-libs-core==5.3.0', + 'm2w64-gmp==6.1.0', + 'm2w64-libwinpthread-git==5.0.0.4634.697f757', + 'matplotlib==3.6.3', + 'matplotlib-base==3.6.3', + 'mkl==2024.1.0', + 'msys2-conda-epoch==20160418', + 'munkres==1.0.7', + 'natsort==8.4.0', + 'networkx==3.2', + 'numba==0.57.1', + 'numexpr==2.7.3', + 'numpy==1.21.1', + 'openjpeg==2.5.2', + 'openssl==3.3.0', + 'packaging==24.0', + 'pandas==1.5.2', + 'patsy==0.5.6', + 'pcre2==10.43', + 'pillow==10.3.0', + 'pip==24.0', + 'ply==3.11', + 'pthread-stubs==0.4', + 'pthreads-win32==2.9.1', + 'pynndescent==0.5.12', + 'pyparsing==3.1.2', + 'pyqt==5.15.9', + 'pyqt5-sip==12.12.2', + 'pytables==3.7.0', + 'python==3.9.12', + 'python-dateutil==2.9.0', + 'python_abi==3.9', + 'pytz==2024.1', + 'qt-main==5.15.8', + 'scanpy==1.7.2', + 'scikit-learn==1.5.0', + 'scipy==1.13.1', + 'scvelo==0.2.5', + 'seaborn==0.13.2', + 'seaborn-base==0.13.2', + 'setuptools==70.0.0', + 'setuptools-scm==8.1.0', + 'setuptools_scm==8.1.0', + 'sinfo==0.3.1', + 'sip==6.7.12', + 'six==1.16.0', + 'snappy==1.2.0', + 'sqlite==3.45.3', + 'statsmodels==0.14.2', + 'stdlib-list==0.10.0', + 'tbb==2021.12.0', + 'threadpoolctl==3.5.0', + 'tk==8.6.13', + 'toml==0.10.2', + 'tomli==2.0.1', + 'tornado==6.4', + 'tqdm==4.66.4', + 'typing==3.10.0.0', + 'typing-extensions==4.11.0', + 'typing_extensions==4.11.0', + 'tzdata==2024a', + 'ucrt==10.0.22621.0', + 'umap-learn==0.5.5', + 'unicodedata2==15.1.0', + 'vc==14.3', + 'vc14_runtime==14.38.33135', + 'vs2015_runtime==14.38.33135', + 'wheel==0.43.0', + 'xorg-libxau==1.0.11', + 'xorg-libxdmcp==1.1.3', + 'xz==5.2.6', + 'zipp==3.17.0', + 'zstd==1.5.6' + ) +) + +.scvelo.dependencies.MacOSXArm <- list( + channels = c("conda-forge", "bioconda"), + packages = c( + 'absl-py==2.1.0', + 'anndata==0.10.7', + 'annotated-types==0.7.0', + 'anyio==4.3.0', + 'aom==3.9.0', + 'array-api-compat==1.6', + 'arrow==1.3.0', + 'beautifulsoup4==4.12.3', + 'blessed==1.19.1', + 'blosc==1.21.5', + 'boto3==1.34.111', + 'botocore==1.34.111', + 'brotli==1.1.0', + 'brotli-bin==1.1.0', + 'brotli-python==1.1.0', + 'bzip2==1.0.8', + 'c-ares==1.28.1', + 'ca-certificates==2024.2.2', + 'cachecontrol==0.14.0', + 'cachecontrol-with-filecache==0.14.0', + 'cached-property==1.5.2', + 'cached_property==1.5.2', + 'certifi==2024.2.2', + 'cffi==1.16.0', + 'charset-normalizer==3.3.2', + 'chex==0.1.86', + 'cleo==2.1.0', + 'click==8.1.7', + 'colorama==0.4.6', + 'contextlib2==21.6.0', + 'contourpy==1.2.1', + 'crashtest==0.4.1', + 'croniter==1.3.15', + 'cycler==0.12.1', + 'dateutils==0.6.12', + 'dav1d==1.2.1', + 'deepdiff==7.0.1', + 'distlib==0.3.8', + 'dnspython==2.6.1', + 'docrep==0.3.2', + 'dulwich==0.21.7', + 'email-validator==2.1.1', + 'email_validator==2.1.1', + 'et_xmlfile==1.1.0', + 'etils==1.6.0', + 'exceptiongroup==1.2.0', + 'fastapi==0.111.0', + 'fastapi-cli==0.0.4', + 'filelock==3.14.0', + 'flax==0.8.3', + 'fonttools==4.51.0', + 'freetype==2.12.1', + 'fsspec==2023.12.2', + 'get-annotations==0.1.2', + 'gmp==6.3.0', + 'gmpy2==2.1.5', + 'h11==0.14.0', + 'h2==4.1.0', + 'h5py==3.11.0', + 'hdf5==1.14.3', + 'hpack==4.0.0', + 'httpcore==1.0.5', + 'httpx==0.27.0', + 'hyperframe==6.0.1', + 'icu==73.2', + 'idna==3.7', + 'importlib-metadata==7.1.0', + 'importlib-resources==6.4.0', + 'importlib_metadata==7.1.0', + 'importlib_resources==6.4.0', + 'inquirer==3.1.4', + 'itsdangerous==2.2.0', + 'jaraco.classes==3.4.0', + 'jax==0.4.27', + 'jaxlib==0.4.23', + 'jinja2==3.1.4', + 'jmespath==1.0.1', + 'joblib==1.4.2', + 'keyring==24.3.1', + 'kiwisolver==1.4.5', + 'krb5==1.21.2', + 'lcms2==2.16', + 'legacy-api-wrap==1.4', + 'lerc==4.0.0', + 'libabseil==20240116.2', + 'libaec==1.1.3', + 'libavif16==1.0.4', + 'libblas==3.9.0', + 'libbrotlicommon==1.1.0', + 'libbrotlidec==1.1.0', + 'libbrotlienc==1.1.0', + 'libcblas==3.9.0', + 'libcurl==8.8.0', + 'libcxx==17.0.6', + 'libdeflate==1.20', + 'libedit==3.1.20191231', + 'libev==4.33', + 'libffi==3.4.2', + 'libgfortran==5.0.0', + 'libgfortran5==13.2.0', + 'libgrpc==1.62.2', + 'libhwloc==2.10.0', + 'libiconv==1.17', + 'libjpeg-turbo==3.0.0', + 'liblapack==3.9.0', + 'libllvm14==14.0.6', + 'libnghttp2==1.58.0', + 'libopenblas==0.3.27', + 'libpng==1.6.43', + 'libprotobuf==4.25.3', + 'libre2-11==2023.09.01', + 'libsqlite==3.45.3', + 'libssh2==1.11.0', + 'libtiff==4.6.0', + 'libtorch==2.3.0', + 'libuv==1.48.0', + 'libwebp-base==1.4.0', + 'libxcb==1.15', + 'libxml2==2.12.7', + 'libzlib==1.2.13', + 'lightning==2.0.4', + 'lightning-cloud==0.5.69', + 'lightning-utilities==0.11.2', + 'llvm-openmp==18.1.5', + 'llvmlite==0.42.0', + 'loompy==3.0.6', + 'lz4-c==1.9.4', + 'markdown-it-py==3.0.0', + 'markupsafe==2.1.5', + 'matplotlib-base==3.8.4', + 'mdurl==0.1.2', + 'ml-collections==0.1.1', + 'ml_dtypes==0.4.0', + 'more-itertools==10.2.0', + 'mpc==1.3.1', + 'mpfr==4.2.1', + 'mpmath==1.3.0', + 'msgpack-python==1.0.8', + 'mudata==0.2.3', + 'multipledispatch==0.6.0', + 'munkres==1.1.4', + 'natsort==8.4.0', + 'ncurses==6.5', + 'nest-asyncio==1.6.0', + 'networkx==3.2.1', + 'nomkl==1.0', + 'numba==0.59.1', + 'numpy==1.26.4', + 'numpy_groupies==0.11.1', + 'numpyro==0.15.0', + 'openjpeg==2.5.2', + 'openpyxl==3.1.2', + 'openssl==3.3.0', + 'opt-einsum==3.3.0', + 'opt_einsum==3.3.0', + 'optax==0.2.2', + 'orbax-checkpoint==0.4.4', + 'ordered-set==4.1.0', + 'orjson==3.10.3', + 'packaging==24.0', + 'pandas==2.2.2', + 'patsy==0.5.6', + 'pexpect==4.9.0', + 'pillow==10.3.0', + 'pip==24.0', + 'pkginfo==1.10.0', + 'platformdirs==4.2.2', + 'poetry==1.8.3', + 'poetry-core==1.9.0', + 'poetry-plugin-export==1.8.0', + 'protobuf==4.25.3', + 'psutil==5.9.8', + 'pthread-stubs==0.4', + 'ptyprocess==0.7.0', + 'pybind11-abi==4', + 'pycparser==2.22', + 'pydantic==2.7.1', + 'pydantic-core==2.18.2', + 'pygments==2.18.0', + 'pyjwt==2.8.0', + 'pynndescent==0.5.12', + 'pyparsing==3.1.2', + 'pyproject_hooks==1.1.0', + 'pyro-api==0.1.2', + 'pyro-ppl==1.9.0', + 'pysocks==1.7.1', + 'python==3.9.12', + 'python-build==1.2.1', + 'python-dateutil==2.9.0', + 'python-editor==1.0.4', + 'python-fastjsonschema==2.19.1', + 'python-installer==0.7.0', + 'python-multipart==0.0.9', + 'python-tzdata==2024.1', + 'python_abi==3.9', + 'pytorch==2.3.0', + 'pytorch-lightning==2.2.2', + 'pytz==2024.1', + 'pyyaml==6.0.1', + 'rapidfuzz==3.9.1', + 'rav1e==0.6.6', + 're2==2023.09.01', + 'readchar==4.1.0', + 'readline==8.2', + 'requests==2.32.2', + 'requests-toolbelt==1.0.0', + 'rich==13.7.1', + 's3transfer==0.10.1', + 'scanpy==1.10.1', + 'scikit-learn==1.1.3', + 'scipy==1.13.0', + 'scvelo==0.3.2', + 'scvi-tools==1.1.2', + 'seaborn==0.13.2', + 'seaborn-base==0.13.2', + 'session-info==1.0.0', + 'setuptools==70.0.0', + 'shellingham==1.5.4', + 'six==1.16.0', + 'sleef==3.5.1', + 'snappy==1.2.0', + 'sniffio==1.3.1', + 'soupsieve==2.5', + 'sparse==0.15.3', + 'sqlite==3.45.3', + 'starlette==0.37.2', + 'starsessions==1.3.0', + 'statsmodels==0.14.2', + 'stdlib-list==0.10.0', + 'svt-av1==2.1.0', + 'sympy==1.12', + 'tbb==2021.12.0', + 'tensorstore==0.1.59', + 'threadpoolctl==3.5.0', + 'tk==8.6.13', + 'tomli==2.0.1', + 'tomlkit==0.12.5', + 'toolz==0.12.1', + 'torchmetrics==1.4.0.post0', + 'tqdm==4.66.4', + 'traitlets==5.14.3', + 'trove-classifiers==2024.5.22', + 'typer==0.12.3', + 'typer-slim==0.12.3', + 'typer-slim-standard==0.12.3', + 'types-python-dateutil==2.9.0.20240316', + 'typing-extensions==4.11.0', + 'typing_extensions==4.11.0', + 'tzdata==2024a', + 'ujson==5.10.0', + 'umap-learn==0.5.5', + 'unicodedata2==15.1.0', + 'urllib3==1.26.18', + 'uvicorn==0.29.0', + 'virtualenv==20.26.2', + 'wcwidth==0.2.13', + 'websocket-client==1.8.0', + 'websockets==11.0.3', + 'wheel==0.43.0', + 'xarray==2024.5.0', + 'xattr==1.1.0', + 'xlrd==1.2.0', + 'xorg-libxau==1.0.11', + 'xorg-libxdmcp==1.1.3', + 'xz==5.2.6', + 'yaml==0.2.5', + 'zipp==3.17.0', + 'zstd==1.5.6' + ) +) + +.scvelo.dependencies.MacOSX <- list( + channels = c("conda-forge", "bioconda"), + packages = c( + 'absl-py==2.1.0', + 'anndata==0.10.7', + 'annotated-types==0.7.0', + 'anyio==4.3.0', + 'aom==3.9.0', + 'array-api-compat==1.6', + 'arrow==1.3.0', + 'beautifulsoup4==4.12.3', + 'blessed==1.19.1', + 'blosc==1.21.5', + 'boto3==1.34.111', + 'botocore==1.34.111', + 'brotli==1.1.0', + 'brotli-bin==1.1.0', + 'brotli-python==1.1.0', + 'bzip2==1.0.8', + 'c-ares==1.28.1', + 'ca-certificates==2024.2.2', + 'cachecontrol==0.14.0', + 'cachecontrol-with-filecache==0.14.0', + 'cached-property==1.5.2', + 'cached_property==1.5.2', + 'certifi==2024.2.2', + 'cffi==1.16.0', + 'charset-normalizer==3.3.2', + 'chex==0.1.86', + 'cleo==2.1.0', + 'click==8.1.7', + 'colorama==0.4.6', + 'contextlib2==21.6.0', + 'contourpy==1.2.1', + 'crashtest==0.4.1', + 'croniter==1.3.15', + 'cycler==0.12.1', + 'dateutils==0.6.12', + 'dav1d==1.2.1', + 'deepdiff==7.0.1', + 'distlib==0.3.8', + 'dnspython==2.6.1', + 'docrep==0.3.2', + 'dulwich==0.21.7', + 'email-validator==2.1.1', + 'email_validator==2.1.1', + 'et_xmlfile==1.1.0', + 'etils==1.6.0', + 'exceptiongroup==1.2.0', + 'fastapi==0.111.0', + 'fastapi-cli==0.0.4', + 'filelock==3.14.0', + 'flax==0.8.3', + 'fonttools==4.51.0', + 'freetype==2.12.1', + 'fsspec==2023.12.2', + 'get-annotations==0.1.2', + 'gmp==6.3.0', + 'gmpy2==2.1.5', + 'h11==0.14.0', + 'h2==4.1.0', + 'h5py==3.11.0', + 'hdf5==1.14.3', + 'hpack==4.0.0', + 'httpcore==1.0.5', + 'httpx==0.27.0', + 'hyperframe==6.0.1', + 'icu==73.2', + 'idna==3.7', + 'importlib-metadata==7.1.0', + 'importlib-resources==6.4.0', + 'importlib_metadata==7.1.0', + 'importlib_resources==6.4.0', + 'inquirer==3.1.4', + 'itsdangerous==2.2.0', + 'jaraco.classes==3.4.0', + 'jax==0.4.27', + 'jaxlib==0.4.23', + 'jinja2==3.1.4', + 'jmespath==1.0.1', + 'joblib==1.4.2', + 'keyring==24.3.1', + 'kiwisolver==1.4.5', + 'krb5==1.21.2', + 'lcms2==2.16', + 'legacy-api-wrap==1.4', + 'lerc==4.0.0', + 'libabseil==20240116.2', + 'libaec==1.1.3', + 'libavif16==1.0.4', + 'libblas==3.9.0', + 'libbrotlicommon==1.1.0', + 'libbrotlidec==1.1.0', + 'libbrotlienc==1.1.0', + 'libcblas==3.9.0', + 'libcurl==8.8.0', + 'libcxx==17.0.6', + 'libdeflate==1.20', + 'libedit==3.1.20191231', + 'libev==4.33', + 'libffi==3.4.2', + 'libgfortran==5.0.0', + 'libgfortran5==13.2.0', + 'libgrpc==1.62.2', + 'libhwloc==2.10.0', + 'libiconv==1.17', + 'libjpeg-turbo==3.0.0', + 'liblapack==3.9.0', + 'libllvm14==14.0.6', + 'libnghttp2==1.58.0', + 'libopenblas==0.3.27', + 'libpng==1.6.43', + 'libprotobuf==4.25.3', + 'libre2-11==2023.09.01', + 'libsqlite==3.45.3', + 'libssh2==1.11.0', + 'libtiff==4.6.0', + 'libtorch==2.3.0', + 'libuv==1.48.0', + 'libwebp-base==1.4.0', + 'libxcb==1.15', + 'libxml2==2.12.7', + 'libzlib==1.2.13', + 'lightning==2.0.4', + 'lightning-cloud==0.5.69', + 'lightning-utilities==0.11.2', + 'llvm-openmp==18.1.5', + 'llvmlite==0.42.0', + 'loompy==3.0.6', + 'lz4-c==1.9.4', + 'markdown-it-py==3.0.0', + 'markupsafe==2.1.5', + 'matplotlib-base==3.8.4', + 'mdurl==0.1.2', + 'ml-collections==0.1.1', + 'ml_dtypes==0.4.0', + 'more-itertools==10.2.0', + 'mpc==1.3.1', + 'mpfr==4.2.1', + 'mpmath==1.3.0', + 'msgpack-python==1.0.8', + 'mudata==0.2.3', + 'multipledispatch==0.6.0', + 'munkres==1.1.4', + 'natsort==8.4.0', + 'ncurses==6.5', + 'nest-asyncio==1.6.0', + 'networkx==3.2.1', + 'nomkl==1.0', + 'numba==0.59.1', + 'numpy==1.26.4', + 'numpy_groupies==0.11.1', + 'numpyro==0.15.0', + 'openjpeg==2.5.2', + 'openpyxl==3.1.2', + 'openssl==3.3.0', + 'opt-einsum==3.3.0', + 'opt_einsum==3.3.0', + 'optax==0.2.2', + 'orbax-checkpoint==0.4.4', + 'ordered-set==4.1.0', + 'orjson==3.10.3', + 'packaging==24.0', + 'pandas==2.2.2', + 'patsy==0.5.6', + 'pexpect==4.9.0', + 'pillow==10.3.0', + 'pip==24.0', + 'pkginfo==1.10.0', + 'platformdirs==4.2.2', + 'poetry==1.8.3', + 'poetry-core==1.9.0', + 'poetry-plugin-export==1.8.0', + 'protobuf==4.25.3', + 'psutil==5.9.8', + 'pthread-stubs==0.4', + 'ptyprocess==0.7.0', + 'pybind11-abi==4', + 'pycparser==2.22', + 'pydantic==2.7.1', + 'pydantic-core==2.18.2', + 'pygments==2.18.0', + 'pyjwt==2.8.0', + 'pynndescent==0.5.12', + 'pyparsing==3.1.2', + 'pyproject_hooks==1.1.0', + 'pyro-api==0.1.2', + 'pyro-ppl==1.9.0', + 'pysocks==1.7.1', + 'python==3.9.12', + 'python-build==1.2.1', + 'python-dateutil==2.9.0', + 'python-editor==1.0.4', + 'python-fastjsonschema==2.19.1', + 'python-installer==0.7.0', + 'python-multipart==0.0.9', + 'python-tzdata==2024.1', + 'python_abi==3.9', + 'pytorch==2.3.0', + 'pytorch-lightning==2.2.2', + 'pytz==2024.1', + 'pyyaml==6.0.1', + 'rapidfuzz==3.9.1', + 'rav1e==0.6.6', + 're2==2023.09.01', + 'readchar==4.1.0', + 'readline==8.2', + 'requests==2.32.2', + 'requests-toolbelt==1.0.0', + 'rich==13.7.1', + 's3transfer==0.10.1', + 'scanpy==1.10.1', + 'scikit-learn==1.1.3', + 'scipy==1.13.0', + 'scvelo==0.3.2', + 'scvi-tools==1.1.2', + 'seaborn==0.13.2', + 'seaborn-base==0.13.2', + 'session-info==1.0.0', + 'setuptools==70.0.0', + 'shellingham==1.5.4', + 'six==1.16.0', + 'sleef==3.5.1', + 'snappy==1.2.0', + 'sniffio==1.3.1', + 'soupsieve==2.5', + 'sparse==0.15.3', + 'sqlite==3.45.3', + 'starlette==0.37.2', + 'starsessions==1.3.0', + 'statsmodels==0.14.2', + 'stdlib-list==0.10.0', + 'svt-av1==2.1.0', + 'sympy==1.12', + 'tbb==2021.12.0', + 'tensorstore==0.1.59', + 'threadpoolctl==3.5.0', + 'tk==8.6.13', + 'tomli==2.0.1', + 'tomlkit==0.12.5', + 'toolz==0.12.1', + 'torchmetrics==1.4.0.post0', + 'tqdm==4.66.4', + 'traitlets==5.14.3', + 'trove-classifiers==2024.5.22', + 'typer==0.12.3', + 'typer-slim==0.12.3', + 'typer-slim-standard==0.12.3', + 'types-python-dateutil==2.9.0.20240316', + 'typing-extensions==4.11.0', + 'typing_extensions==4.11.0', + 'tzdata==2024a', + 'ujson==5.10.0', + 'umap-learn==0.5.5', + 'unicodedata2==15.1.0', + 'urllib3==1.26.18', + 'uvicorn==0.29.0', + 'virtualenv==20.26.2', + 'wcwidth==0.2.13', + 'websocket-client==1.8.0', + 'websockets==11.0.3', + 'wheel==0.43.0', + 'xarray==2024.5.0', + 'xattr==1.1.0', + 'xlrd==1.2.0', + 'xorg-libxau==1.0.11', + 'xorg-libxdmcp==1.1.3', + 'xz==5.2.6', + 'yaml==0.2.5', + 'zipp==3.17.0', + 'zstd==1.5.6' + ) +) + +.scvelo.dependencies.Linux <- list( + channels = c("conda-forge", "bioconda"), + packages = c( + c( + '_libgcc_mutex==0.1', + '_openmp_mutex==4.5', + 'absl-py==2.1.0', + 'anndata==0.10.7', + 'annotated-types==0.7.0', + 'anyio==4.3.0', + 'aom==3.9.0', + 'array-api-compat==1.6', + 'arrow==1.3.0', + 'beautifulsoup4==4.12.3', + 'blessed==1.19.1', + 'blosc==1.21.5', + 'boto3==1.34.111', + 'botocore==1.34.111', + 'brotli==1.1.0', + 'brotli-bin==1.1.0', + 'brotli-python==1.1.0', + 'bzip2==1.0.8', + 'c-ares==1.28.1', + 'ca-certificates==2024.2.2', + 'cachecontrol==0.14.0', + 'cachecontrol-with-filecache==0.14.0', + 'cached-property==1.5.2', + 'cached_property==1.5.2', + 'certifi==2024.2.2', + 'cffi==1.16.0', + 'charset-normalizer==3.3.2', + 'chex==0.1.86', + 'cleo==2.1.0', + 'click==8.1.7', + 'colorama==0.4.6', + 'contextlib2==21.6.0', + 'contourpy==1.2.1', + 'crashtest==0.4.1', + 'croniter==1.3.15', + 'cryptography==42.0.7', + 'cycler==0.12.1', + 'dateutils==0.6.12', + 'dav1d==1.2.1', + 'dbus==1.13.6', + 'deepdiff==7.0.1', + 'distlib==0.3.8', + 'dnspython==2.6.1', + 'docrep==0.3.2', + 'dulwich==0.21.7', + 'email-validator==2.1.1', + 'email_validator==2.1.1', + 'et_xmlfile==1.1.0', + 'etils==1.6.0', + 'exceptiongroup==1.2.0', + 'expat==2.6.2', + 'fastapi==0.111.0', + 'fastapi-cli==0.0.4', + 'filelock==3.14.0', + 'flax==0.8.3', + 'fonttools==4.51.0', + 'freetype==2.12.1', + 'fsspec==2023.12.2', + 'get-annotations==0.1.2', + 'gmp==6.3.0', + 'gmpy2==2.1.5', + 'h11==0.14.0', + 'h2==4.1.0', + 'h5py==3.11.0', + 'hdf5==1.14.3', + 'hpack==4.0.0', + 'httpcore==1.0.5', + 'httpx==0.27.0', + 'hyperframe==6.0.1', + 'icu==73.2', + 'idna==3.7', + 'importlib-metadata==7.1.0', + 'importlib-resources==6.4.0', + 'importlib_metadata==7.1.0', + 'importlib_resources==6.4.0', + 'inquirer==3.1.4', + 'itsdangerous==2.2.0', + 'jaraco.classes==3.4.0', + 'jax==0.4.27', + 'jaxlib==0.4.23', + 'jeepney==0.8.0', + 'jinja2==3.1.4', + 'jmespath==1.0.1', + 'joblib==1.4.2', + 'keyring==24.3.1', + 'keyutils==1.6.1', + 'kiwisolver==1.4.5', + 'krb5==1.21.2', + 'lcms2==2.16', + 'ld_impl_linux-64==2.40', + 'legacy-api-wrap==1.4', + 'lerc==4.0.0', + 'libabseil==20240116.2', + 'libaec==1.1.3', + 'libavif16==1.0.4', + 'libblas==3.9.0', + 'libbrotlicommon==1.1.0', + 'libbrotlidec==1.1.0', + 'libbrotlienc==1.1.0', + 'libcblas==3.9.0', + 'libcurl==8.8.0', + 'libdeflate==1.20', + 'libedit==3.1.20191231', + 'libev==4.33', + 'libexpat==2.6.2', + 'libffi==3.4.2', + 'libgcc-ng==13.2.0', + 'libgfortran-ng==13.2.0', + 'libgfortran5==13.2.0', + 'libglib==2.80.2', + 'libgomp==13.2.0', + 'libgrpc==1.62.2', + 'libhwloc==2.10.0', + 'libiconv==1.17', + 'libjpeg-turbo==3.0.0', + 'liblapack==3.9.0', + 'libllvm14==14.0.6', + 'libnghttp2==1.58.0', + 'libnsl==2.0.1', + 'libopenblas==0.3.27', + 'libpng==1.6.43', + 'libprotobuf==4.25.3', + 'libre2-11==2023.09.01', + 'libsqlite==3.45.3', + 'libssh2==1.11.0', + 'libstdcxx-ng==13.2.0', + 'libtiff==4.6.0', + 'libtorch==2.3.0', + 'libuuid==2.38.1', + 'libuv==1.48.0', + 'libwebp-base==1.4.0', + 'libxcb==1.15', + 'libxml2==2.12.7', + 'libzlib==1.2.13', + 'lightning==2.0.4', + 'lightning-cloud==0.5.69', + 'lightning-utilities==0.11.2', + 'llvmlite==0.42.0', + 'loompy==3.0.6', + 'lz4-c==1.9.4', + 'markdown-it-py==3.0.0', + 'markupsafe==2.1.5', + 'matplotlib-base==3.8.4', + 'mdurl==0.1.2', + 'ml-collections==0.1.1', + 'ml_dtypes==0.4.0', + 'more-itertools==10.2.0', + 'mpc==1.3.1', + 'mpfr==4.2.1', + 'mpmath==1.3.0', + 'msgpack-python==1.0.8', + 'mudata==0.2.3', + 'multipledispatch==0.6.0', + 'munkres==1.1.4', + 'natsort==8.4.0', + 'ncurses==6.5', + 'nest-asyncio==1.6.0', + 'networkx==3.2.1', + 'nomkl==1.0', + 'numba==0.59.1', + 'numpy==1.26.4', + 'numpy_groupies==0.11.1', + 'numpyro==0.15.0', + 'openjpeg==2.5.2', + 'openpyxl==3.1.2', + 'openssl==3.3.0', + 'opt-einsum==3.3.0', + 'opt_einsum==3.3.0', + 'optax==0.2.2', + 'orbax-checkpoint==0.4.4', + 'ordered-set==4.1.0', + 'orjson==3.10.3', + 'packaging==24.0', + 'pandas==2.2.2', + 'patsy==0.5.6', + 'pcre2==10.43', + 'pexpect==4.9.0', + 'pillow==10.3.0', + 'pip==24.0', + 'pkginfo==1.10.0', + 'platformdirs==4.2.2', + 'poetry==1.8.3', + 'poetry-core==1.9.0', + 'poetry-plugin-export==1.8.0', + 'protobuf==4.25.3', + 'psutil==5.9.8', + 'pthread-stubs==0.4', + 'ptyprocess==0.7.0', + 'pybind11-abi==4', + 'pycparser==2.22', + 'pydantic==2.7.1', + 'pydantic-core==2.18.2', + 'pygments==2.18.0', + 'pyjwt==2.8.0', + 'pynndescent==0.5.12', + 'pyparsing==3.1.2', + 'pyproject_hooks==1.1.0', + 'pyro-api==0.1.2', + 'pyro-ppl==1.9.0', + 'pysocks==1.7.1', + 'python==3.9.12', + 'python-build==1.2.1', + 'python-dateutil==2.9.0', + 'python-editor==1.0.4', + 'python-fastjsonschema==2.19.1', + 'python-installer==0.7.0', + 'python-multipart==0.0.9', + 'python-tzdata==2024.1', + 'python_abi==3.9', + 'pytorch==2.3.0', + 'pytorch-lightning==2.2.2', + 'pytz==2024.1', + 'pyyaml==6.0.1', + 'rapidfuzz==3.9.1', + 'rav1e==0.6.6', + 're2==2023.09.01', + 'readchar==4.1.0', + 'readline==8.2', + 'requests==2.32.2', + 'requests-toolbelt==1.0.0', + 'rich==13.7.1', + 's3transfer==0.10.1', + 'scanpy==1.10.1', + 'scikit-learn==1.1.3', + 'scipy==1.13.0', + 'scvelo==0.3.2', + 'scvi-tools==1.1.2', + 'seaborn==0.13.2', + 'seaborn-base==0.13.2', + 'secretstorage==3.3.3', + 'session-info==1.0.0', + 'setuptools==70.0.0', + 'shellingham==1.5.4', + 'six==1.16.0', + 'sleef==3.5.1', + 'snappy==1.2.0', + 'sniffio==1.3.1', + 'soupsieve==2.5', + 'sparse==0.15.3', + 'sqlite==3.45.3', + 'starlette==0.37.2', + 'starsessions==1.3.0', + 'statsmodels==0.14.2', + 'stdlib-list==0.10.0', + 'svt-av1==2.1.0', + 'sympy==1.12', + 'tbb==2021.12.0', + 'tensorstore==0.1.59', + 'threadpoolctl==3.5.0', + 'tk==8.6.13', + 'tomli==2.0.1', + 'tomlkit==0.12.5', + 'toolz==0.12.1', + 'torchmetrics==1.4.0.post0', + 'tqdm==4.66.4', + 'traitlets==5.14.3', + 'trove-classifiers==2024.5.22', + 'typer==0.12.3', + 'typer-slim==0.12.3', + 'typer-slim-standard==0.12.3', + 'types-python-dateutil==2.9.0.20240316', + 'typing-extensions==4.11.0', + 'typing_extensions==4.11.0', + 'tzdata==2024a', + 'ujson==5.10.0', + 'umap-learn==0.5.5', + 'unicodedata2==15.1.0', + 'urllib3==1.26.18', + 'uvicorn==0.29.0', + 'virtualenv==20.26.2', + 'wcwidth==0.2.13', + 'websocket-client==1.8.0', + 'websockets==11.0.3', + 'wheel==0.43.0', + 'xarray==2024.5.0', + 'xlrd==1.2.0', + 'xorg-libxau==1.0.11', + 'xorg-libxdmcp==1.1.3', + 'xz==5.2.6', + 'yaml==0.2.5', + 'zipp==3.17.0', + 'zstd==1.5.6' + ) + ) +) + +if (basilisk.utils::isWindows()) { + .scvelo_dependencies <- .scvelo.dependencies.Windows +} else if (basilisk.utils::isLinux()) { + .scvelo_dependencies <- .scvelo.dependencies.Linux +} else if (basilisk.utils::isMacOSX()) { + .scvelo_dependencies <- .scvelo.dependencies.MacOSX +} else if (basilisk.utils::isMacOSXArm()) { + .scvelo_dependencies <- .scvelo.dependencies.MacOSXArm +} else { + stop("Unsupported operating system or architecture.\n Please open an issue at to request support.") +} #' @importFrom basilisk BasiliskEnvironment #' @importFrom zellkonverter AnnDataDependencies velo.env <- BasiliskEnvironment("env", "velociraptor", - packages=.scvelo_dependencies, channels = c("bioconda", "conda-forge")) + packages=.scvelo_dependencies$packages, channels = .scvelo_dependencies$channels) diff --git a/R/scvelo.R b/R/scvelo.R index 85387f8..fe8548c 100644 --- a/R/scvelo.R +++ b/R/scvelo.R @@ -98,6 +98,31 @@ #' } #' See the \pkg{scVelo} documentation for more details about the available arguments and the examples below for a syntax example. #' +#' @section Supported operating systems and architectures: +#' \pkg{scVelo} dependencies are pinned in a Conda environment to ensure reproducibility. +#' +#' Differences in packages and versions available from Conda require different environments for different operating systems and architectures. +#' \pkg{basilisk.utils} is used to determine the operating system and architecture of the computer used to run \code{scvelo()}, using to the appropriate Conda environment. +#' +#' As of the latest \pkg{velociraptor} update (24 May 2024): +#' +#' \describe{ +#' \item{Linux}{\pkg{scVelo} v0.3.2 from conda-forge is used. +#' This is the latest version available to date. +#' Note that +#' \pkg{matplotlib} is pinned to v3.7.3 (\url{https://stackoverflow.com/questions/77128061/ydata-profiling-profilereport-attributeerror-module-matplotlib-cbook-has-no}) +#' and \pkg{numpy} is pinned to v1.23.1 (\url{https://github.com/OpenTalker/video-retalking/issues/35})} +#' \item{MacOS Arm}{\pkg{scVelo} v0.3.2 from conda-forge is used. +#' This is the latest version available to date. +#' Tested on M1.} +#' \item{Windows}{\pkg{scVelo} v0.2.5 from bioconda is used. +#' Later versions of \pkg{scVelo} depend on \pkg{jaxlib} which is not supported on Windows (\url{https://github.com/google/jax/issues/438}). +#' Note that \pkg{matplotlib} is pinned to v3.6.3 (\url{https://github.com/scverse/scanpy/issues/2411}), +#' \pkg{pandas} is pinned to v1.5.2 (\url{https://stackoverflow.com/questions/76234312/importerror-cannot-import-name-is-categorical-from-pandas-api-types}), +#' and \pkg{numpy} is pinned to v1.21.1 (\url{https://github.com/theislab/scvelo/issues/1109}). +#' } +#' } +#' #' @return #' A \linkS4class{SingleCellExperiment} is returned containing the output of the velocity calculations. #' Of particular interest are: @@ -124,12 +149,12 @@ #' #' # make scvelo use 10 rather than the default 30 neighbors to compute moments for velocity estimation: #' out <- scvelo(list(X=spliced, spliced=spliced, unspliced=unspliced), -#' scvelo.params=list(moments=list(n_neighbors=10L))) +#' scvelo.params=list(neighbors=list(n_neighbors=10L))) #' #' @references #' Bergen, V., Lange, M., Peidli, S. et al. Generalizing RNA velocity to transient cell states through dynamical modeling. Nat Biotechnol 38, 1408–1414 (2020). \url{https://doi.org/10.1038/s41587-020-0591-3} #' -#' @author Aaron Lun, Charlotte Soneson +#' @author Aaron Lun, Charlotte Soneson, Kevin Rue-Albrecht #' @name scvelo NULL @@ -138,6 +163,7 @@ NULL #' @importFrom BiocSingular bsparam runPCA #' @importFrom BiocParallel SerialParam #' @importFrom Matrix t +#' @importFrom zellkonverter AnnData2SCE .scvelo <- function(x, subset.row=NULL, sf.X=NULL, sf.spliced=NULL, sf.unspliced=NULL, use.theirs=FALSE, @@ -148,35 +174,35 @@ NULL spliced <- x$spliced unspliced <- x$unspliced X <- x$X - + refdim <- as.integer(dim(spliced)) if (!identical(refdim, as.integer(dim(unspliced))) || !identical(refdim, as.integer(dim(X)))) { stop("matrices in 'x' must have the same dimensions") } - + if (!use.theirs) { X <- normalizeCounts(X, sf.X, log=TRUE) spliced <- normalizeCounts(spliced, sf.spliced, log=FALSE) unspliced <- normalizeCounts(unspliced, sf.unspliced, log=FALSE) - + if (!is.null(subset.row)) { X <- X[subset.row,,drop=FALSE] spliced <- spliced[subset.row,,drop=FALSE] unspliced <- unspliced[subset.row,,drop=FALSE] } - + if (is.null(dimred)) { dimred <- runPCA(t(X), rank=ncomponents, BSPARAM=BSPARAM, BPPARAM=BPPARAM)$x } } - + mode <- match.arg(mode) output <- basiliskRun(env=velo.env, fun=.run_scvelo, X=X, spliced=spliced, unspliced=unspliced, use.theirs=use.theirs, mode=mode, scvelo.params=scvelo.params, dimred=dimred, testload = c("scvelo", "anndata")) - + output } @@ -184,42 +210,61 @@ NULL X <- t(velociraptor:::.make_np_friendly(X)) spliced <- t(velociraptor:::.make_np_friendly(spliced)) unspliced <- t(velociraptor:::.make_np_friendly(unspliced)) - + and <- reticulate::import("anndata") scv <- reticulate::import("scvelo") + sc <- reticulate::import("scanpy") adata <- and$AnnData(X, layers=list(spliced=spliced, unspliced=unspliced)) adata$obs_names <- rownames(spliced) adata$var_names <- colnames(spliced) - + ## A supplied dimred will be used even if use.theirs=TRUE if (!is.null(dimred)) { dimred <- velociraptor:::.make_np_friendly(dimred) adata$obsm <- list(X_pca = dimred) } - + if (use.theirs) { do.call(scv$pp$filter_and_normalize, c(list(data=adata), scvelo.params$filter_and_normalize)) } - + + do.call(sc$pp$neighbors, c(list(adata), scvelo.params$neighbors)) + + if (!is.null(scvelo.params$moments)) { + if (!is.null(scvelo.params$moments$n_neighbors)) { + stop("scvelo.params$moments$n_neighbors is deprecated; use scvelo.params$neighbors$n_neighbors instead") + } + if (!is.null(scvelo.params$moments$n_pcs)) { + stop("scvelo.params$moments$n_pcs is deprecated; use scvelo.params$neighbors$n_pcs instead") + } + } else { + # if unspecified, set to NULL (= None) + # see https://github.com/theislab/scvelo/issues/1212 + scvelo.params$moments <- list( + n_neighbors = NULL, + n_pcs = NULL + ) + } + do.call(scv$pp$moments, c(list(data=adata), scvelo.params$moments)) - + if (mode=="dynamical") { do.call(scv$tl$recover_dynamics, c(list(data=adata), scvelo.params$recover_dynamics)) } - + scvelo.params$velocity$mode <- mode do.call(scv$tl$velocity, c(list(data=adata), scvelo.params$velocity)) - + do.call(scv$tl$velocity_graph, c(list(data=adata), scvelo.params$velocity_graph)) - + do.call(scv$tl$velocity_pseudotime, c(list(adata=adata), scvelo.params$velocity_pseudotime)) - + if (mode=="dynamical") { do.call(scv$tl$latent_time, c(list(data=adata), scvelo.params$latent_time)) } - + do.call(scv$tl$velocity_confidence, c(list(data=adata), scvelo.params$velocity_confidence)) - + zellkonverter::AnnData2SCE(adata) } diff --git a/man/scvelo.Rd b/man/scvelo.Rd index 2158660..512c46a 100644 --- a/man/scvelo.Rd +++ b/man/scvelo.Rd @@ -93,7 +93,7 @@ containing the velocity pseudotime for each cell. containing the velocity vectors for each cell. } The output will always have number of columns equal to the number of cells supplied in \code{x}, -though the number of rows will depend on whether any subsetting (if \code{subset.row} is supplied) +though the number of rows will depend on whether any subsetting (if \code{subset.row} is supplied) or feature selection (if \code{use.theirs=TRUE}) was performed. } \description{ @@ -167,6 +167,33 @@ The PCA is not performed if \code{dimred} or \code{use.dimred} is already suppli See the \pkg{scVelo} documentation for more details about the available arguments and the examples below for a syntax example. } +\section{Supported operating systems and architectures}{ + +\pkg{scVelo} dependencies are pinned in a Conda environment to ensure reproducibility. + +Differences in packages and versions available from Conda require different environments for different operating systems and architectures. +\pkg{basilisk.utils} is used to determine the operating system and architecture of the computer used to run \code{scvelo()}, using to the appropriate Conda environment. + +As of the latest \pkg{velociraptor} update (24 May 2024): + +\describe{ +\item{Linux}{\pkg{scVelo} v0.3.2 from conda-forge is used. +This is the latest version available to date. +Note that +\pkg{matplotlib} is pinned to v3.7.3 (\url{https://stackoverflow.com/questions/77128061/ydata-profiling-profilereport-attributeerror-module-matplotlib-cbook-has-no}) +and \pkg{numpy} is pinned to v1.23.1 (\url{https://github.com/OpenTalker/video-retalking/issues/35})} +\item{MacOS Arm}{\pkg{scVelo} v0.3.2 from conda-forge is used. +This is the latest version available to date. +Tested on M1.} +\item{Windows}{\pkg{scVelo} v0.2.5 from bioconda is used. +Later versions of \pkg{scVelo} depend on \pkg{jaxlib} which is not supported on Windows (\url{https://github.com/google/jax/issues/438}). +Note that \pkg{matplotlib} is pinned to v3.6.3 (\url{https://github.com/scverse/scanpy/issues/2411}), +\pkg{pandas} is pinned to v1.5.2 (\url{https://stackoverflow.com/questions/76234312/importerror-cannot-import-name-is-categorical-from-pandas-api-types}), +and \pkg{numpy} is pinned to v1.21.1 (\url{https://github.com/theislab/scvelo/issues/1109}). +} +} +} + \examples{ # Using mock data to demonstrate the process: library(scuttle) @@ -179,13 +206,13 @@ unspliced <- counts(sce2) out <- scvelo(list(X=spliced, spliced=spliced, unspliced=unspliced)) # make scvelo use 10 rather than the default 30 neighbors to compute moments for velocity estimation: -out <- scvelo(list(X=spliced, spliced=spliced, unspliced=unspliced), - scvelo.params=list(moments=list(n_neighbors=10L))) +out <- scvelo(list(X=spliced, spliced=spliced, unspliced=unspliced), + scvelo.params=list(neighbors=list(n_neighbors=10L))) } \references{ Bergen, V., Lange, M., Peidli, S. et al. Generalizing RNA velocity to transient cell states through dynamical modeling. Nat Biotechnol 38, 1408–1414 (2020). \url{https://doi.org/10.1038/s41587-020-0591-3} } \author{ -Aaron Lun, Charlotte Soneson +Aaron Lun, Charlotte Soneson, Kevin Rue-Albrecht } diff --git a/vignettes/velociraptor.Rmd b/vignettes/velociraptor.Rmd index f5e6329..18b4297 100644 --- a/vignettes/velociraptor.Rmd +++ b/vignettes/velociraptor.Rmd @@ -64,11 +64,20 @@ top.hvgs <- getTopHVGs(dec, n=2000) We can plug these choices into the `scvelo()` function with our `SingleCellExperiment` object. By default, `scvelo()` uses the steady-state approach to estimate velocities, -though the stochastic and dynamical models implemented in `r basilisk::PyPiLink("scvelo")` can also be used by modifying the `mode` argument. +though the stochastic and dynamical models implemented in `r basilisk::PyPiLink("scvelo")` can also be used by modifying the `mode` argument. + +Note that automatic neighbor calculation is deprecated since scvelo==0.4.0 and will be removed in a future version. +Instead, `r BiocStyle::Biocpkg("velociraptor")` computes neighbors with Scanpy (as per [scVelo recommendations](https://github.com/theislab/scvelo/blob/f21651c3b122860d8ae6b5a5173f242ba91c8761/scvelo/preprocessing/moments.py#L66)), and the number of neighbors should be supplied to [scanpy.pp.neighbors](https://scanpy.readthedocs.io/en/stable/api/generated/scanpy.pp.neighbors.html) as demonstrated below. + +In particular, the default number of neighbors was 30 for [scvelo.pp.moments](https://scvelo.readthedocs.io/en/stable/scvelo.pp.moments.html) while it is 15 for [scanpy.pp.neighbors](https://scanpy.readthedocs.io/en/stable/api/generated/scanpy.pp.neighbors.html). +Users should use `scvelo.params=list(neighbors=list(n_neighbors=30L)` to reproduce earlier results. ```{r} library(velociraptor) -velo.out <- scvelo(sce, subset.row=top.hvgs, assay.X="spliced") +velo.out <- scvelo( + sce, subset.row=top.hvgs, assay.X="spliced", + scvelo.params=list(neighbors=list(n_neighbors=30L)) +) velo.out ``` @@ -88,7 +97,7 @@ library(scater) set.seed(100) sce <- runPCA(sce, subset_row=top.hvgs) -sce <- runTSNE(sce, dimred="PCA") +sce <- runTSNE(sce, dimred="PCA", perplexity = 30) sce$velocity_pseudotime <- velo.out$velocity_pseudotime plotTSNE(sce, colour_by="velocity_pseudotime")