{ "info": { "author": "Pavel Polishchuk", "author_email": "pavel_polishchuk@ukr.net", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Topic :: Scientific/Engineering :: Bio-Informatics", "Topic :: Scientific/Engineering :: Chemistry" ], "description": "# Pmapper - 3D pharmacophore signatures and fingerprints\n\nPmapper is a Python module to generate 3D pharmacophore signatures and fingerprints.\nSignatures uniquely encode 3D pharmacophores with hashes suitable for fast identification of identical pharmacophores.\n\n## Dependency\n\n`rdkit >= 2017.09` \n`networkx >= 1.11`\n\n## Installation\n```text\npip install pmapper\n```\n\n## Examples\n\n### Load modules\n```python\nfrom pmapper.pharmacophore import Pharmacophore as P\nfrom rdkit import Chem\nfrom rdkit.Chem import AllChem\nfrom pprint import pprint\n```\n### Create pharmacophore from a single conformer using default feature definitions\n```python\n# load a molecule from SMILES and generate 3D coordinates\nmol = Chem.MolFromSmiles('C1CC(=O)NC(=O)C1N2C(=O)C3=CC=CC=C3C2=O') # talidomide\nmol = Chem.AddHs(mol)\nAllChem.EmbedMolecule(mol, randomSeed=42)\n\n# create pharmacophore\np = P()\np.load_from_mol(mol)\n```\n### Get 3D pharmacophore signature\n```python\n# get 3D pharmacophore signature\nsig = p.get_signature_md5()\nprint(sig)\n```\nOutput:\n```text\n98504647beeb143ae50bb6b7798ca0f0\n```\n### Get 3D pharmacophore signature with non-zero tolerance\n```python\nsig = p.get_signature_md5(tol=5)\nprint(sig)\n```\nOutput:\n```text\nbc54806ba01bf59736a7b62b017d6e1d\n```\n### Create pharmacophores for a multiple conformer compound\n```python\nfrom pmapper.utils import load_multi_conf_mol\n\n# create multiple conformer molecule\nAllChem.EmbedMultipleConfs(mol, numConfs=10, randomSeed=1024)\n\nps = load_multi_conf_mol(mol)\n\nsig = [p.get_signature_md5() for p in ps]\n\npprint(sig) # identical signatures occur\n```\nOutput:\n```text\n['d5f5f9d65e39cb8605f1fa9db5b2fbb0',\n '6204791002d1e343b2bde323149fa780',\n 'abfabd8a4fcf5719ed6bf2c71a60852c',\n 'dfe9f17d30210cb94b8dd7acf77feae9',\n 'abfabd8a4fcf5719ed6bf2c71a60852c',\n 'e739fb5f9985ce0c65a16da41da4a33f',\n '2297ddf0e437b7fc32077f75e3924dcd',\n 'e739fb5f9985ce0c65a16da41da4a33f',\n '182a00bd9057abd0c455947d9cfa457c',\n '68f226d474808e60ab1256245f64c2b7']\n```\nIdentical hashes should correspond to pharmacophores with low RMSD. Pharmacophores #2 and #4 have identical hash `abfabd8a4fcf5719ed6bf2c71a60852c`. Let's check RMSD.\n```python\nfrom pmapper.utils import get_rms\nfor i in range(len(ps)):\n print(\"rmsd bewteen 2 and %i pharmacophore:\" % i, round(get_rms(ps[2], ps[i]), 2))\n```\nOutput\n```text\nrmsd bewteen 2 and 0 pharmacophore: 0.63\nrmsd bewteen 2 and 1 pharmacophore: 0.99\nrmsd bewteen 2 and 2 pharmacophore: 0.0\nrmsd bewteen 2 and 3 pharmacophore: 0.41\nrmsd bewteen 2 and 4 pharmacophore: 0.18\nrmsd bewteen 2 and 5 pharmacophore: 0.19\nrmsd bewteen 2 and 6 pharmacophore: 1.15\nrmsd bewteen 2 and 7 pharmacophore: 0.32\nrmsd bewteen 2 and 8 pharmacophore: 0.69\nrmsd bewteen 2 and 9 pharmacophore: 0.36\n```\nThey really have RMSD < binning step (1A by default). However, other pharmacophores with distinct hashes also have low RMSD to #2. Identical hashes guarantee low RMSD between corresponding pharmacophores, but not vice versa.\n\n### Pharmacophore match\nCreate a two-point pharmacophore model and match with a pharmacophore of a molecule (both pharmacophores should have identical binning steps)\n```python\nq = P()\nq.load_from_feature_coords([('a', (3.17, -0.23, 0.24)), ('D', (-2.51, -1.28, -1.14))])\np.fit_model(q)\n```\nOutput\n```text\n(0, 1)\n```\nIf they do not match `None` will be returned\n\n### Generate 3D pharmacophore fingerprint\n```python\n# generate 3D pharmacophore fingerprint which takes into account stereoconfiguration\nb = p.get_fp(min_features=4, max_features=4) # set of activated bits\nprint(b)\n```\nOutput (a set of activated bit numbers):\n```text\n{259, 1671, 521, 143, 912, 402, 278, 406, 1562, 1692, 1835, 173, 558, 1070, 942, 1202, 1845, 823, 1476, 197, 968, 1355, 845, 1741, 1364, 87, 1881, 987, 1515, 378, 628, 1141, 1401, 1146, 2043}\n```\nChange settings:\n```python\nb = p.get_fp(min_features=4, max_features=4, nbits=4096, activate_bits=2)\nprint(b)\n```\nOutput (a set of activated bit numbers):\n```text\n{389, 518, 2821, 1416, 2952, 395, 3339, 511, 3342, 1937, 1042, 2710, 1817, 1690, 3482, 3737, 286, 1824, 1700, 804, 1318, 2729, 3114, 812, 556, 175, 3763, 2356, 3124, 1077, 1975, 3384, 1081, 185, 65, 1223, 713, 1356, 1998, 1487, 2131, 85, 3670, 1877, 3030, 2395, 1116, 2141, 1885, 347, 2404, 1382, 1257, 3049, 2795, 3691, 2541, 1646, 2283, 241, 113, 3698, 756, 2548, 4086, 2293, 1528, 2802, 127}\n```\n### Save/load pharmacophore\n```python\np.save_to_pma('filename.pma')\n```\nOutput is a text file having json format.\n```python\np = P()\np.load_from_pma('filename.pma')\n```\n### Support other formats\nPharmacophores can be saved/loaded from LigandScout pml-files. Also pharmacophores can be read from xyz-files.\n\n### Caching\nPharmacophores can be created with enabled `cache` argument. This will speed up all futher repeated calls to retrive hash, fingerprints or descriptors.\n```python\np = P(cache=True)\n```\n\n## Speed tests\nGeneration of pharmacophore signatures (hashes) is a CPU-bound task. The computation speed depends on the number of features in pharmacophores. \nTests were run on 500 compounds (a random subset from Drugbank). Up to 50 conformers were generated for each compound. Up to 100 pharmacophores having a particular number of features were chosen randomly from the whole number of 25000 pharmacophores to generate pharmacophore signatures. Cache was disabled but enabled cache would not affect calculation time for the first time function calls. \nLaptop configuration:\n- Intel(R) Core(TM) i7-5500U CPU @ 2.40GHz\n- 12 GB RAM\n- calculation was run in 1 thread (the module is thread safe and calculations can be parallelized)\n\n```text\npharmacophore generation: 19.21 s\ntotal number of pharmacophores: 25000\n\npharmacophore hash generation:\n50 pharmacophores having 2 features: 0.00 s; time per pharmacophore: 0.00000 s\n100 pharmacophores having 3 features: 0.01 s; time per pharmacophore: 0.00010 s\n100 pharmacophores having 4 features: 0.01 s; time per pharmacophore: 0.00010 s\n100 pharmacophores having 5 features: 0.04 s; time per pharmacophore: 0.00040 s\n100 pharmacophores having 6 features: 0.12 s; time per pharmacophore: 0.00120 s\n100 pharmacophores having 7 features: 0.24 s; time per pharmacophore: 0.00240 s\n100 pharmacophores having 8 features: 0.51 s; time per pharmacophore: 0.00510 s\n100 pharmacophores having 9 features: 0.94 s; time per pharmacophore: 0.00940 s\n100 pharmacophores having 10 features: 1.86 s; time per pharmacophore: 0.01860 s\n100 pharmacophores having 11 features: 3.02 s; time per pharmacophore: 0.03020 s\n100 pharmacophores having 12 features: 4.17 s; time per pharmacophore: 0.04170 s\n100 pharmacophores having 13 features: 7.04 s; time per pharmacophore: 0.07040 s\n100 pharmacophores having 14 features: 9.29 s; time per pharmacophore: 0.09290 s\n100 pharmacophores having 15 features: 12.94 s; time per pharmacophore: 0.12940 s\n100 pharmacophores having 16 features: 17.79 s; time per pharmacophore: 0.17790 s\n100 pharmacophores having 17 features: 23.58 s; time per pharmacophore: 0.23580 s\n100 pharmacophores having 18 features: 33.83 s; time per pharmacophore: 0.33830 s\n100 pharmacophores having 19 features: 40.43 s; time per pharmacophore: 0.40430 s\n100 pharmacophores having 20 features: 58.30 s; time per pharmacophore: 0.58300 s\n```\n\n## Documentation\nMode documentation can be found here - https://pmapper.readthedocs.io/en/latest/\n\n## Citation\nLigand-Based Pharmacophore Modeling Using Novel 3D Pharmacophore Signatures \nAlina Kutlushina, Aigul Khakimova, Timur Madzhidov, Pavel Polishchuk \n*Molecules* **2018**, 23(12), 3094 \nhttps://doi.org/10.3390/molecules23123094\n\n## License\nBSD-3 clause\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/DrrDom/pmapper", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "pmapper", "package_url": "https://pypi.org/project/pmapper/", "platform": "", "project_url": "https://pypi.org/project/pmapper/", "project_urls": { "Homepage": "https://github.com/DrrDom/pmapper" }, "release_url": "https://pypi.org/project/pmapper/0.2/", "requires_dist": [ "networkx (>=1.11) ; extra == 'networkx'", "rdkit (>=2017.09) ; extra == 'rdkit'" ], "requires_python": ">=3.6", "summary": "pmapper: 3D pharmacophore hashes and fingerprints", "version": "0.2" }, "last_serial": 5710110, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "7cd0140700fdf0f92e721e6b0612d9fb", "sha256": "6b0db6e322e18f770c50b0b68060275a77e72cf9ab51c62ca46b6c15a0e6acb9" }, "downloads": -1, "filename": "pmapper-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "7cd0140700fdf0f92e721e6b0612d9fb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 19598, "upload_time": "2019-08-21T14:36:40", "url": "https://files.pythonhosted.org/packages/24/6f/c6e70823f6ee21d2ffde6dcd73ca7e95fde667fea35f81bf38ffc956051d/pmapper-0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6a51e1ee9bbf8ac7b822dd7f35c8f829", "sha256": "5cea7f78507cb7ff56c2885b66b8ba35498059e9319e6b63682a43a2de0f113b" }, "downloads": -1, "filename": "pmapper-0.2.tar.gz", "has_sig": false, "md5_digest": "6a51e1ee9bbf8ac7b822dd7f35c8f829", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 16615, "upload_time": "2019-08-21T14:36:42", "url": "https://files.pythonhosted.org/packages/37/da/50754818be8f4a836a2e97ddf6076b6703ddcd7cf7ba736daa12a176fad0/pmapper-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7cd0140700fdf0f92e721e6b0612d9fb", "sha256": "6b0db6e322e18f770c50b0b68060275a77e72cf9ab51c62ca46b6c15a0e6acb9" }, "downloads": -1, "filename": "pmapper-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "7cd0140700fdf0f92e721e6b0612d9fb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 19598, "upload_time": "2019-08-21T14:36:40", "url": "https://files.pythonhosted.org/packages/24/6f/c6e70823f6ee21d2ffde6dcd73ca7e95fde667fea35f81bf38ffc956051d/pmapper-0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6a51e1ee9bbf8ac7b822dd7f35c8f829", "sha256": "5cea7f78507cb7ff56c2885b66b8ba35498059e9319e6b63682a43a2de0f113b" }, "downloads": -1, "filename": "pmapper-0.2.tar.gz", "has_sig": false, "md5_digest": "6a51e1ee9bbf8ac7b822dd7f35c8f829", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 16615, "upload_time": "2019-08-21T14:36:42", "url": "https://files.pythonhosted.org/packages/37/da/50754818be8f4a836a2e97ddf6076b6703ddcd7cf7ba736daa12a176fad0/pmapper-0.2.tar.gz" } ] }