Skip to main content

Package to calculate Occluded Surfaces

Project description


editor_options: markdown: wrap: sentence

FIBOS

The Occluded Surface (OS) algorithm is a widely used approach for analyzing atomic packing in biomolecules. Here, we introduce fibos, an R and Python package that extends the OS methodology with enhancements. It integrates efficient Fortran code from the original OS implementation and introduces an innovation: the use of Fibonacci spirals for surface point distribution. This modification reduces anisotropy and ensures a more uniform and even distribution of surface dots, improving the accuracy of the algorithm.

R fibos version is available to install by CRAN.

Operating Systems

FIBOS was designed to be multiplatform and run on Linux, Windows and Mac.
Tested on:

  • Linux: Ubuntu ($\geq$ 20.04)
  • Windows: Windows 11
  • Mac: MacOS 15.0.1

Python versions

Tested on: 3.10, 3.11, 3.12

Compilers to different Python Versions

  • gfortran
  • gcc

Main functions:

  1. occluded_surface(pdb, method = "FIBOS", density_dots = 5.0): Implements the Occluded Surface algorithm, generating points, areas, and normals for each atom. As parameters it accepts a PDB id (or the path to a local PDB file) and a method selection — either the classic 'OS' or the default 'FIBOS'. The function returns the results as a table and creates a file named prot_PDBid.srf in the fibos_file directory.

  2. osp(file): Implements the Occluded Surface Packing (OSP) metric for each residue. Accepts a path to an .srf file generated by occluded_surface as a parameter and returns the results as a table summarized by residue.

  3. get_radii(): Returns the Van der Waals radii values employed in the surface occlusion calculations. These are the values used in each computation.

  4. set_radii(radii_values): Enables customization of the radii values used in surface occlusion calculations. To specify new values, the function accepts a DataFrame as its parameter.

  5. reset_radii(): Reverts all modifications made to the radii values, resetting them to their default settings.

Quickstart:

import fibos
import os

# Calculate FIBOS per atom and create .srf files in fibos_files folder
pdb_fibos = fibos.occluded_surface("1fib", method="FIBOS", density_dots = 5.0)

# Show first 3 rows of pdb_fibos table
print(pdb_fibos.head(3))

#                     ATOM NUMBER_POINTS   AREA RAYLENGTH DISTANCE
# 0  GLN 1@N___>HIS 3@NE2_             6  1.287     0.791     5.49
# 1  GLN 1@N___>HIS 3@CE1_             1  0.200     0.894     6.06
# 2  GLN 1@N___>HIS 3@CG__             1  0.160     0.991     6.27

# Calculate OSP metric per residue from .srf file in fibos_files folder
pdb_osp = fibos.osp(os.path.join("fibos_files","prot_1fib.srf"))

# Show first 3 rows of pdb_osp table
print(pdb_osp.head(3))

#    Resnum Resname     OS  os*[1-raylen]    OSP
# 0       1     GLN  36.81          21.94  0.157
# 1       2     ILE  49.33          36.13  0.317
# 2       3     HIS  64.14          43.17  0.335

A more complex example:

import fibos
import os
from Bio.PDB import PDBList
from concurrent.futures import ProcessPoolExecutor
from functools import partial

# Auxiliary function to calculate occluded surface
def occluded_surface_worker(pdb_path, method):
    return fibos.occluded_surface(pdb_path, method=method)

# Get PDB file from RCSB and put it into the PDB folder  
# Rename the file appropriately and return path to it 
# (i.e., PDB/prot_8rxn.ent -> PDB/8rxn.pdb)
def get_pdb(id, path="."):
    pdbl = PDBList()
    new_path = os.path.join(path, f"{id.lower()}.pdb")
    if not os.path.exists(new_path):
        original_path = pdbl.retrieve_pdb_file(id.lower(), pdir=path, file_format='pdb')
        os.rename(original_path, new_path)
    return new_path

if __name__ == "__main__":

    # source of PDB files
    pdb_folder = "PDB"

    # fibos folder output
    fibos_folder = "fibos_files"

    # Create PDB folder if it does not exist
    os.makedirs(pdb_folder, exist_ok=True)
    
    # PDB ids list
    pdb_ids = ["8RXN", "1ROP"]

    # Get PDB files from RCSB and put them into the PDB folder  
    pdb_paths = list(map(lambda pdb_id: get_pdb(pdb_id, path=pdb_folder), pdb_ids))
    print(pdb_paths)
    
    # Detect number of physical cores and update cores according to pdb_ids size
    ideal_cores = min(os.cpu_count(), len(pdb_ids))

    # Calculate in parallel FIBOS per PDBid 
    # Create .srf files in fibos_files folder
    # Return FIBOS tables in pdb_fibos list
    worker_with_params = partial(occluded_surface_worker, method="FIBOS", density_dots = 5.0)
    with ProcessPoolExecutor(max_workers=ideal_cores) as executor:
        pdb_fibos = list(executor.map(worker_with_params, pdb_paths))

    # Show first 3 rows of first pdb_fibos table
    print(pdb_fibos[0].head(3))
    
    # Prepare paths for the generated .srf files in folder fibos_files
    srf_paths = list(map(lambda pdb_id: os.path.join(fibos_folder, f"prot_{pdb_id.lower()}.srf"), pdb_ids))
    print(srf_paths)
    
    # Calculate OSP metric by residue
    # Return OSP tables in pdb_osp list
    pdb_osp = list(map(lambda srf_path: fibos.osp(srf_path), srf_paths))
    
    # Show first 3 rows of the first pdb_osp table
    print(pdb_osp[0].head(3))
    
