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

Compilers

  • gfortran
  • gcc

Python versions

Tested on: 3.10, 3.11, 3.12

Main functions:

  1. occluded_surface(pdb, method = "FIBOS"): 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")

# 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")
    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.1.1.tar.gz (91.7 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.1.1-cp312-cp312-win_amd64.whl (201.0 kB view details)

Uploaded CPython 3.12Windows x86-64

fibos-2.1.1-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.1.1-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl (1.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ i686

fibos-2.1.1-cp312-cp312-macosx_11_0_arm64.whl (832.0 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

fibos-2.1.1-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.1.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl (1.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ i686

fibos-2.1.1-cp311-cp311-macosx_11_0_arm64.whl (832.0 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

fibos-2.1.1-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.1.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (1.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ i686

fibos-2.1.1-cp310-cp310-macosx_11_0_arm64.whl (832.0 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

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

Uploaded CPython 3.9Windows x86-64

fibos-2.1.1-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.1.1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl (1.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ i686

fibos-2.1.1-cp39-cp39-macosx_11_0_arm64.whl (832.0 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for fibos-2.1.1.tar.gz
Algorithm Hash digest
SHA256 dbb4e126b6c35f0d3833494876dee3c088b409cfe5ccf64a59f0dae91dbedca5
MD5 8862722654e88243644d4c60db444619
BLAKE2b-256 a065af015152a92205ad8163ec2e8275c6d51d3b05b80a18807a7fd928fc096a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fibos-2.1.1-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.1.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 83d7c94579683142486ec1ed5968e7d07e156f644d14afcc49054e47eecb7a72
MD5 e4f2fad1e7b3e483da3e75ea1294a51a
BLAKE2b-256 cf5da555a30e6f651e3910b56f54610dfb2e6f30fb3f0edc69e150f7c32546a4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fibos-2.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 98e3af0bfc149ddb18384372c29d1af3c70c5a63d892be73dac7b10a08bc2c4a
MD5 b69ec4d98f31a20f1c51a64d72ecba76
BLAKE2b-256 a104e705c70635f03ff5d7c84fe484e0ac4f170fcd756806d2081be9daaea313

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fibos-2.1.1-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 44bb07c6f548c1d42179472f5c09c75479b8371911412cfe0976711e2bbc5e24
MD5 75ab740da191d920bf72926d3a66db5c
BLAKE2b-256 2e54374dff70110f09372515f0a20921b943946b4d08144e5ded8ebb699d3eec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fibos-2.1.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a1a0a4ff9551c0c56f1e6cf86b0dbbd60cf0647d69e60dc3f7fa1574926f8fdc
MD5 f5511d8b43e14634e65af2088043a00d
BLAKE2b-256 305b318363e3e1b1cfa06fd19b081ff1af37eaa460563940329a0027590e743d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fibos-2.1.1-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.1.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f824d604ff8e6fed48716777d72eec3afec862859952b803cc0d7dfdf2fcdf01
MD5 c6a15eadd9c32838e8c1ad3ef9f58efa
BLAKE2b-256 d5c68edb9145a999c9d98ba347848ba18f44ee183fd544c3efa35a8a77303298

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fibos-2.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 40a07187b40f1d711e41fab7656e3c69b692720c50f6aa7adc5fc6a6cf6ab326
MD5 bfe86f0e2451419b7c93497a4981fd2d
BLAKE2b-256 2fa65d7b6c8f721c492b69034ee9266cd3d6c0e0e19fd453f3ac93dd5b79f0e0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fibos-2.1.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 55aa13139448355e601644162c387dc067b800d2c81a31f5a701cb46f12bf042
MD5 d134a2136f6f55d29e146e77eb29c8e8
BLAKE2b-256 a446c30007a089ca027e9fd54fcaa5fa3d015d52912e3f6c34443590d66beb5c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fibos-2.1.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5eaf1765a75a818e72448f1dee575cabcfdaafc5106465a5907f099742be2dad
MD5 e363c2a379b86f223e979be79fda1746
BLAKE2b-256 216827521dd8a1aee762b208fcc6b619152c05d878f08bb1a94224a4e450dd1c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fibos-2.1.1-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.1.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 47c167d0031a0c217686cf6feb715e101f3a43509b2f677e0f17862dae9b8964
MD5 4e6e491038650d12f1cda8cc4fe5dd38
BLAKE2b-256 19025228e800b88b0f8bb34f7f538009eb5c9f36c701f4edb476fdb0cb492612

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fibos-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 53ac5581bb099ace6c7e31ca88ac19685e30ca4830c36608150f3ecdb1b11c16
MD5 d7907b22b675193b4810aa1730b5a123
BLAKE2b-256 daa4bbd08d5f21a58e36eae29540e73deec1898c3355ed9b4483c67ad5d17e8f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fibos-2.1.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 30d05a5838248b78f85269226d3b75cb13e4e54ba4f5c57d3aceb65a401a5d0d
MD5 3824cbd9ab02f3752dfc7783452d8048
BLAKE2b-256 4b3c7e74bdebb34bc8e777d4aa669d8b3e0e227d28e68b470552eca3f3168013

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fibos-2.1.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9c499a34cd60019dde22ab120d1da6a0e81b271648f40f4513eaff03f65fbef7
MD5 15e60900166283751ed65ff82952e6ae
BLAKE2b-256 a4a9f6b793369768dc6d0dc7e881bdf2a46fe364af408e55460eee68302270b4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fibos-2.1.1-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.1.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 41ae6cb79e87ca66cbc011125d199372f2f7af32a084d02ea04812b9c6d735ce
MD5 78d71be47167a8eb41b4d61cf9e36509
BLAKE2b-256 e025fb9f854ba8755579b87fc2142adb62d4620164fdaf31f8d107d7db41a824

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fibos-2.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f2e3f6e9aaf651de630b8cec4e7af02f93b0db00b82f4829ca9aae83814f02b0
MD5 161a692a7687ace2891f07d6fc491706
BLAKE2b-256 11876d2a5476280afff0c657a83878ebca25fc6dc84a0abbd5f2475d6f4c13a7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fibos-2.1.1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 223d2908088630032f8eed9cfe567a67cc52fb4c1688b53b054b6d7f8c9eeee4
MD5 4c0a228c75f8f96b4fcd8e16cd995373
BLAKE2b-256 66ad68dca14caf8cbf9eb5ebca3232689b782b64b7c1cc4db85650320e48e35b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fibos-2.1.1-cp39-cp39-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 832.0 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.1.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c58c26055eb0ddb96f32a81a6b88a02d338dd63f38c63575ce01cf76ebd3dc40
MD5 0ff1098c8ff7308128f931aa8ce19f26
BLAKE2b-256 df3473ac94ca1d1d0f847ea307687594e65650fe1950258b0ec4429e95977b41

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