A python library for controlling chemical space
Project description
chem_templates
chem_templates
provides an expressive and flexible way of defining
desired chemical spaces
See the documentation for documentation and tutorials
Install
pip install chem_templates
Basic Usage
For more detail on the API, see the basic tutorial
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]
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
chem_templates-0.0.6.tar.gz
(49.4 kB
view hashes)
Built Distribution
Close
Hashes for chem_templates-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d85480eb0d5c10615287749ad8bd3a0c9fe8a9f192f48a8a81bfad150e1ce844 |
|
MD5 | fef476e045dd7fe185e3b1168b4b665c |
|
BLAKE2b-256 | a3ce91fce8a07844788cbc0fe5209f685ae20f16d571f6972b63c45480a986e9 |