Skip to main content

Python package to insert a ligand in a 3D grid, created based on its respective receptor, considering each atom type as an integer

Project description

PyPI version shields.io PyPI pyversions PyPI license

Python package to insert a molecule in a 3D grid, considering each atom type as an integer.

See also:

Requirements

  • Python 3.7+

  • NumPy 1.19.5+

  • toml 0.10.2+

Installation

To install the latest release on PyPI, run:

pip install mol2grid

To install the latest developmental version, run:

git clone https://github.com/LBC-LNBio/mol2grid.git
pip install mol2grid

Usage

First, save the ligand and receptor structures to PDB-formatted files.

>>> ligand = 'path/to/ligand.pdb' # path to a target ligand
>>> receptor = 'path/to/receptor.pdb' # path to a target receptor

The lig2grid function takes a ligand and a receptor PDB-formatted files and inserts this ligand to a 3D grid created based on the receptor, a padding and a grid spacing (step).

>>> from mol2grid import lig2grid
>>> lig = lig2grid(ligand, receptor, padding=4.0, step=0.6, file=None, vdw=None, catalog=None, ignore_h=True)

The rec2grid function takes a receptor PDB-formatted file and inserts this receptor to a 3D grid created based on the receptor, a padding and a grid spacing (step).

>>> from mol2grid import rec2grid
>>> rec = rec2grid(receptor, padding=4.0, step=0.6, file=None, vdw=None, catalog=None, ignore_h=True)

The pair2grid function takes a ligand and a receptor PDB-formatted files and inserts this ligand and receptor to 3D grids created based on the receptor, a padding and a grid spacing (step).

>>> from mol2grid import pair2grid
>>> lig, rec = pair2grid(ligand, receptor, padding=4.0, step=0.6, file=None, vdw=None, catalog=None, ignore_h=True)

API

mol2grid.lig2grid

Inserts a target receptor to a 3D grid, created based on the receptor, a padding and a grid spacing (step).

mol2grid.lig2grid(ligand: str, receptor: str, padding: float, step: float = 0.6, file: Optional[str] = None, vdw: Optional[str] = None, catalog: Optional[str] = None, ignore_h: bool = True, nthreads: int = os.cpu_count() - 1, verbose: bool = False)  numpy.ndarray
Args:
  • ligand (str) – A path to a PDB-formatted file of a target ligand

  • receptor (str) – A path to a PDB-formatted file of a target receptor

  • padding (float) – A length to be added in each direction of the 3D grid

  • step (float, optional) – Grid spacing (A), by default 0.6

  • file (str, optional) – A path to a PDB-formatted file to write the grid points where atoms lay on and the barcodes are mapped on the B-values, by default None

  • vdw (str, optional) – A path to a custom van der Waals radii file, by default None

  • catalog (str, optional) – A path to a custom catalog file, by default None

  • ignore_h (bool, optional) – Whether to ignore hydrogen atoms, by default True

  • nthreads (int, optional) – Number of threads, by default {os.cpu_count()-1}

  • verbose (bool, optional) – Whether to print extra information to standard output, by default False

Returns:

A numpy.ndarray with grid points corresponding to the atom barcodes of the receptor

Return type:

numpy.ndarray

Note:

Greater barcodes have priority in the 3D grid when atoms overlap

mol2grid.rec2grid

Inserts a target receptor to a 3D grid, created based on the receptor, a padding and a grid spacing (step).

mol2grid.rec2grid(receptor: str, padding: float, step: float = 0.6, file: Optional[str] = None, vdw: Optional[str] = None, catalog: Optional[str] = None, ignore_h: bool = True, nthreads: int = os.cpu_count() - 1, verbose: bool = False)  numpy.ndarray
Args:
  • receptor (str) – A path to a PDB-formatted file of a target receptor

  • padding (float) – A length to be added in each direction of the 3D grid

  • step (float, optional) – Grid spacing (A), by default 0.6

  • file (str, optional) – A path to a PDB-formatted file to write the grid points where atoms lay on and the barcodes are mapped on the B-values, by default None

  • vdw (str, optional) – A path to a custom van der Waals radii file, by default None

  • catalog (str, optional) – A path to a custom catalog file, by default None

  • ignore_h (bool, optional) – Whether to ignore hydrogen atoms, by default True

  • nthreads (int, optional) – Number of threads, by default {os.cpu_count()-1}

  • verbose (bool, optional) – Whether to print extra information to standard output, by default False

