Skip to main content

Python bindings for LabelLib - Library for coarse-grained simulations of probes flexibly coupled to biomolecules

Project description

LabelLib

Build Status PyPI Version Anaconda-Server Version Anaconda-Server Downloads DOI

General description

LabelLib is a low-level C++ library for the simulation of small probes flexibly coupled to biomolecules for the development of higher-level applications and libraries. LabelLib can calculate the distribution of flexible labels around attachment points. Such probes are for instance dyes for fluorescence spectroscopy, spin-labels for EPR and NMR, or chemical cross-links for mass-spectrometry. Typically, these labels are fluorescent dyes. For such dyes LabelLib can calculate FRET observables.

LabelLib uses a coarse-grained approach to simulate the spatial distribution of probes around their attachment point. In this coarse-grained approach, LabelLib determines the sterically accessible volume of the probe considering the linker length and the spatial dimensions of the probe. The linker connecting the probe to the biomolecule and the probe are approximated by a tube and soft sphere, respectively. Details are provided in the publications DOI for citing FPS DOI for citing FPS.

dsDNA and an AV surface

LabelLib is a library for programmers and provides APIs for C/C++ and Python. Furthermore, LabelLib can be integrated into PyMOL installations as described below. This allows to visualize the distributions of molecular probes.

Relation of other software and libraries

LabelLib serves as core low-level library for the software Olga and the higher-level Python library AvTraj. The deprecated software FPS is independent of LabelLib.

LabelLib and other software/libraries

Olga is a software dedicated towards experimentalists. Olga provides a graphical user interface for the calculation of accessible volumes (AVs), screen a set of structural models against experimental observables, rigid-body docking, and the optimal design of new FRET experiments.

Labelizer is a web application for accessible-volume and labeling workflows, including FRET-oriented setup and analysis built on top of the LabelLib ecosystem. Labelizer paper: Nature Communications (2025)

AvTraj AvTraj is a Python library for the calculation of accessible volumes (AVs), screening. AvTraj facilitates the development of new analytical approaches for FRET-based structural models. Avtraj facilitates processing of MD-simulations and the development of Python scripts handling FRET-based structural models.

IMP is a framework for integrative structural modeling that combines multiple experimental restraints.

IMP.bff is IMP's Bayesian Fluorescence Framework. It extends IMP with fluorescence/FRET functionality, including Accessible Volume (AV) calculations and FRET restraints that can be combined with other restraints in integrative modeling workflows. Documentation: docs.peulen.xyz/bff IMP.bff preprint: bioRxiv (2023)

FPS is a software with a graphical user interface for the FRET-based structural modeling. FPS can calculate accessible volumes (AVs), screen a set of structural models against experimental observables, and can generate new structural models by rigid-body docking using experimental FRET data.

Building and installation

C++ shared library

C++ shared library can be installed from source with cmake:

git clone --recursive https://github.com/Fluorescence-Tools/LabelLib.git
mkdir LabelLib/build
cd LabelLib/build
cmake ..
sudo make install

If you build from a source archive without git submodules (for example GitHub/Zenodo tarballs), install Eigen3 and pybind11 in your build environment first. On Linux you can build and install a package instead (prefered):

...
cmake .. && make package
sudo dpkg -i FlexLabel-*-Linux.deb

Python bindings

Python bindings can be be either installed via pip or conda. Installation of the C++ library is not necessary for this. The python binding can be installed via pip using the following command:

sudo pip install LabelLib

The python bindings can be installed via conda using the following command:

conda install -c tpeulen labellib

Usage

Pymol

To access the functionality of LabelLib in PyMOL two basic prerequisites need to be fulfilled:

  1. LabelLib needs to be installed in the Python installation used by PyMOL
  2. The file LabelLib_pymol.py needs to be downloaded and executed from PyMOL's command line interace.

These two prerequisite can be fulfiled manually, by copying LabelLib into your PyMOL installation folder or by installing both, PyMol and LabelLib in the same conda environment using precompiled distributions for both.

conda install -c tpeulen labellib
conda install -c schrodinger pymol

Using a PyMol installation that has access to a LabelLib installation, the PyMol script file "LabelLib_pymol.py" is executed from PyMOL's command line interface by entering "run LabelLib_pymol.py". Once, "LabelLib_pymol.py" is executed Accessible Volumes(AV) can be simulated from PyMOL's command line. The procedure of running "LabelLib_pymol.py" and simulating an AV is shown below for an example:

cmd.do('run ./LabelLib/FlexLabel/python/LabelLib_pymol.py')
cmd.fetch('1BNA', async=0)
genAV('1BNA', '/1BNA/B/B/19/C5', allowed_sphere_radius=1.5)

As a result you should see something like this:

dsDNA and an AV surface

