MolANN
This package implements classes that define PyTorch Artificial Neural Network (ANN) functions taking into account alignment (translation and rotation), and functions that depend on molecular features (bonds, angles, etc.).
Installation
The package can be installed via pip:
pip install molann
The installation from source is described in the Installation page.
Simple example
The following code defines an ANN as a function of a bond distance and a dihedral angle.
import MDAnalysis as mda
from molann.ann import FeatureLayer, PreprocessingANN, MolANN, create_sequential_nn
from molann.feature import Feature
# pdb file of the system
pdb_filename = '/path/to/system.pdb'
ref = mda.Universe(pdb_filename)
# define a feature that describes the bond between atoms 5 and 6.
f1 = Feature('name', 'bond', ref.select_atoms('bynum 5 6'))
# define a feature that describes the dihedral angle formed by the first 4 atoms.
f2 = Feature('name', 'dihedral', ref.select_atoms('bynum 1 3 2 4'))
# define feature layer using the above two features.
f_layer = FeatureLayer([f1,f2], use_angle_value=False)
# define the preprocessing layer.
# we do not need alignment, since both features f1 and f2 are translation- and rotation-invariant.
pp_layer = PreprocessingANN(None, f_layer)
output_dim = pp_layer.output_dimension()
# define neural network layers that contain training parameters
nn = create_sequential_nn([output_dim, 5, 3])
# define the final network
model = MolANN(pp_layer, nn)
torch.jit.script(model).save('model.pt')
More examples for each class can be found in the MolANN docs .
Documentataion
Please refer to MolANN docs.
Metadata
Release files for molann 1.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| molann-1.1.7.tar.gz | 11.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| molann-1.1.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.6 kB
Release files / molann-1.1.7.tar.gz
| Download URL | molann-1.1.7.tar.gz |
|---|---|
| Size | 11.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2dc0644de5f6ddfcc810066f02aa265c2281f14b65fe1ae2d0a95f654526525a
|
|
BLAKE2b-256 checksum How to use checksums |
ab59b808a9b13d2c0bfff331978ef61702a8e6ec5d1832516377fdecadeb422f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/6.0.0 pkginfo/1.8.3 requests/2.28.2 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.10.8
|
Release files / molann-1.1.7-py3-none-any.whl
| Download URL | molann-1.1.7-py3-none-any.whl |
|---|---|
| Size | 11.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4b972ca90c6caea2be361786472e74141187c15907a77a0f0daad55572ed45c1
|
|
BLAKE2b-256 checksum How to use checksums |
501294d899fe8b406018df21cc66a7497bd1cf5f368fb981251e3e98cd6bdebf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/6.0.0 pkginfo/1.8.3 requests/2.28.2 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.10.8
|