ChemLogic


NameChemLogic JSON
Version 0.1.1 PyPI version JSON
download
home_pageNone
SummaryChemLogic is a neurosymbolic framework that integrates relational logic syntax with various graph neural network (GNN) architectures to model chemical knowledge. It encodes functional groups and molecular subgraph patterns into a differentiable, explainable architecture, enabling the construction of interpretable and modular GNN-based models for chemical reasoning.
upload_time2025-07-11 19:48:37
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseMIT License Copyright (c) 2023-2025 Kai Hodžić 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 chemistry differentiable knowledge base graph neural network gnn neurosymbolic explainable molecule property molecular property prediction functional group logic logic programming relational relational logic cheminformatics
VCS
bugtrack_url
requirements ipykernel ipython mlflow nbconvert neuralogic optuna pysmiles pytest pytest-mock RDKit ruff scikit-learn torch-geometric
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ChemLogic

ChemLogic is a neurosymbolic framework that integrates relational logic syntax with graph neural networks (GNNs) to model chemical knowledge. It is designed for interpretable molecular property prediction, combining symbolic reasoning with differentiable learning. ChemLogic was entirely built on the [PyNeuraLogic](https://github.com/LukasZahradnik/PyNeuraLogic) framework.

## 🧬 Introduction

ChemLogic enables binary classification for molecular property prediction tasks on chemistry datasets, such as mutagenicity and toxicity prediction. It supports explainable AI by encoding functional groups and molecular subgraph patterns into logical rules, which are then integrated into GNN architectures. The weights of these rules provide interpretable insights into the model's reasoning process.

## ✨ Features

- Supports well-known GNN architectures from the literature.
- Encodes chemical knowledge using relational logic syntax.
- Integrates functional groups and molecular subgraph patterns into a learnable knowledge base.
- Enables explainable and interpretable predictions.
- Designed for binary classification tasks with future support for regression and more.

## 📦 Installation

ChemLogic is available via PyPI. You can install it using:

```bash
pip install ChemLogic
```

## 📂 Project structure

The project consists off of 3 main modules:

- `datasets` - contain the datasets encoded in relational manner. Includes data from `TUD` and `TDC` datasets, as well as a converter from custom SMILES datasets.
- `models` - contains the GNN architectures.
- `knowledge_base` - contains the functional groups and subgraph patters.

## 🚀 Usage

Basic example of training a GNN on the MUTAG dataset can be found in `notebooks/run_example`.

## 🧩 Dependencies

ChemLogic requires Python 3.11 and Java >=1.8. For visualization `graphviz` is required.

All dependencies are listed in `pyproject.toml`.

## 🤝 Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines on how to get started.

## 📄 License

This project is licensed under the MIT License.
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "ChemLogic",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "chemistry, differentiable, knowledge base, graph neural network, GNN, neurosymbolic, explainable, molecule, property, molecular property prediction, functional group, logic, logic programming, relational, relational logic, cheminformatics",
    "author": null,
    "author_email": "=?utf-8?b?S2FpIEhvZMW+acSH?= <hodzic.e.k@outlook.com>",
    "download_url": "https://files.pythonhosted.org/packages/5c/b8/c31e5eae4f24e81d32aeab8b94fd72f89573f0da6f9e9bfeea959a8c7b78/chemlogic-0.1.1.tar.gz",
    "platform": null,
    "description": "# ChemLogic\n\nChemLogic is a neurosymbolic framework that integrates relational logic syntax with graph neural networks (GNNs) to model chemical knowledge. It is designed for interpretable molecular property prediction, combining symbolic reasoning with differentiable learning. ChemLogic was entirely built on the [PyNeuraLogic](https://github.com/LukasZahradnik/PyNeuraLogic) framework.\n\n## \ud83e\uddec Introduction\n\nChemLogic enables binary classification for molecular property prediction tasks on chemistry datasets, such as mutagenicity and toxicity prediction. It supports explainable AI by encoding functional groups and molecular subgraph patterns into logical rules, which are then integrated into GNN architectures. The weights of these rules provide interpretable insights into the model's reasoning process.\n\n## \u2728 Features\n\n- Supports well-known GNN architectures from the literature.\n- Encodes chemical knowledge using relational logic syntax.\n- Integrates functional groups and molecular subgraph patterns into a learnable knowledge base.\n- Enables explainable and interpretable predictions.\n- Designed for binary classification tasks with future support for regression and more.\n\n## \ud83d\udce6 Installation\n\nChemLogic is available via PyPI. You can install it using:\n\n```bash\npip install ChemLogic\n```\n\n## \ud83d\udcc2 Project structure\n\nThe project consists off of 3 main modules:\n\n- `datasets` - contain the datasets encoded in relational manner. Includes data from `TUD` and `TDC` datasets, as well as a converter from custom SMILES datasets.\n- `models` - contains the GNN architectures.\n- `knowledge_base` - contains the functional groups and subgraph patters.\n\n## \ud83d\ude80 Usage\n\nBasic example of training a GNN on the MUTAG dataset can be found in `notebooks/run_example`.\n\n## \ud83e\udde9 Dependencies\n\nChemLogic requires Python 3.11 and Java >=1.8. For visualization `graphviz` is required.\n\nAll dependencies are listed in `pyproject.toml`.\n\n## \ud83e\udd1d Contributing\n\nContributions are welcome! Please see CONTRIBUTING.md for guidelines on how to get started.\n\n## \ud83d\udcc4 License\n\nThis project is licensed under the MIT License.",
    "bugtrack_url": null,
    "license": "MIT License\n         \n         Copyright (c) 2023-2025 Kai Hod\u017ei\u0107\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": "ChemLogic is a neurosymbolic framework that integrates relational logic syntax with various graph neural network (GNN) architectures to model chemical knowledge. It encodes functional groups and molecular subgraph patterns into a differentiable, explainable architecture, enabling the construction of interpretable and modular GNN-based models for chemical reasoning.",
    "version": "0.1.1",
    "project_urls": {
        "Homepage": "https://github.com/erhc/ChemLogic"
    },
    "split_keywords": [
        "chemistry",
        " differentiable",
        " knowledge base",
        " graph neural network",
        " gnn",
        " neurosymbolic",
        " explainable",
        " molecule",
        " property",
        " molecular property prediction",
        " functional group",
        " logic",
        " logic programming",
        " relational",
        " relational logic",
        " cheminformatics"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "82e0db3c656dbdaf094541d11a233098d58de4e3108042c99ef66cf0ffe89b1b",
                "md5": "82de01d58e09f98867b4ad5e2565470a",
                "sha256": "4da845d74b1bdf0e1a81baea5bc76d5afc1144e45fbff8147a2a8f4cb71c6fec"
            },
            "downloads": -1,
            "filename": "chemlogic-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "82de01d58e09f98867b4ad5e2565470a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 6578504,
            "upload_time": "2025-07-11T19:48:35",
            "upload_time_iso_8601": "2025-07-11T19:48:35.481004Z",
            "url": "https://files.pythonhosted.org/packages/82/e0/db3c656dbdaf094541d11a233098d58de4e3108042c99ef66cf0ffe89b1b/chemlogic-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "5cb8c31e5eae4f24e81d32aeab8b94fd72f89573f0da6f9e9bfeea959a8c7b78",
                "md5": "bc4373ba51de725773c92876d0f3a4d8",
                "sha256": "6ca2176fa657f007aba836c87458ba807173094ff67ce04af6c5f2ca2b59e0ee"
            },
            "downloads": -1,
            "filename": "chemlogic-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "bc4373ba51de725773c92876d0f3a4d8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 6007878,
            "upload_time": "2025-07-11T19:48:37",
            "upload_time_iso_8601": "2025-07-11T19:48:37.343512Z",
            "url": "https://files.pythonhosted.org/packages/5c/b8/c31e5eae4f24e81d32aeab8b94fd72f89573f0da6f9e9bfeea959a8c7b78/chemlogic-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-11 19:48:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "erhc",
    "github_project": "ChemLogic",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "ipykernel",
            "specs": [
                [
                    "==",
                    "6.29.5"
                ]
            ]
        },
        {
            "name": "ipython",
            "specs": [
                [
                    "==",
                    "8.35.0"
                ]
            ]
        },
        {
            "name": "mlflow",
            "specs": [
                [
                    ">=",
                    "2.14.0"
                ]
            ]
        },
        {
            "name": "nbconvert",
            "specs": [
                [
                    "==",
                    "7.16.6"
                ]
            ]
        },
        {
            "name": "neuralogic",
            "specs": [
                [
                    "==",
                    "0.7.16"
                ]
            ]
        },
        {
            "name": "optuna",
            "specs": [
                [
                    ">=",
                    "4.3.0"
                ]
            ]
        },
        {
            "name": "pysmiles",
            "specs": [
                [
                    ">=",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "pytest",
            "specs": [
                [
                    "==",
                    "8.3.5"
                ]
            ]
        },
        {
            "name": "pytest-mock",
            "specs": [
                [
                    "==",
                    "3.12.0"
                ]
            ]
        },
        {
            "name": "RDKit",
            "specs": [
                [
                    ">=",
                    "2025.3.2"
                ]
            ]
        },
        {
            "name": "ruff",
            "specs": [
                [
                    "==",
                    "0.9.10"
                ]
            ]
        },
        {
            "name": "scikit-learn",
            "specs": [
                [
                    ">=",
                    "1.6.1"
                ]
            ]
        },
        {
            "name": "torch-geometric",
            "specs": [
                [
                    ">=",
                    "2.6.1"
                ]
            ]
        }
    ],
    "lcname": "chemlogic"
}
        
Elapsed time: 0.91630s