Skip to content

diff-use/tortoize

 
 

Repository files navigation

PyTortoize

Application to calculate Ramachandran z-scores, now accessible from Python. This package is a fork of the original PDB-REDO/tortoize repository. Changes are Copyright (c) 2026 Astera Institute.

Building

This package is a fork of the original PDB-REDO/tortoize repository. Its only goal is to use tortoize from Python, primarily via the pixi package manager. It is also possible to generate the library as a shared library with your system Python.

Pixi installation

You should use the latest version of pixi, at the time of writing 0.63.2. You will also need to download https://files.wwpdb.org/pub/pdb/data/monomers/components.cif.gz to the rsrc directory. It may be possible to simplify these instructions, but for now, do this:

git clone https://github.com/diff-use/tortoize.git
cd tortoize
sudo curl -o rsrc/components.cif https://files.wwpdb.org/pub/pdb/data/monomers/components.cif
git submodule sync --recursive
git submodule update --init --recursive
pixi install -e analysis && pixi run -e analysis python -m pip install .

If you then launch a python interpreter, e.g. pixi run -e analysis ipython, the library should be available. It is strongly recommended to test the installation:

pixi run -e analysis python -m pytest test/test_python_api.py

Using from other pixi packages

To use this package from another pixi package, you should be able add it like so to your dependencies:

[dependencies]
...
py_tortoize = { git = "https://github.com/diff-use/tortoize.git", branch = "mdc-python-bindings" }

However this does not work yet.

Installation with system python

It is possible to install py_tortoize on Linux with the system python. In that case you will have install some dependencies first. On Debian this boils down to:

sudo apt-get update && sudo apt-get install libcatch2-dev nlohmann-json3-dev libeigen3-dev

And on Ubuntu, slightly different:

sudo apt-get update && sudo apt-get install catch2 nlohmann-json3-dev libeigen3-dev

After that, building and installing should be as simple as:

git clone https://github.com/diff-use/tortoize.git
cd tortoize
cmake -S . -B build
cmake --build build
sudo cmake --install build

Note that PyTortoize requires that the binary distribution files under rsrc be in a folder relative to where your Python is installed. E.g. if your Python is installed in /usr/bin/python3, you should make sure the files are available in /usr/share/libcifpp/.. The installation should take care of this, but be aware of it if you get strange file read errors.

Usage

Right now, only one method is available:

import py_tortoize
stats = py_tortoize.tortoize_compute_stats(cif_file)

cif_file is a string path to a CIF file, and can be a gzip archive. The output is a dictionary including some metadata, summary statistics, and a list of residue-level metrics.

About

Application to calculate ramachandran z-scores, now with Python bindings

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C++ 58.5%
  • CMake 23.5%
  • Python 12.9%
  • HTML 4.8%
  • Shell 0.3%