molann


Namemolann JSON
Version 1.1.7 PyPI version JSON
download
home_pagehttps://github.com/zwpku/molann
Summary"PyTorch Artificial Neural Networks (ANNs) for Molecular Systems",
upload_time2023-08-31 09:23:53
maintainer
docs_urlNone
authorWei Zhang
requires_python>=3.7
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            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`:

.. code-block:: console

   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.

.. code-block:: python

    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`_.


.. _`Installation`:
  https://molann.readthedocs.io/en/latest/installation.html
.. _`MolANN docs`:
  https://molann.readthedocs.io/en/latest

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/zwpku/molann",
    "name": "molann",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "Wei Zhang",
    "author_email": "wzhangpku@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/ab/59/b808a9b13d2c0bfff331978ef61702a8e6ec5d1832516377fdecadeb422f/molann-1.1.7.tar.gz",
    "platform": null,
    "description": "MolANN\n======\n\nThis 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.). \n\nInstallation \n============\n\nThe package can be installed via `pip`:\n\n.. code-block:: console\n\n   pip install molann\n\nThe installation from source is described in the `Installation`_ page.\n\nSimple example \n==============\n\nThe following code defines an ANN as a function of a bond distance and a dihedral angle.\n\n.. code-block:: python\n\n    import MDAnalysis as mda\n    from molann.ann import FeatureLayer, PreprocessingANN, MolANN, create_sequential_nn\n    from molann.feature import Feature\n\n    # pdb file of the system\n    pdb_filename = '/path/to/system.pdb'\n    ref = mda.Universe(pdb_filename) \n\n    # define a feature that describes the bond between atoms 5 and 6.\n    f1 = Feature('name', 'bond', ref.select_atoms('bynum 5 6'))\n    # define a feature that describes the dihedral angle formed by the first 4 atoms.\n    f2 = Feature('name', 'dihedral', ref.select_atoms('bynum 1 3 2 4'))\n\n    # define feature layer using the above two features.\n    f_layer = FeatureLayer([f1,f2], use_angle_value=False)\n\n    # define the preprocessing layer. \n    # we do not need alignment, since both features f1 and f2 are translation- and rotation-invariant.\n    pp_layer = PreprocessingANN(None, f_layer)\n\n    output_dim = pp_layer.output_dimension()\n    # define neural network layers that contain training parameters \n    nn = create_sequential_nn([output_dim, 5, 3])\n\n    # define the final network\n    model = MolANN(pp_layer, nn)\n\n    torch.jit.script(model).save('model.pt')\n\nMore examples for each class can be found in the `MolANN docs`_ .\n\nDocumentataion\n==============\n\nPlease refer to `MolANN docs`_.\n\n\n.. _`Installation`:\n  https://molann.readthedocs.io/en/latest/installation.html\n.. _`MolANN docs`:\n  https://molann.readthedocs.io/en/latest\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "\"PyTorch Artificial Neural Networks (ANNs) for Molecular Systems\",",
    "version": "1.1.7",
    "project_urls": {
        "Bug Tracker": "https://github.com/zwpku/molann/issues",
        "Homepage": "https://github.com/zwpku/molann"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "501294d899fe8b406018df21cc66a7497bd1cf5f368fb981251e3e98cd6bdebf",
                "md5": "a4681bc20f7a944e7c250fecb0ea41e5",
                "sha256": "4b972ca90c6caea2be361786472e74141187c15907a77a0f0daad55572ed45c1"
            },
            "downloads": -1,
            "filename": "molann-1.1.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a4681bc20f7a944e7c250fecb0ea41e5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 11489,
            "upload_time": "2023-08-31T09:23:51",
            "upload_time_iso_8601": "2023-08-31T09:23:51.531079Z",
            "url": "https://files.pythonhosted.org/packages/50/12/94d899fe8b406018df21cc66a7497bd1cf5f368fb981251e3e98cd6bdebf/molann-1.1.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ab59b808a9b13d2c0bfff331978ef61702a8e6ec5d1832516377fdecadeb422f",
                "md5": "bdbe442b73499c32d6568a728d4c6f62",
                "sha256": "2dc0644de5f6ddfcc810066f02aa265c2281f14b65fe1ae2d0a95f654526525a"
            },
            "downloads": -1,
            "filename": "molann-1.1.7.tar.gz",
            "has_sig": false,
            "md5_digest": "bdbe442b73499c32d6568a728d4c6f62",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 11147,
            "upload_time": "2023-08-31T09:23:53",
            "upload_time_iso_8601": "2023-08-31T09:23:53.467957Z",
            "url": "https://files.pythonhosted.org/packages/ab/59/b808a9b13d2c0bfff331978ef61702a8e6ec5d1832516377fdecadeb422f/molann-1.1.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-31 09:23:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "zwpku",
    "github_project": "molann",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "molann"
}
        
Elapsed time: 0.13177s