# OBS: If you need to run this example in a Jupyter Notebook, move the 
# occluded_surface_worker function to a "fun.py" file and import it as 
# "from fun import occluded_surface_worker"

Case Study:

Here we show a case study (currently only in R), aiming to compare the packing density between experimentally determined structures and the same structures predicted by AlphaFold (AF).

Authors

References

Fleming PJ, Richards FM. Protein packing: Dependence on protein size, secondary structure and amino acid composition. J Mol Biol 2000;299:487–98.

Pattabiraman N, Ward KB, Fleming PJ. Occluded molecular surface: Analysis of protein packing. J Mol Recognit 1995;8:334–44.

Project details


Download files

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

Source Distribution

fibos-2.2.2.tar.gz (90.8 kB view details)

Uploaded Source

Built Distributions

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

fibos-2.2.2-cp312-cp312-win_amd64.whl (201.0 kB view details)

Uploaded CPython 3.12Windows x86-64

fibos-2.2.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

fibos-2.2.2-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl (1.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ i686

fibos-2.2.2-cp312-cp312-macosx_11_0_arm64.whl (832.1 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

fibos-2.2.2-cp311-cp311-win_amd64.whl (201.0 kB view details)

Uploaded CPython 3.11Windows x86-64

fibos-2.2.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

fibos-2.2.2-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl (1.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ i686

fibos-2.2.2-cp311-cp311-macosx_11_0_arm64.whl (832.1 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

fibos-2.2.2-cp310-cp310-win_amd64.whl (201.0 kB view details)

Uploaded CPython 3.10Windows x86-64

fibos-2.2.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

fibos-2.2.2-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (1.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ i686

fibos-2.2.2-cp310-cp310-macosx_11_0_arm64.whl (832.1 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

fibos-2.2.2-cp39-cp39-win_amd64.whl (201.0 kB view details)

Uploaded CPython 3.9Windows x86-64

fibos-2.2.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

fibos-2.2.2-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl (1.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ i686

fibos-2.2.2-cp39-cp39-macosx_11_0_arm64.whl (832.1 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

Details for the file fibos-2.2.2.tar.gz.

File metadata

  • Download URL: fibos-2.2.2.tar.gz
  • Upload date:
  • Size: 90.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for fibos-2.2.2.tar.gz
Algorithm Hash digest
SHA256 828fbb6080e0102df329c36b2977a2010e73ec3cfa28ab6d6821a7a056efbeae
MD5 5230ae36ac1aad42f2871dd7afaa2910
BLAKE2b-256 e9de1abbee9d99367f5907c496498354450707f074e5e5fff0d2dfe8c5ee91f2

See more details on using hashes here.

File details

Details for the file fibos-2.2.2-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: fibos-2.2.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 201.0 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for fibos-2.2.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 db6d0e30598e4e58fca9dedf876768ee6e808823a0d29018518ee995fcf122bf
MD5 ee449b700cd0b907d82a640b7bef8dc9
BLAKE2b-256 83fe8f969c46ad88e9bf3767d42472cc7f9ded257f1e6b1803b99c61cf87d8d5

See more details on using hashes here.

File details

Details for the file fibos-2.2.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fibos-2.2.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e3871289bf971d4dddfbe88ff627ad08251a350ffc49bec18586b8593a085a9e
MD5 7dcfbf93c95e3d3e42f4835ed9e2f78b
BLAKE2b-256 24d06f81788369c99329fa72a90fd8ed3f12642a6335a0807928c817ee34f877

See more details on using hashes here.

File details

Details for the file fibos-2.2.2-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for fibos-2.2.2-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 87a403b43a4bd9426b643ee651d74fb3db145416b0270ee562d87af385660fb5
MD5 ef74d64080e84a49545c3a09390109c8
BLAKE2b-256 f04fd3ef07defd18895b1012c38ace6a3256763480995da4d73bff9625f5e37d

See more details on using hashes here.

File details

Details for the file fibos-2.2.2-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fibos-2.2.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 35485ee309a731564894964fb74bca758beb11c0c861d80b4551721ff74c4493
MD5 2ff2fc4698d32a0de77372a7d1754681
BLAKE2b-256 bf40dafb4b9a0b8715498b135977667f175a87ad952538d85b686f4713ef25c3

See more details on using hashes here.

File details

Details for the file fibos-2.2.2-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: fibos-2.2.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 201.0 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for fibos-2.2.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 60afa4063edc00903ff442c3ebe38cfa6f2654e06a4d13353cc1734ca259b97c
MD5 04d468caac43e4c2b61c122e08728900
BLAKE2b-256 f2e5f0cc4a85c8bf2c8220f93cf6c0c37cae7d8b631631f38e2fca3f95fcc741

See more details on using hashes here.

File details

Details for the file fibos-2.2.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fibos-2.2.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 799123dcc385e88e483df099050ad929917df6383035d5069d384472c8df12ba
MD5 670156aa615160546c9489407ea6d2bc
BLAKE2b-256 8505c437ec4a6bbcbe5a1aae67fa6e64665c21ed7dc45dc25718c3ccd4669a74

See more details on using hashes here.

File details

Details for the file fibos-2.2.2-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for fibos-2.2.2-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 628ba6c7f3b2227521dc92d51ae311aab14cb1af529e520096b574417493c850
MD5 a0db25b4ac1640abf9b87fcb37cea5c2
BLAKE2b-256 654b653b508b95d2e0248e73e0c1953c0fa8da749ceabdfe327c3b85290833e4

See more details on using hashes here.

File details

Details for the file fibos-2.2.2-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fibos-2.2.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 101137238b8be566ac9ab81b2563f04b2561f463a8b75df20b1ddb5a6090d161
MD5 edb4d628f92e2af0ce1de64b7a1a53e7
BLAKE2b-256 00b54ae719010486f7d961f20408c1f688bde72fb82886958e801af9a546d439

See more details on using hashes here.

File details

Details for the file fibos-2.2.2-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: fibos-2.2.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 201.0 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for fibos-2.2.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 e3e83ac70d7c79edc551acd690492e90d157ef82456fefb46a02f0ac8885f39d
MD5 5bbeea672f6652f8a47af094aaad5120
BLAKE2b-256 e86ee9c08b1d5b4270fc1198b075b7a740fee6a83ea4dc5089bbcf58ed25d2d0

See more details on using hashes here.

File details

Details for the file fibos-2.2.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fibos-2.2.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 90ff09e0f0030368287084745e9f4fb9673ffd062e93d9030368759d5b2c7c3d
MD5 b15843e286c8628084164a800ad0e68b
BLAKE2b-256 e93ab7aeb8938d3b6c0b7882f62429d969ebff8243bae75a364a27061c470d8a

See more details on using hashes here.

File details

Details for the file fibos-2.2.2-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for fibos-2.2.2-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 9ab7663646b187e12f5501c0f9a10aa43ddfbdea92ca3c736c3e33247aa0e82e
MD5 d0d71cc13651cc1b3e230bed205f8638
BLAKE2b-256 8042b7a6d8996dd5390556817697b3ee85df1eed76ee251437f77865f347750a

See more details on using hashes here.

File details

Details for the file fibos-2.2.2-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fibos-2.2.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2237334fe5c3a80dd5216bdad3bd12982f0d661d03ac056f974f70d7ec200cb9
MD5 a9c9c8473dd03836a570d79fa8b509b9
BLAKE2b-256 d670936cacf7e97b775553764083bb54e706f295eea0cbe27619970c51dc5fd0

See more details on using hashes here.

File details

Details for the file fibos-2.2.2-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: fibos-2.2.2-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 201.0 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for fibos-2.2.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 c532a4777412941715a4c3a041b1f12edb2e36253f84e6857fc59e4b220c32ba
MD5 9b7b6b1b09843a99b24ad2bb8bf068e8
BLAKE2b-256 9cabf802baf0bd66c6b7ae9b9ee82f14d5b71edb42e2aa81eb44a8d00e90b9d7

See more details on using hashes here.

File details

Details for the file fibos-2.2.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fibos-2.2.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 16d264a2a76e1906b28b87a951b68120ffc79b8c1e0de41fc72a85fa6be58466
MD5 033d71d93845dcbb39a5002776c7b32d
BLAKE2b-256 22680ad011020a663603086280d678a8287d8c31468ecb210ac9010a330d9f67

See more details on using hashes here.

File details

Details for the file fibos-2.2.2-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for fibos-2.2.2-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 7daa91efe78fa9f9030a2fc7a9cecaac2913e64ffcf7a9592c7b18499557c5e3
MD5 e4bf6c921a5e0532772c7eee05ebb4c1
BLAKE2b-256 fdd7d6fb46a1e16f1d9188570c2ff11c9c1122bbdc9ca53c298d63f9ee5b8d7e

See more details on using hashes here.

File details

Details for the file fibos-2.2.2-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

  • Download URL: fibos-2.2.2-cp39-cp39-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 832.1 kB
  • Tags: CPython 3.9, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for fibos-2.2.2-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 03cae69dd88f4ee90636c4a19fc4c0214cfe2643440be91c43a86dfc5c1373fc
MD5 06e9b6f7ed56770a14840c42f48da3bb
BLAKE2b-256 002f5190ad79db6062fc77508ea0973c2a294e07991845418f8f7dd5a1ea057c

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