Returns:

A numpy.ndarray with grid points corresponding to the atom barcodes of the ligand

Return type:

numpy.ndarray

Note:

Greater barcodes have priority in the 3D grid when atoms overlap

mol2grid.pair2grid

Inserts a target receptor to a 3D grid, created based on the receptor, a padding and a grid spacing (step).

mol2grid.pair2grid(ligand: str, receptor: str, padding: float, step: float = 0.6, ligfile: Optional[str] = None, recfile: Optional[str] = None, vdw: Optional[str] = None, catalog: Optional[str] = None, ignore_h: bool = True, nthreads: int = os.cpu_count() - 1, verbose: bool = False)  Tuple[numpy.ndarray,numpy.ndarray]
Args:
  • ligand (str) – A path to a PDB-formatted file of a target ligand

  • receptor (str) – A path to a PDB-formatted file of a target receptor

  • padding (float) – A length to be added in each direction of the 3D grid

  • step (float, optional) – Grid spacing (A), by default 0.6

  • ligfile (str, optional) – A path to a PDB-formatted file to write the grid points where atoms of the ligand lay on and the barcodes are mapped on the B-values, by default None

  • recfile (str, optional) – A path to a PDB-formatted file to write the grid points where atoms of the receptor lay on and the barcodes are mapped on the B-values, by default None

  • vdw (str, optional) – A path to a custom van der Waals radii file, by default None

  • catalog (str, optional) – A path to a custom catalog file, by default None

  • ignore_h (bool, optional) – Whether to ignore hydrogen atoms, by default True

  • nthreads (int, optional) – Number of threads, by default {os.cpu_count()-1}

  • verbose (bool, optional) – Whether to print extra information to standard output, by default False

Returns:

A tuple with numpy.ndarrays with grid points corresponding to the atom barcodes of the ligand and the receptor

Return type:

numpy.ndarray

Note:

Greater barcodes have priority in the 3D grid when atoms overlap

License

The software is licensed under the terms of the GNU General Public License version 3 (GPL3) and is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

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

mol2grid-0.1.4-cp39-cp39-win_amd64.whl (44.1 kB view details)

Uploaded CPython 3.9Windows x86-64

