Toolkit for interfacing with CryoSPARC. Read the documentation at tools.cryosparc.com
For usage questions and general discussion about cryosparc-tools scripts and functions, please post to the CryoSPARC discussion forum under the Scripting category.
If you would like to request or propose a feature, change or fix for cryosparc-tools source code, please either report an issue or submit a pull request.
See CONTRIBUTING.md for full details.
- Git and Git LFS
- Python >= 3.8
- C compiler such as GCC or Clang
- Clone this repository
git clone --recursive https://github.com/cryoem-uoft/cryosparc-tools.git cd cryosparc-tools git lfs pull - (Optional) Create and activate a virtual environment
python3 -m venv .venv source .venv/bin/activate # macOS / Linux # OR .venv\Scripts\activate.bat # Windows
- Install dev dependencies and build native modules
pip install -U pip wheel pip install -e ".[dev]" - Install pre-commit hooks
pre-commit install
Recompile native modules after making changes to C code:
python -m setup build_ext -iInstall build dependencies
pip install -e ".[build]"Run the build
python -m buildPackages for the current architecture and python version are added to the
dist/ directory.
Documentation is located in the docs directory and is powered by Jupyter Book.
To build the docs, install build dependencies
pip install -e ".[build]"Then run Jupyter Book
jupyter-book build docsSite will be be built into the docs/_build/html directory.
Note: Jupyter Book is not configured to re-run example notebooks upon build since the notebooks require an active CryoSPARC instance to run.
See the Run Example Notebooks section for instructions on how to run the notebooks.
Inline source documentation is compiled to HTML via Sphinx and uses Google Style Python docstrings.
The Jupyter notebooks in the example documentation require additional dependencies to execute, including the following system configuration:
- Nvidia GPU and driver
- Miniconda or Miniforge installed
- CryoSPARC running at
localhost:40000orcryoem0:40000(can aliascryoem0to localhost)
Clean previous build artefacts:
rm -rf cryosparc/*.so build dist *.egg-infoInstall dependencies into a new conda environment:
conda create -n cryosparc-tools-example -c conda-forge python=3 numpy=1.18.5 \
pyqt=5 libtiff wxPython=4.1.1 adwaita-icon-theme 'setuptools<66' # exclude these dependencies if you don't need cryolo
conda activate cryosparc-tools-example
pip install cryosparc-tools matplotlib~=3.4.0 pandas~=1.1.0 notebook
pip install 'cryolo[c11]' --extra-index-url https://pypi.ngc.nvidia.com # optional, only if you want to use cryoloBefore you run the notebook server, you may need to set the LD_LIBRARY_PATH variable to include the location of CUDA Toolkit and cuDNN runtime libraries. e.g.,
export LD_LIBRARY_PATH="$HOME/miniconda3/envs/tools/lib/python3.8/site-packages/nvidia/*/lib"Run the notebook server
jupyter notebook
Find examples in docs/examples directory
cryosparc-tools is licensed under the BSD-3-Clause license.