More extended examples of genAV() usage can be found in LabelLib_pymol.py.

C++

C++ usage example can be found in testFlexLabel.cxx. Your own software could be compiled like this:

cd LabelLib/FlexLabel/test
g++ -std=c++14 -O3 -o FlexLabelTest testFlexLabel.cxx -lFlexLabel
./FlexLabelTest

Possible output:

AV calculation took: 20.783 ms

Python

The LabelLib can be used from python as shown below in a code example. LabelLib requires the Cartesian-coordinates, xyz, and van der Waals radii, vdW, of the biomolecule the label is attached to. The Cartesian coordinates and the vdW radii are passed to LabelLib as a single array (see example below). The array-oriented API uses an _arr suffix and validates input shapes for NumPy users:

  • atomsXyzr: (4, N) or (N, 4)
  • sourceXyz: (3,), (1, 3), or (3, 1)
  • xyzRQ: (5, N) or (N, 5)
import LabelLib as ll
import numpy as np

atoms_nx4 = np.zeros((11, 4), dtype=np.float32)  # [x, y, z, r] rows

linker_length = 20.0
linker_width = 2.0
dye_radius = 3.5
simulation_grid_spacing = 0.9
dye_attachment_point = np.zeros(3)
av1 = ll.dyeDensityAV1_arr(
    atoms_nx4,
    dye_attachment_point,
    linker_length,
    linker_width,
    dye_radius,
    simulation_grid_spacing,
)

# The object av1 has the property grid, which stores
# the dye densities within the reach of the dye linker as a positive number. 
# For points out of out reach of the linker, the the 
# grid contains negative numbers.
grid = av1.grid_arr()

# The shape of the grid is defined by the property '.shape'
shape = av1.shape_arr()

# The 3D grid is a flat 1D python list in 'Fortran' order
grid3d = np.array(grid).reshape(shape, order='F')

Another usage example is available in usage.py

Citation

If you have used LabelLib in a scientific publication, we would appreciate citations to the following paper: DOI for citing LabelLib

Dimura, M., Peulen, T.O., Hanke, C.A., Prakash, A., Gohlke, H. and Seidel, C.A., 2016. Quantitative FRET studies and integrative modeling unravel the structure and dynamics of biomolecular systems. Current opinion in structural biology, 40, pp.163-185.

Additional information is available in FPS toolkit paper: DOI for citing FPS

Kalinin, S., Peulen, T., Sindbert, S., Rothwell, P.J., Berger, S., Restle, T., Goody, R.S., Gohlke, H. and Seidel, C.A., 2012. A toolkit and benchmark study for FRET-restrained high-precision structural modeling. Nature methods, 9(12), pp.1218-1225.

Related software papers:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

labellib-1!1.0.0-cp312-cp312-win_amd64.whl (732.3 kB view details)

Uploaded CPython 3.12Windows x86-64

labellib-1!1.0.0-cp312-cp312-win32.whl (621.0 kB view details)

Uploaded CPython 3.12Windows x86

