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

Requiremnt to Install on Windows

  • 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.3.1.tar.gz (90.9 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.3.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.3.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.3.1-cp312-cp312-macosx_11_0_arm64.whl (832.2 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

fibos-2.3.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.3.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.3.1-cp311-cp311-macosx_11_0_arm64.whl (832.2 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

fibos-2.3.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.3.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.3.1-cp310-cp310-macosx_11_0_arm64.whl (832.2 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

fibos-2.3.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.3.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.3.1-cp39-cp39-macosx_11_0_arm64.whl (832.2 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for fibos-2.3.1.tar.gz
Algorithm Hash digest
SHA256 8329038cf7a54cf5e41b02f948b040b67f6af8a64592bf44f2dce1e5e7c0d749
MD5 60414e4549981ea16ee04e2d389af75e
BLAKE2b-256 230d6a679bf04dc39afecb8681986033517ccd668abc0f1880b11a0b0805811d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fibos-2.3.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 42aa81a5343bb6e3859e86642f7571337f70250592dca6db17c4d3118a51ab14
MD5 534b0f6a954dfe90290844d8c636b20d
BLAKE2b-256 a54a093da2cbfead6d5c10d7242333529706cb8bb5a63b37450d2a2e773b5395

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fibos-2.3.1-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 186fda4b897911cf5db976645522ee4ad39534bfeb52cc20abe6ba248878fd77
MD5 2eec7e675bcededdcca5677df076cd76
BLAKE2b-256 2954d5786a21d13f1f5e0250ae63e2312aa8bd1e4aeb70c19187cb9f987968f2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fibos-2.3.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4d83809e8631a78edad58a3dd7f3de78f9e8ee419a92e0b9950b42d978fba458
MD5 ab1bc936d5d8c75fc7bd20234cc05967
BLAKE2b-256 7fe2745bc5f0d24593fe2a14e5403f506934ec857ce30731203eeb794b3bed0a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fibos-2.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 681212851692b37c92c6dbce32d2294d101527f860437eb8c5b3455573fd5560
MD5 2f77c7cdbe55450c0a807887d36fbe14
BLAKE2b-256 d6b182e0fcb95ec717e7ec8cc3734d05fee9ac4555a385a3dfe057c281d09f20

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fibos-2.3.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 7bfdf045ea42820229276c05f104bb2c281648f6ee72eb58faccb044ab309f0c
MD5 0adf38ce54995067f4700b28ed219c12
BLAKE2b-256 53196c67f9dcc18ea18e1d2af1f3b34170576957bb5f32d7c72cd9079c7031cf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fibos-2.3.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c8c588134c4593a78f08e3294cf4bb3ddff435f087527f865260de998d2b3a21
MD5 5f83cd3171344c776c95a8bbe6e5c879
BLAKE2b-256 ebe4b1bf6446e33e9ea366ead4616d204f30f670074bb9d63c4ae0ccbcddfc81

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fibos-2.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1dd31efbb7354f38eb92a405265e81cf904bb9ca28c2410d906fd0677e099f88
MD5 4608127729a124fab611aac1a71d0c4c
BLAKE2b-256 791be95adcb958a783e590cd1b0aa6e34b9872a6fd8d5643f3cbd333f8b428f8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fibos-2.3.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 fbf41a5f2a2e02cd66e0ed4b9ca4d96b850a1cdc1af16fab7571abe08e4258db
MD5 9a77f1b5a2369d1e8bf28233933ed419
BLAKE2b-256 58fdded334999f212e165128c4f26da92b238c89466afabcba0458e4e62cf027

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fibos-2.3.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6c28016b191fde245cf080944df6326c12664b8881193952412549bcfc821dc7
MD5 5635e2efa53a0271273bc38f122837c2
BLAKE2b-256 3f30688546d6f986602cbaa03a51a8cf57accaedd1893687a6d59a3ecd243cb4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fibos-2.3.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2b437cae0819d490609995424b69e8dca265c4f483445738bbbfdca2da576c9e
MD5 432b6e71dd8141666e89cf99562dbf07
BLAKE2b-256 8b3ad899efa4a07723a900b0da518dbdaa056161541707f0dd3309696fafc3a2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fibos-2.3.1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 8523658bfa670c375faea937efb23bc5f6b9abe466c2ddde4b38ce30a6c541ca
MD5 f82ede676e14e376c9ca47eaa0e01797
BLAKE2b-256 ac362470308d53d0ff4973deb41438317b8c99f07df3c606b620c1de195dcfae

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fibos-2.3.1-cp39-cp39-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 832.2 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.3.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 90311d0e289b1b32c7b1247feae5bca119db3528535793b833ab368395dc74cd
MD5 a124b0914daab4aa6562381340de87e4
BLAKE2b-256 b148c19ee1532f8eb534ad5dc8a71f77ee38c30a8c798e388a4513aebb741d1e

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