chem-templates


Namechem-templates JSON
Version 0.0.7 PyPI version JSON
download
home_pagehttps://github.com/DarkMatterAI/chem_templates
SummaryA python library for controlling chemical space
upload_time2023-08-27 01:20:36
maintainer
docs_urlNone
authorKarl Heyer
requires_python>=3.7
licenseApache Software License 2.0
keywords nbdev jupyter notebook python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            chem_templates
================

<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

`chem_templates` provides an expressive and flexible way of defining
desired chemical spaces

See the [documentation](https://darkmatterai.github.io/chem_templates/)
for documentation and tutorials

## Install

``` sh
pip install chem_templates
```

## Basic Usage

For more detail on the API, see the [basic
tutorial](https://darkmatterai.github.io/emb_opt/tutorials/basic_example.html)

``` python
from rdkit.Chem import rdMolDescriptors, Descriptors
from chem_templates.filter import RangeFunctionFilter, Template
from chem_templates.chem import Molecule

def hbd(molecule):
    return rdMolDescriptors.CalcNumHBD(molecule.mol)

def hba(molecule):
    return rdMolDescriptors.CalcNumHBA(molecule.mol)

def molwt(molecule):
    return rdMolDescriptors.CalcExactMolWt(molecule.mol)

def logp(molecule):
    return Descriptors.MolLogP(molecule.mol)

hbd_filter = RangeFunctionFilter(hbd, 'hydrogen_bond_donor', None, 5)
hba_filter = RangeFunctionFilter(hba, 'hydrogen_bond_acceptor', None, 10)
molwt_filter = RangeFunctionFilter(molwt, 'mol_weight', None, 500)
logp_filter = RangeFunctionFilter(logp, 'logp', None, 5)

filters = [
    hbd_filter,
    hba_filter,
    molwt_filter,
    logp_filter
]

ro5_template = Template(filters)

smiles = ['C=CCNC(=O)N1CCN(C(=O)[C@H]2C[C@@H]2c2cccc(F)c2F)CC1',
 'C[C@@H]1CCCC[C@@H]1OCC(=O)OCc1nnc(-c2cccc(Br)c2)o1',
 'CCC[C@@H](OC)C(=O)N[C@@H](CNc1cnc(F)cn1)C(C)C',
 'CC(C)/C=C\\C(=O)N1CCC[C@@](CO)(NC(=O)OC(C)(C)C)C1',
 'C(c1ccccc1)CCC[C@@H](C)c1nnc(N2CCN(C(=O)OC(C)(C)C)[C@@H](C)C2)n1Cc1csc(C(C)(C)C)n1',
 'O=C(c1cccc(F)c1)N1CC[C@]2(CN(CC3=CCCCC3)CCO2)C1']

molecules = [Molecule(i) for i in smiles]
results = [ro5_template(i).result for i in molecules]
>[True, True, True, True, False, True]
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/DarkMatterAI/chem_templates",
    "name": "chem-templates",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "nbdev jupyter notebook python",
    "author": "Karl Heyer",
    "author_email": "karl@darkmatterai.co",
    "download_url": "https://files.pythonhosted.org/packages/bf/b8/a2820dfb3bda95176777e67b140b4777b2a0c4fc3ef841c5bb6c0f8ca953/chem_templates-0.0.7.tar.gz",
    "platform": null,
    "description": "chem_templates\n================\n\n<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->\n\n`chem_templates` provides an expressive and flexible way of defining\ndesired chemical spaces\n\nSee the [documentation](https://darkmatterai.github.io/chem_templates/)\nfor documentation and tutorials\n\n## Install\n\n``` sh\npip install chem_templates\n```\n\n## Basic Usage\n\nFor more detail on the API, see the [basic\ntutorial](https://darkmatterai.github.io/emb_opt/tutorials/basic_example.html)\n\n``` python\nfrom rdkit.Chem import rdMolDescriptors, Descriptors\nfrom chem_templates.filter import RangeFunctionFilter, Template\nfrom chem_templates.chem import Molecule\n\ndef hbd(molecule):\n    return rdMolDescriptors.CalcNumHBD(molecule.mol)\n\ndef hba(molecule):\n    return rdMolDescriptors.CalcNumHBA(molecule.mol)\n\ndef molwt(molecule):\n    return rdMolDescriptors.CalcExactMolWt(molecule.mol)\n\ndef logp(molecule):\n    return Descriptors.MolLogP(molecule.mol)\n\nhbd_filter = RangeFunctionFilter(hbd, 'hydrogen_bond_donor', None, 5)\nhba_filter = RangeFunctionFilter(hba, 'hydrogen_bond_acceptor', None, 10)\nmolwt_filter = RangeFunctionFilter(molwt, 'mol_weight', None, 500)\nlogp_filter = RangeFunctionFilter(logp, 'logp', None, 5)\n\nfilters = [\n    hbd_filter,\n    hba_filter,\n    molwt_filter,\n    logp_filter\n]\n\nro5_template = Template(filters)\n\nsmiles = ['C=CCNC(=O)N1CCN(C(=O)[C@H]2C[C@@H]2c2cccc(F)c2F)CC1',\n 'C[C@@H]1CCCC[C@@H]1OCC(=O)OCc1nnc(-c2cccc(Br)c2)o1',\n 'CCC[C@@H](OC)C(=O)N[C@@H](CNc1cnc(F)cn1)C(C)C',\n 'CC(C)/C=C\\\\C(=O)N1CCC[C@@](CO)(NC(=O)OC(C)(C)C)C1',\n 'C(c1ccccc1)CCC[C@@H](C)c1nnc(N2CCN(C(=O)OC(C)(C)C)[C@@H](C)C2)n1Cc1csc(C(C)(C)C)n1',\n 'O=C(c1cccc(F)c1)N1CC[C@]2(CN(CC3=CCCCC3)CCO2)C1']\n\nmolecules = [Molecule(i) for i in smiles]\nresults = [ro5_template(i).result for i in molecules]\n>[True, True, True, True, False, True]\n```\n",
    "bugtrack_url": null,
    "license": "Apache Software License 2.0",
    "summary": "A python library for controlling chemical space",
    "version": "0.0.7",
    "project_urls": {
        "Homepage": "https://github.com/DarkMatterAI/chem_templates"
    },
    "split_keywords": [
        "nbdev",
        "jupyter",
        "notebook",
        "python"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7f3ddffe789929b70d702b3d049e41e4ebc25d711c23aca429dcb6082cd98568",
                "md5": "c51a05e078b1ae08b6e47ad77f7c624c",
                "sha256": "6cf58207bd27575b9ba7db08b2b9873b5ceb3cad9a0c9aa6d6258e595b268e71"
            },
            "downloads": -1,
            "filename": "chem_templates-0.0.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c51a05e078b1ae08b6e47ad77f7c624c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 56588,
            "upload_time": "2023-08-27T01:20:34",
            "upload_time_iso_8601": "2023-08-27T01:20:34.814813Z",
            "url": "https://files.pythonhosted.org/packages/7f/3d/dffe789929b70d702b3d049e41e4ebc25d711c23aca429dcb6082cd98568/chem_templates-0.0.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bfb8a2820dfb3bda95176777e67b140b4777b2a0c4fc3ef841c5bb6c0f8ca953",
                "md5": "3ae0b1cd03bd7949c75836e7ec3b2453",
                "sha256": "3f72c79aad4984d1015234109f7d0e15921a4aeabc3ac7a8b8ac5df428c66ced"
            },
            "downloads": -1,
            "filename": "chem_templates-0.0.7.tar.gz",
            "has_sig": false,
            "md5_digest": "3ae0b1cd03bd7949c75836e7ec3b2453",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 50030,
            "upload_time": "2023-08-27T01:20:36",
            "upload_time_iso_8601": "2023-08-27T01:20:36.191258Z",
            "url": "https://files.pythonhosted.org/packages/bf/b8/a2820dfb3bda95176777e67b140b4777b2a0c4fc3ef841c5bb6c0f8ca953/chem_templates-0.0.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-27 01:20:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "DarkMatterAI",
    "github_project": "chem_templates",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "chem-templates"
}
        
Elapsed time: 0.21646s