labellib-1!1.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (227.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

labellib-1!1.0.0-cp312-cp312-macosx_11_0_arm64.whl (174.4 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

labellib-1!1.0.0-cp311-cp311-win_amd64.whl (730.5 kB view details)

Uploaded CPython 3.11Windows x86-64

labellib-1!1.0.0-cp311-cp311-win32.whl (619.8 kB view details)

Uploaded CPython 3.11Windows x86

labellib-1!1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (226.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

labellib-1!1.0.0-cp311-cp311-macosx_11_0_arm64.whl (173.5 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

labellib-1!1.0.0-cp310-cp310-win_amd64.whl (730.1 kB view details)

Uploaded CPython 3.10Windows x86-64

labellib-1!1.0.0-cp310-cp310-win32.whl (618.7 kB view details)

Uploaded CPython 3.10Windows x86

labellib-1!1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (225.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

labellib-1!1.0.0-cp310-cp310-macosx_11_0_arm64.whl (172.4 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file labellib-1!1.0.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: labellib-1!1.0.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 732.3 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for labellib-1!1.0.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 b31029790e9e6175c51c1a70b344d12a42153b2cd76576e8328d8f3d6828da7c
MD5 eca753e981fbe278d40d5b38b06501d5
BLAKE2b-256 588115b8059131dba62d0aa6f3c6d7a5487b84774524b0cb39096c932bfcfae5

See more details on using hashes here.

File details

Details for the file labellib-1!1.0.0-cp312-cp312-win32.whl.

File metadata

  • Download URL: labellib-1!1.0.0-cp312-cp312-win32.whl
  • Upload date:
  • Size: 621.0 kB
  • Tags: CPython 3.12, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for labellib-1!1.0.0-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 dec49b0880356f29c499bf4cdd3f512b7986e9a8ccc65bde463aba4fd3da4f12
MD5 660a61b765f63edf65e306113d79ef9c
BLAKE2b-256 0f4dd8640477d91d9c1b36242557c7683e5cb1b68e5b72608a0745b3e86cd39f

See more details on using hashes here.

File details

Details for the file labellib-1!1.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for labellib-1!1.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 043d85fd70a5ec9765eea2aa5d539e90f3b4d83c664a3a1795bf305d0b49cea6
MD5 733e9dc1c13228813520e4c2a018fc8b
BLAKE2b-256 e35a57275ae395905511fc4fbabbcc302bc3a50838d4977d2024e64ad46c5e54

See more details on using hashes here.

File details

Details for the file labellib-1!1.0.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for labellib-1!1.0.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c98e8096cc3d189b4e35f5a72043161fb58c2191ee7aeadb7cf03e3d6cda9555
MD5 1992dd6d325dc64b5f45567ffafa37f9
BLAKE2b-256 ab2c0013521a014726f769e15a6533bad6b263777656cfdd96883f35c76fb89e

See more details on using hashes here.

File details

Details for the file labellib-1!1.0.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: labellib-1!1.0.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 730.5 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for labellib-1!1.0.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 335c5f9649cc334e20c2a933e9c112618dbaae503576f3392156c3308fa21d16
MD5 16607f3c9d92bc8e859f6d9d2e3fce6a
BLAKE2b-256 46274a7a5d5270e440b2090f77f3a5f8c0fb36be348c85674f8ee51f1cf7b817

See more details on using hashes here.

File details

Details for the file labellib-1!1.0.0-cp311-cp311-win32.whl.

File metadata

  • Download URL: labellib-1!1.0.0-cp311-cp311-win32.whl
  • Upload date:
  • Size: 619.8 kB
  • Tags: CPython 3.11, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for labellib-1!1.0.0-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 88facd96163b9e0c8be371fe12c19d3875472873d542810cb09145dad1fb2fce
MD5 20d883c41e988ae8f4255c2c023dc716
BLAKE2b-256 b9f2cde9f6606772738e936e2fa4149c7a6cd5b693b0a2083e2abd8046f09284

See more details on using hashes here.

File details

Details for the file labellib-1!1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for labellib-1!1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2a0ec8643ee25a6fa3747c9397103e06a2809ed7b5c9500938bc7c6de4458cc5
MD5 8a6e7fd18a2225e0c11b422c1b432a35
BLAKE2b-256 8272e30762a577e267f69565b2cfee7df86c6413012f85f1d6aae850d75ba403

See more details on using hashes here.

File details

Details for the file labellib-1!1.0.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for labellib-1!1.0.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4a8392e3086b84b4a1840bb9175d3ddb9275e41cfadb889985d59007a6ea545b
MD5 67fc893e2efdc88b561c0c8bac694709
BLAKE2b-256 c259c74016bb2a6abb39d74b23c4464bc6603c81e9991649e696d755c0df35e8

See more details on using hashes here.

File details

Details for the file labellib-1!1.0.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: labellib-1!1.0.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 730.1 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for labellib-1!1.0.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 d4c5a6623b87dad7ba804865b626f9fc85035da6adb109a9ea27a370d856f579
MD5 f40972df6816b399bb201227500e454a
BLAKE2b-256 27025e88df3edbc427bd599c5e3c6925e6de89d40a8994bbba8f070c9c9dde1b

See more details on using hashes here.

File details

Details for the file labellib-1!1.0.0-cp310-cp310-win32.whl.

File metadata

  • Download URL: labellib-1!1.0.0-cp310-cp310-win32.whl
  • Upload date:
  • Size: 618.7 kB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for labellib-1!1.0.0-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 a98d6356c09ad44d59f8af8d016c45b059db6cdd06b7874c7b1be82a791a0d05
MD5 f4c18065cbd6b53433304d642f8762d3
BLAKE2b-256 6c6ca4f2b7633f925f165a4350e1dbb5b8eea4804f32c81f086883873a35992e

See more details on using hashes here.

File details

Details for the file labellib-1!1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for labellib-1!1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9b7840f223c4a62f212d43e48a61138358b44768750aa292b7015b17bbda0ca4
MD5 1fc894982b07acf5197818e3278d2693
BLAKE2b-256 6d37d1ee21486c478ab65c545057184a7c0cb864f62053a9fa7d4808083852d2

See more details on using hashes here.

File details

Details for the file labellib-1!1.0.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for labellib-1!1.0.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0d6d0e14dd2d3ff88003f4ceab7302eef5042747bb6e0334e771d7a0a524fb76
MD5 cd816c03151615d233d574b9eea56e07
BLAKE2b-256 6bd2ed3647e9d2d01173dcab5cc690387b751d4c540990002120a76be5455511

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page