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
Python package to insert a molecule in a 3D grid, considering each atom type as an integer.
See also:
Requirements
Python 3.6+
NumPy 1.19.4+
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/jvsguerra/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
Built Distributions
Hashes for mol2grid-0.1.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 585fe0123bbf617267aeb5077b9bc2551177c41d3fabb5e43995b0a7e07c9de4 |
|
MD5 | 163d61af1a5e6a68aa8b37d1938371e1 |
|
BLAKE2b-256 | 1685f3d11e0ad5ed1cbd778d8a916e4e9c01dd125759974798e6ff5e59794219 |
Hashes for mol2grid-0.1.1-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9b431995f17a18759743416e428f9545bf12844b7cc489b20679c37295f23a9 |
|
MD5 | 787a61f5096d19e6941cdbd5e8a3b36e |
|
BLAKE2b-256 | 9508076e562d4a21bc3f0eb78562081a658ac3ca8971723c45c28ff13c459a43 |
Hashes for mol2grid-0.1.1-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b85b72bed28bb50f51d1b1c5ed466bf18629714fb9ba57609526674d46ee4912 |
|
MD5 | 66092a0aca654ff738f0e3fd1c4862b5 |
|
BLAKE2b-256 | e3f38b91b9ce4972065c14404ecba4bb853a4b21cdde1b052b74451e9183a85f |
Hashes for mol2grid-0.1.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59be569174a8bb7c9079639e73918e09362444f78a394cef9d392610646ed41a |
|
MD5 | a1770c444f855814d2cb0744f1cd6ad2 |
|
BLAKE2b-256 | fc798b17f189c863ca6cb50988b422fe49e399510a1b9df840b5c694646f342c |
Hashes for mol2grid-0.1.1-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6f83426069e5f4fb010ffbf6ce4136bf2be0369352a9582551cd74c0102ca06 |
|
MD5 | ecb17c58914fcc88d0f5469c3c97b0c0 |
|
BLAKE2b-256 | 83b5a062409acbcec5dcfd6e253ac78a8dbac628e69eada022e9fabbabb30269 |
Hashes for mol2grid-0.1.1-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01a30f7bd251c17aa9ce7a4961a0e40e8ba093e2b94217fba1e4af0a0b5391e8 |
|
MD5 | 1d83845f7a16941ca675deea84845525 |
|
BLAKE2b-256 | dec8711b4cd1cc9d30a3682c109a97d46c95d77e68eb07041324653434a3b749 |
Hashes for mol2grid-0.1.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71d2d59ada6c64a22180b59eefa569499982af98d5669f0d00b10c40fccc107f |
|
MD5 | f9ee151da9314b9da77326e2b725fe83 |
|
BLAKE2b-256 | a844390e686d22ddb9a7fd3457eea128fbe553453b190ffbc322d5df99a17a66 |
Hashes for mol2grid-0.1.1-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db140ac9a36bf9dc3648cfff53edb1e8503239f74c42385751d17cd5e77a48a7 |
|
MD5 | 7832f8fc24327f1ed3e208a956d14a35 |
|
BLAKE2b-256 | 2cddb01e9ccf35d935d8138b8d207cbea3a6969764e421be97059cde730f0edf |
Hashes for mol2grid-0.1.1-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1ae697b74a75aa3b45812bd490b19f1b24385732412bba0886508a1a7a41bdf |
|
MD5 | ae8896cc85880c64887ccfa0aff0035b |
|
BLAKE2b-256 | 9b27de1fdd0b759e883bbde55707c9197eb57c7a861a49e4b17c04129bf71566 |
Hashes for mol2grid-0.1.1-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed174d32b8a8e20e7a4829e74d6e31eed17c50906d9194bd9fa0cae579c028c5 |
|
MD5 | e72b3775562b532f2624023d4f9e646f |
|
BLAKE2b-256 | d45acd9c48319b4ff1662d782727209c961a3ea327e88462b28c8bf19f21c52f |