Skip to main content

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:

Metadata

Release files for labellib 1!1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for labellib 1!1.0.0
File
labellib-1!1.0.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
labellib-1!1.0.0-cp312-cp312-win32.whl CPython 3.12 CPython 3.12 Windows x86-32 Details
labellib-1!1.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
labellib-1!1.0.0-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
labellib-1!1.0.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
labellib-1!1.0.0-cp311-cp311-win32.whl CPython 3.11 CPython 3.11 Windows x86-32 Details
labellib-1!1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
labellib-1!1.0.0-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
labellib-1!1.0.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
labellib-1!1.0.0-cp310-cp310-win32.whl CPython 3.10 CPython 3.10 Windows x86-32 Details
labellib-1!1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
labellib-1!1.0.0-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details

Total release size: 5.3 MB

Release files / labellib-1!1.0.0-cp312-cp312-win_amd64.whl

Download URL labellib-1!1.0.0-cp312-cp312-win_amd64.whl
Size 732.3 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
b31029790e9e6175c51c1a70b344d12a42153b2cd76576e8328d8f3d6828da7c
BLAKE2b-256 checksum
How to use checksums
588115b8059131dba62d0aa6f3c6d7a5487b84774524b0cb39096c932bfcfae5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / labellib-1!1.0.0-cp312-cp312-win32.whl

Download URL labellib-1!1.0.0-cp312-cp312-win32.whl
Size 621.0 kB
Tags CPython 3.12 Windows x86-32
SHA-256 checksum
How to use checksums
dec49b0880356f29c499bf4cdd3f512b7986e9a8ccc65bde463aba4fd3da4f12
BLAKE2b-256 checksum
How to use checksums
0f4dd8640477d91d9c1b36242557c7683e5cb1b68e5b72608a0745b3e86cd39f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / labellib-1!1.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL labellib-1!1.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 227.0 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
043d85fd70a5ec9765eea2aa5d539e90f3b4d83c664a3a1795bf305d0b49cea6
BLAKE2b-256 checksum
How to use checksums
e35a57275ae395905511fc4fbabbcc302bc3a50838d4977d2024e64ad46c5e54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / labellib-1!1.0.0-cp312-cp312-macosx_11_0_arm64.whl

Download URL labellib-1!1.0.0-cp312-cp312-macosx_11_0_arm64.whl
Size 174.4 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c98e8096cc3d189b4e35f5a72043161fb58c2191ee7aeadb7cf03e3d6cda9555
BLAKE2b-256 checksum
How to use checksums
ab2c0013521a014726f769e15a6533bad6b263777656cfdd96883f35c76fb89e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / labellib-1!1.0.0-cp311-cp311-win_amd64.whl

Download URL labellib-1!1.0.0-cp311-cp311-win_amd64.whl
Size 730.5 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
335c5f9649cc334e20c2a933e9c112618dbaae503576f3392156c3308fa21d16
BLAKE2b-256 checksum
How to use checksums
46274a7a5d5270e440b2090f77f3a5f8c0fb36be348c85674f8ee51f1cf7b817
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / labellib-1!1.0.0-cp311-cp311-win32.whl

Download URL labellib-1!1.0.0-cp311-cp311-win32.whl
Size 619.8 kB
Tags CPython 3.11 Windows x86-32
SHA-256 checksum
How to use checksums
88facd96163b9e0c8be371fe12c19d3875472873d542810cb09145dad1fb2fce
BLAKE2b-256 checksum
How to use checksums
b9f2cde9f6606772738e936e2fa4149c7a6cd5b693b0a2083e2abd8046f09284
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / labellib-1!1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL labellib-1!1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 226.5 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
2a0ec8643ee25a6fa3747c9397103e06a2809ed7b5c9500938bc7c6de4458cc5
BLAKE2b-256 checksum
How to use checksums
8272e30762a577e267f69565b2cfee7df86c6413012f85f1d6aae850d75ba403
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / labellib-1!1.0.0-cp311-cp311-macosx_11_0_arm64.whl

Download URL labellib-1!1.0.0-cp311-cp311-macosx_11_0_arm64.whl
Size 173.5 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4a8392e3086b84b4a1840bb9175d3ddb9275e41cfadb889985d59007a6ea545b
BLAKE2b-256 checksum
How to use checksums
c259c74016bb2a6abb39d74b23c4464bc6603c81e9991649e696d755c0df35e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / labellib-1!1.0.0-cp310-cp310-win_amd64.whl

Download URL labellib-1!1.0.0-cp310-cp310-win_amd64.whl
Size 730.1 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
d4c5a6623b87dad7ba804865b626f9fc85035da6adb109a9ea27a370d856f579
BLAKE2b-256 checksum
How to use checksums
27025e88df3edbc427bd599c5e3c6925e6de89d40a8994bbba8f070c9c9dde1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / labellib-1!1.0.0-cp310-cp310-win32.whl

Download URL labellib-1!1.0.0-cp310-cp310-win32.whl
Size 618.7 kB
Tags CPython 3.10 Windows x86-32
SHA-256 checksum
How to use checksums
a98d6356c09ad44d59f8af8d016c45b059db6cdd06b7874c7b1be82a791a0d05
BLAKE2b-256 checksum
How to use checksums
6c6ca4f2b7633f925f165a4350e1dbb5b8eea4804f32c81f086883873a35992e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / labellib-1!1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL labellib-1!1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 225.4 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
9b7840f223c4a62f212d43e48a61138358b44768750aa292b7015b17bbda0ca4
BLAKE2b-256 checksum
How to use checksums
6d37d1ee21486c478ab65c545057184a7c0cb864f62053a9fa7d4808083852d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / labellib-1!1.0.0-cp310-cp310-macosx_11_0_arm64.whl

Download URL labellib-1!1.0.0-cp310-cp310-macosx_11_0_arm64.whl
Size 172.4 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0d6d0e14dd2d3ff88003f4ceab7302eef5042747bb6e0334e771d7a0a524fb76
BLAKE2b-256 checksum
How to use checksums
6bd2ed3647e9d2d01173dcab5cc690387b751d4c540990002120a76be5455511
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page