mol2grid-0.1.4-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (149.4 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.12+ x86-64

mol2grid-0.1.4-cp39-cp39-macosx_10_14_x86_64.whl (43.1 kB view details)

Uploaded CPython 3.9macOS 10.14+ x86-64

mol2grid-0.1.4-cp38-cp38-win_amd64.whl (44.1 kB view details)

Uploaded CPython 3.8Windows x86-64

mol2grid-0.1.4-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (149.5 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.12+ x86-64

mol2grid-0.1.4-cp38-cp38-macosx_10_14_x86_64.whl (43.6 kB view details)

Uploaded CPython 3.8macOS 10.14+ x86-64

mol2grid-0.1.4-cp37-cp37m-win_amd64.whl (44.0 kB view details)

Uploaded CPython 3.7mWindows x86-64

mol2grid-0.1.4-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (148.8 kB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.12+ x86-64

mol2grid-0.1.4-cp37-cp37m-macosx_10_14_x86_64.whl (43.5 kB view details)

Uploaded CPython 3.7mmacOS 10.14+ x86-64

File details

Details for the file mol2grid-0.1.4-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: mol2grid-0.1.4-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 44.1 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for mol2grid-0.1.4-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 c0214cc0b1b650a38d8dc7b1a605d61d63d1e5e2cbf02793d4c02930ad6f3be6
MD5 9f0895594b2c71ec244ea9c2adb12321
BLAKE2b-256 f75d76af87457d285849c4c7e9d6f1441c96a308fa20cc2307f0b6338ecabc8d

See more details on using hashes here.

File details

Details for the file mol2grid-0.1.4-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for mol2grid-0.1.4-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 984500bdbd8ffadee776e6db64e6cfdc7c6f6da2d5b062cdc6544eaf31a25bcb
MD5 14a834d1d8ba01957fbf91962ca3eae0
BLAKE2b-256 17723c02ee746c788c252df26ee076872f8b11fcd7c9fa0a0ade08728f4cf43f

See more details on using hashes here.

File details

Details for the file mol2grid-0.1.4-cp39-cp39-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: mol2grid-0.1.4-cp39-cp39-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 43.1 kB
  • Tags: CPython 3.9, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for mol2grid-0.1.4-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 e1c282f6cbe4f9b295d34242e8fcf101bf16c49351073f6833ede45b5ab943c0
MD5 3a7758856376d3bdc20470de6b95ed9c
BLAKE2b-256 fea6a3bc591714925d77298577d3aeb31c63545c0e54fb950413e811473ee9db

See more details on using hashes here.

File details

Details for the file mol2grid-0.1.4-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: mol2grid-0.1.4-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 44.1 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10

File hashes

Hashes for mol2grid-0.1.4-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 d29635b9894683e1ce6939871de853762fc9eeedfcadf63ade089abf584eef58
MD5 d432eeab725fcd79394fae1096a0fd44
BLAKE2b-256 ec841d4659b30a188360165ffdc7c4bd796a8caa7802f3f7521aa1319e05a931

See more details on using hashes here.

File details

Details for the file mol2grid-0.1.4-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for mol2grid-0.1.4-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 cbbb1a6827d3d7ceb3fc4ca8c4bacfbb31c9ea185f72d172cc9b2e07dc656756
MD5 01cb6f538cf3d7fe8c7262f0cfc8600f
BLAKE2b-256 396356a0a29024c1e9534ff2623d37abea1e5fad15396a1146cf90f7bed3d08e

See more details on using hashes here.

File details

Details for the file mol2grid-0.1.4-cp38-cp38-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: mol2grid-0.1.4-cp38-cp38-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 43.6 kB
  • Tags: CPython 3.8, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10

File hashes

Hashes for mol2grid-0.1.4-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 aadba81efb097d17938fe138f6350961630cbb13e0b379e024d4ea34d3b24edb
MD5 8c0ea3fca7c0c4375f638c5503e7bd47
BLAKE2b-256 199d87109aa4d0c38fb9b291a3a58a62690d9a406d78f91f87dc67a5ff0b0007

See more details on using hashes here.

File details

Details for the file mol2grid-0.1.4-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: mol2grid-0.1.4-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 44.0 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.9

File hashes

Hashes for mol2grid-0.1.4-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 3c19a75f14a8aae5b4f7ae187ff8e26ae731f352208729aef01a242941174d73
MD5 f0b72ee70d7b392485e4d8d936ac8042
BLAKE2b-256 17e54987350fdc8e53cc7e7cdfb3c762dff0788a996c317f6c5533d3c81f64b0

See more details on using hashes here.

File details

Details for the file mol2grid-0.1.4-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for mol2grid-0.1.4-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 1153665266c380f8da10ff68b35c075fc3791fd2ad80fc54f4451c0586dabdd4
MD5 8724e7991a067bac91d9d47ae85dc419
BLAKE2b-256 52a2a58cebd65ed67e2154a8ab77832689b8cc63473c8dc6b454977bddb11a59

See more details on using hashes here.

File details

Details for the file mol2grid-0.1.4-cp37-cp37m-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: mol2grid-0.1.4-cp37-cp37m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 43.5 kB
  • Tags: CPython 3.7m, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.10

File hashes

Hashes for mol2grid-0.1.4-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 65aac1b7932b091c697e378aa08024264a35f7ce29736a3751463fd4427359b1
MD5 b7fb35f8851a95ff7e91486c4fd5e41c
BLAKE2b-256 1926818f4d36cd0ff8034b71ddd2df4b8ea0fff81102c99dfa6a594456e566ef

See more details on using hashes here.

Supported by

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