Skip to content

Instantly share code, notes, and snippets.

@ATpoint
Created October 8, 2024 08:35
Show Gist options
  • Save ATpoint/098b9f61c8a36f160ad2349a8b3bd541 to your computer and use it in GitHub Desktop.
Save ATpoint/098b9f61c8a36f160ad2349a8b3bd541 to your computer and use it in GitHub Desktop.
Get scvelo going on Windows using reticulate and conda
# Install R infrastructure
pkg_install <- c("reticulate", "zellkonverter")
BiocManager::install(pkg_install, update = FALSE)
# Install conda itself via the reticulate package, takes time...
reticulate::install_miniconda()
# Create an environment for velocity with a specific python version that is required
# to install a downgraded matplotlib, see below
reticulate::conda_create(envname = "velocity", python_version = "3.8.19")
# Directly from https://github.com/kevinrue/velociraptor/blob/devel/R/basilisk.R#L3C1-L157C2
# because manual install always resulted in conflicts with matplotlib, see https://github.com/theislab/scvelo/issues/1124
velocity_env_conda <- list(
channels = c("bioconda", "conda-forge"),
packages = c(
'anndata==0.9.2',
'blosc==1.21.6',
'brotli==1.1.0',
'brotli-bin==1.1.0',
'brotli-python==1.1.0',
'bzip2==1.0.8',
'ca-certificates==2024.7.4',
'cached-property==1.5.2',
'cached_property==1.5.2',
'certifi==2024.7.4',
'cffi==1.17.0',
'charset-normalizer==3.3.2',
'colorama==0.4.6',
'contourpy==1.1.1',
'cycler==0.12.1',
'fonttools==4.53.1',
'freetype==2.12.1',
'glib==2.80.3',
'glib-tools==2.80.3',
'gst-plugins-base==1.24.6',
'gstreamer==1.24.6',
'h2==4.1.0',
'h5py==3.8.0',
'hdf5==1.14.0',
'hpack==4.0.0',
'hyperframe==6.0.1',
'icu==73.2',
'idna==3.8',
'importlib-metadata==8.4.0',
'importlib_metadata==8.4.0',
'intel-openmp==2024.2.1',
'jinja2==3.0.3',
'joblib==1.4.2',
'kiwisolver==1.4.5',
'krb5==1.21.3',
'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.8',
'libcurl==8.9.1',
'libdeflate==1.21',
'libffi==3.4.2',
'libglib==2.80.3',
'libhwloc==2.11.1',
'libiconv==1.17',
'libintl==0.22.5',
'libintl-devel==0.22.5',
'libjpeg-turbo==3.0.0',
'liblapack==3.9.0',
'libogg==1.3.5',
'libpng==1.6.43',
'libsqlite==3.46.0',
'libssh2==1.11.0',
'libtiff==4.6.0',
'libvorbis==1.3.7',
'libwebp-base==1.4.0',
'libxcb==1.16',
'libxml2==2.12.7',
'libzlib==1.3.1',
'llvmlite==0.39.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',
'markupsafe==2.1.5',
'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.1',
'numba==0.56.4',
'numexpr==2.7.3',
'numpy==1.21.1',
'openjpeg==2.5.2',
'openssl==3.3.1',
'packaging==24.1',
'pandas==1.5.2',
'patsy==0.5.6',
'pcre2==10.44',
'pillow==10.4.0',
'pip==24.2',
'platformdirs==4.2.2',
'ply==3.11',
'pooch==1.8.2',
'pthread-stubs==0.4',
'pthreads-win32==2.9.1',
'pycparser==2.22',
'pynndescent==0.5.13',
'pyparsing==3.1.4',
'pyqt==5.15.9',
'pyqt5-sip==12.12.2',
'pysocks==1.7.1',
'pytables==3.7.0',
'python==3.8.19',
'python-dateutil==2.9.0',
'python_abi==3.8',
'pytz==2024.1',
'qt-main==5.15.8',
'requests==2.32.3',
'scanpy==1.7.2',
'scikit-learn==1.2.2',
'scipy==1.10.1',
'scvelo==0.2.5',
'seaborn==0.13.2',
'seaborn-base==0.13.2',
'setuptools==72.2.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.1',
'statsmodels==0.13.5',
'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.1',
'tqdm==4.66.5',
'typing==3.10.0.0',
'typing-extensions==4.12.2',
'typing_extensions==4.12.2',
'ucrt==10.0.22621.0',
'umap-learn==0.5.6',
'unicodedata2==15.1.0',
'urllib3==2.2.2',
'vc==14.3',
'vc14_runtime==14.40.33810',
'vs2015_runtime==14.40.33810',
'wheel==0.44.0',
'win_inet_pton==1.1.0',
'xorg-libxau==1.0.11',
'xorg-libxdmcp==1.1.3',
'xz==5.2.6',
'zipp==3.20.1',
'zstandard==0.23.0',
'zstd==1.5.6'
)
)
# Install scvelo into this environment using the above package tree
reticulate::conda_install(
envname = "velocity",
packages = velocity_env_conda$packages,
channel = velocity_env_conda$channels
)
# Load scvelo
reticulate::use_miniconda(condaenv = "velocity")
scv <- reticulate::import("scvelo")
scanpy <- reticulate::import("scanpy")
# ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment