Skip to content

Commit

Permalink
0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
SeonghwanSeo committed Dec 19, 2023
1 parent 6d3b861 commit 1b63a89
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 35 deletions.
51 changes: 23 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
![pypi](https://img.shields.io/pypi/v/molvoxel.svg?logo=pypi)
![versions](https://img.shields.io/pypi/pyversions/molvoxel.svg?logo=python)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)

# MolVoxel: Molecular Voxelization Tool
MolVoxel is an easy-to-use **Molecular Voxelization Tool** implemented in Python.

It requires few dependencies, so it's very simple to install and use. If you want to use numba version, just install numba additionally.
MolVoxel is an Easy-to-Use **Molecular Voxelization Tool** implemented in Python.

It requires minimal dependencies, so it's very simple to install and use. If you want to use numba version, just install numba additionally.

### Dependencies

- Required
- Numpy
- Numpy, SciPy
- Optional
- SciPy - `from molvoxel.voxelizer.numpy import Voxelizer`
- Numba - `from molvoxel.voxelizer.numba import Voxelizer`
- PyTorch - `from molvoxel.voxelizer.torch import Voxelizer`, **CUDA Available**
- Numba
- PyTorch, **CUDA Available**
- RDKit, pymol-open-source

### Citation
Expand All @@ -25,9 +29,18 @@ It requires few dependencies, so it's very simple to install and use. If you wan
}
```



## Quick Start

### Create Voxelizer Object
### Installation

```shell
pip install molvoxel
pip install molvoxel[numba, torch, rdkit] # Optional Dependencies
```

### Configuring Voxelizer Object
```python
import molvoxel
# Default (Gaussian sigma = 0.5)
Expand All @@ -40,7 +53,7 @@ voxelizer = molvoxel.create_voxelizer(density_type='binary', library='torch')
voxelizer = molvoxel.create_voxelizer(library='torch', device='cuda')
```

### Create Voxel
### Voxelization
#### Numpy, Numba

```python
Expand All @@ -57,7 +70,7 @@ coords = mol.GetConformer().GetPositions()
center = coords.mean(axis=0) # (3,)
atom_types = np.array([channels[atom.GetSymbol()] for atom in mol.GetAtoms()]) # (V,)
atom_features = np.array([get_atom_features(atom) for atom in mol.GetAtoms()]) # (V, 5)
atom_radius = 1.0 # (scalar)
atom_radius = 1.0 # scalar

image = voxelizer.forward_single(coords, center, atom_radius) # (1, 64, 64, 64)
image = voxelizer.forward_types(coords, center, atom_types, atom_radius) # (4, 64, 64, 64)
Expand All @@ -80,26 +93,8 @@ image = voxelizer.forward_single(coords, center, atom_radius)
image = voxelizer.forward_types(coords, center, atom_types, atom_radius) # (4, 32, 32, 32)
image = voxelizer.forward_features(coords, center, atom_features, atom_radius) # (5, 32, 32, 32)
```
---

## Installation

```shell
# Required: numpy
# Not Required, but Recommended: RDKit
# Optional - Numpy: scipy
# Optional - Numba: numba
# Optional - PyTorch : torch
# Optional - Visualization : pymol-open-source (conda)
git clone https://github.com/SeonghwanSeo/molvoxel.git
cd molvoxel/
pip install -e .

# With extras_require
# pip install -e '.[numpy, numba, torch, rdkit]'
```

---

## Voxelization

Expand Down Expand Up @@ -147,7 +142,7 @@ $$
I_{d,h,w,:} = \sum_{n}^{N} F_n \times f(||X_n - G_{d,h,w}||,R_n,\sigma)
$$

---


## RDKit Wrapper

Expand Down
2 changes: 2 additions & 0 deletions molvoxel/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
from .voxelizer import *

__version__ = '0.1.2'
40 changes: 33 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,44 @@
from setuptools import setup

with open('./README.md', encoding='utf-8') as f:
long_description = f.read()

setup(
name='molvoxel',
version='0.1.0',
description='MolVoxel: Python Library to Voxelize 3D Molecular Structure',
version='0.1.2',
description='MolVoxel:Easy-to-Use Molecular Voxelization Tool',
long_description=long_description,
long_description_content_type='text/markdown',
author='Seonghwan Seo',
author_email='[email protected]',
url='https://github.com/SeonghwanSeo/molvoxel',
packages=['molvoxel/'],
install_requires=['numpy'],
extras_require = {
'numpy': ['scipy'],
install_requires=['numpy', 'scipy'],
extras_require={
'numba': ['numba'],
'torch': ['torch'],
'rdkit': ['rdkit-pypi'],
}
'rdkit': ['rdkit'],
},
classifiers=[
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',

'Development Status :: 4 - Beta',

'Operating System :: OS Independent',

'License :: OSI Approved :: MIT License',

'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Bio-Informatics',
'Topic :: Scientific/Engineering :: Chemistry',
'Topic :: Software Development :: Libraries :: Python Modules',

'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
],
)

0 comments on commit 1b63a89

Please sign in to comment.