molcraft


Namemolcraft JSON
Version 0.1.0a11 PyPI version JSON
download
home_pageNone
SummaryGraph Neural Networks for Molecular Machine Learning
upload_time2025-09-08 09:46:46
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseMIT License Copyright (c) 2025 Alexander Kensert Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords python machine-learning deep-learning graph-neural-networks molecular-machine-learning molecular-graphs computational-chemistry computational-biology
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <img src="https://github.com/akensert/molcraft/blob/main/docs/_static/molcraft-logo.png" alt="molcraft-logo">

**Deep Learning on Molecules**: A Minimalistic GNN package for Molecular ML. 

> [!NOTE]  
> In progress.

## Installation

For CPU users:

```bash
pip install --pre molcraft
```

For GPU users:
```bash
pip install --pre molcraft[gpu]
```

## Examples 

```python
from molcraft import features
from molcraft import descriptors
from molcraft import featurizers 
from molcraft import layers
from molcraft import models 
import keras

featurizer = featurizers.MolGraphFeaturizer(
    atom_features=[
        features.AtomType(),
        features.NumHydrogens(),
        features.Degree(),
    ],
    bond_features=[
        features.BondType(),
        features.IsRotatable(),
    ],
    super_atom=True,
    self_loops=True,
)

graph = featurizer([('N[C@@H](C)C(=O)O', 2.0), ('N[C@@H](CS)C(=O)O', 1.0)])
print(graph)

model = models.GraphModel.from_layers(
    [
        layers.Input(graph.spec),
        layers.NodeEmbedding(dim=128),
        layers.EdgeEmbedding(dim=128),
        layers.GraphTransformer(units=128),
        layers.GraphTransformer(units=128),
        layers.GraphTransformer(units=128),
        layers.GraphTransformer(units=128),
        layers.Readout(mode='mean'),
        keras.layers.Dense(units=1024, activation='relu'),
        keras.layers.Dense(units=1024, activation='relu'),
        keras.layers.Dense(1)
    ]
)

pred = model(graph)
print(pred)

# featurizers.save_featurizer(featurizer, '/tmp/featurizer.json')
# models.save_model(model, '/tmp/model.keras')

# loaded_featurizer = featurizers.load_featurizer('/tmp/featurizer.json')
# loaded_model = models.load_model('/tmp/model.keras')
```


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "molcraft",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "python, machine-learning, deep-learning, graph-neural-networks, molecular-machine-learning, molecular-graphs, computational-chemistry, computational-biology",
    "author": null,
    "author_email": "Alexander Kensert <alexander.kensert@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/4b/68/907d8b2a7430d284874abb5d01a0f931dc4820bb173dea3f92efbf59cbc7/molcraft-0.1.0a11.tar.gz",
    "platform": null,
    "description": "<img src=\"https://github.com/akensert/molcraft/blob/main/docs/_static/molcraft-logo.png\" alt=\"molcraft-logo\">\n\n**Deep Learning on Molecules**: A Minimalistic GNN package for Molecular ML. \n\n> [!NOTE]  \n> In progress.\n\n## Installation\n\nFor CPU users:\n\n```bash\npip install --pre molcraft\n```\n\nFor GPU users:\n```bash\npip install --pre molcraft[gpu]\n```\n\n## Examples \n\n```python\nfrom molcraft import features\nfrom molcraft import descriptors\nfrom molcraft import featurizers \nfrom molcraft import layers\nfrom molcraft import models \nimport keras\n\nfeaturizer = featurizers.MolGraphFeaturizer(\n    atom_features=[\n        features.AtomType(),\n        features.NumHydrogens(),\n        features.Degree(),\n    ],\n    bond_features=[\n        features.BondType(),\n        features.IsRotatable(),\n    ],\n    super_atom=True,\n    self_loops=True,\n)\n\ngraph = featurizer([('N[C@@H](C)C(=O)O', 2.0), ('N[C@@H](CS)C(=O)O', 1.0)])\nprint(graph)\n\nmodel = models.GraphModel.from_layers(\n    [\n        layers.Input(graph.spec),\n        layers.NodeEmbedding(dim=128),\n        layers.EdgeEmbedding(dim=128),\n        layers.GraphTransformer(units=128),\n        layers.GraphTransformer(units=128),\n        layers.GraphTransformer(units=128),\n        layers.GraphTransformer(units=128),\n        layers.Readout(mode='mean'),\n        keras.layers.Dense(units=1024, activation='relu'),\n        keras.layers.Dense(units=1024, activation='relu'),\n        keras.layers.Dense(1)\n    ]\n)\n\npred = model(graph)\nprint(pred)\n\n# featurizers.save_featurizer(featurizer, '/tmp/featurizer.json')\n# models.save_model(model, '/tmp/model.keras')\n\n# loaded_featurizer = featurizers.load_featurizer('/tmp/featurizer.json')\n# loaded_model = models.load_model('/tmp/model.keras')\n```\n\n",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2025 Alexander Kensert\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.\n        ",
    "summary": "Graph Neural Networks for Molecular Machine Learning",
    "version": "0.1.0a11",
    "project_urls": {
        "Homepage": "https://github.com/compomics/molcraft"
    },
    "split_keywords": [
        "python",
        " machine-learning",
        " deep-learning",
        " graph-neural-networks",
        " molecular-machine-learning",
        " molecular-graphs",
        " computational-chemistry",
        " computational-biology"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "73f0ee7d1c8246e9ede4e8541e14d2d84a96ccdf53c01454de824b3c424c4893",
                "md5": "25aca352313da472d74a1e8e7090ddee",
                "sha256": "b369f256e0635a795647df1f5df9b58b728911ae7bbcd907587017b7d883321b"
            },
            "downloads": -1,
            "filename": "molcraft-0.1.0a11-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "25aca352313da472d74a1e8e7090ddee",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 48678,
            "upload_time": "2025-09-08T09:46:44",
            "upload_time_iso_8601": "2025-09-08T09:46:44.697639Z",
            "url": "https://files.pythonhosted.org/packages/73/f0/ee7d1c8246e9ede4e8541e14d2d84a96ccdf53c01454de824b3c424c4893/molcraft-0.1.0a11-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4b68907d8b2a7430d284874abb5d01a0f931dc4820bb173dea3f92efbf59cbc7",
                "md5": "9ca69db6b303778fc3dc21536346d930",
                "sha256": "e6000318478adfee7a0a944decc66ea2a5eb7bb415ffbde0179063b1184b1dd0"
            },
            "downloads": -1,
            "filename": "molcraft-0.1.0a11.tar.gz",
            "has_sig": false,
            "md5_digest": "9ca69db6b303778fc3dc21536346d930",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 47955,
            "upload_time": "2025-09-08T09:46:46",
            "upload_time_iso_8601": "2025-09-08T09:46:46.706725Z",
            "url": "https://files.pythonhosted.org/packages/4b/68/907d8b2a7430d284874abb5d01a0f931dc4820bb173dea3f92efbf59cbc7/molcraft-0.1.0a11.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-08 09:46:46",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "compomics",
    "github_project": "molcraft",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "molcraft"
}
        
Elapsed time: 4.25070s