{"id":15018322,"url":"https://github.com/thomasjewson/molecular3dlengthdescriptors","last_synced_at":"2026-03-07T04:01:26.309Z","repository":{"id":57442815,"uuid":"364976957","full_name":"ThomasJewson/Molecular3DLengthDescriptors","owner":"ThomasJewson","description":"A 3D conformational based molecular descriptor set for use in QSPR and Machine Learning.","archived":false,"fork":false,"pushed_at":"2021-05-07T10:31:38.000Z","size":139,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-14T09:34:01.168Z","etag":null,"topics":["3d","cheminformatics","chemistry","conformer","crystallography","descriptor","learning","machine","molecule","rdkit"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ThomasJewson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-06T16:45:17.000Z","updated_at":"2024-08-09T14:13:24.000Z","dependencies_parsed_at":"2022-09-04T20:22:39.709Z","dependency_job_id":null,"html_url":"https://github.com/ThomasJewson/Molecular3DLengthDescriptors","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/ThomasJewson/Molecular3DLengthDescriptors","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasJewson%2FMolecular3DLengthDescriptors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasJewson%2FMolecular3DLengthDescriptors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasJewson%2FMolecular3DLengthDescriptors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasJewson%2FMolecular3DLengthDescriptors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThomasJewson","download_url":"https://codeload.github.com/ThomasJewson/Molecular3DLengthDescriptors/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasJewson%2FMolecular3DLengthDescriptors/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30207390,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T03:24:23.086Z","status":"ssl_error","status_checked_at":"2026-03-07T03:23:11.444Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3d","cheminformatics","chemistry","conformer","crystallography","descriptor","learning","machine","molecule","rdkit"],"created_at":"2024-09-24T19:51:49.763Z","updated_at":"2026-03-07T04:01:26.254Z","avatar_url":"https://github.com/ThomasJewson.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Molecular3DLengthDescriptors\n\n### Introduction\n\nThe **Molecular3DLengthDescriptors** package can do the following:\n\n1. Calculates the lowest energy 3D conformer of a molecule using RDKit's UFF and MFF94 force fields.\n2. Converts an array of coordinates into a set of lengths: longest, medium and shortest.\n3. Descriptors can be calculated from these lengths.\n\n### Applications\n\nYou can use this tool to do the following:\n\n- Calculate these descriptors for a machine learning project from 2D SMILES input.\n- Calculate these descriptors using crystallogaphic molecular coordinates exported from a database such as the CSD.\n- Calculate these descriptors using coordinates calculated via another method (eg: GROMACS, BALLOON, CONFAB... etc)\n\n### Installation\n\nInstallation of this package requires Python 3+. \n\nYou can install this package two ways...\n\nvia pip:\n\n`pip install Molecular3DLengthDescriptors`\n\n(https://pypi.org/project/Molecular3DLengthDescriptors/)\n\nOr manually, by placing the Molecular3DLengthDescriptors folder within \n\n`~/.local/lib/pythonX.X/site-packages`\n\nThe `rdkit` and `numpy` libraries are dependencies for this package. Install them with the following:\n\n`conda install numpy`\n\nhttps://www.rdkit.org/docs/Install.html\n\n### How Molecular3DLengthDescriptors module works\n\n![png](Molecular3DLengthDescriptors_pictures/HowMolecular3DLengthDescriptorsWorks.png)\n\n1. Import package\n\n\n```python\nimport Molecular3DLengthDescriptors as md\n```\n    \n\n2. Calculate 3D coordinates of 2D molecule\n\nThis code is based off Wicker et al's nConf20 descriptor (10.1021/acs.jcim.6b00565).\n\n```python\nfrom rdkit.Chem import MolFromSmiles\n\nsmiles = \"O=c1cccc(/C=C/c2ccccc2)o1\"\nmol_2D = MolFromSmiles(smiles)\nmol_2D\n```\n\n\n\n\n![png](Molecular3DLengthDescriptors_pictures/Molecule.png)\n\n\n\n\n```python\ncc = md.Lengths.ComputeCoordsFrom2D()\ncoordinates = cc.GetCoords(mol_2D)\ncoordinates\n```\n\n\n\n\n    array([[ 4.19392625, -2.10217421,  1.20758067],\n           [ 3.77614639, -1.12343758,  0.59832016],\n           [ 4.72136167, -0.18159364, -0.02926615],\n           [ 4.27935864,  0.88880918, -0.69605956],\n           [ 2.87057618,  1.13819338, -0.81141094],\n           [ 2.00047091,  0.2903415 , -0.24586024],\n           [ 0.56197146,  0.46799511, -0.31472371],\n           [-0.34101042, -0.35981258,  0.23919665],\n           [-1.81020273, -0.21901879,  0.19470342],\n           [-2.47547343,  0.83154283, -0.45235907],\n           [-3.87295236,  0.9032948 , -0.45516855],\n           [-4.62630912, -0.07414675,  0.18888447],\n           [-3.98359642, -1.12449045,  0.8365183 ],\n           [-2.58741845, -1.19525503,  0.83872962],\n           [ 2.44345336, -0.85157198,  0.4663684 ]])\n\n\n\n3. Calculate the lengths of the 3D molecule\n\nThe covariance of the molecular coordinates is calculated. Then eigenvectors and eigenvalues from the covariance matrix is calculated. The eigenvectors will be aligned in directions of most variance, least variance and right angles to both of those. Therefore, if the square root of the eigenvalues is taken these values will now be back on the same unit scale as the coordinates and hence can be interpreted as the lengths of the molecule. \n\n\n\n\n```python\nlengths = md.Lengths.GetLengthsFromCoords(coordinates)\nlengths\n```\n\n\n\n\n    [0.0001053619852081641, 1.124146300889793, 3.3578154223541476]\n\n\n\n4. Calculate descriptors\n\nYou can calculate individual descriptors:\n\n\n```python\nprint(md.Descriptors.Flatness(lengths))\nprint(md.Descriptors.Cubeularity(lengths))\nprint(md.Descriptors.Plateularity(lengths))\nprint(md.Descriptors.ShortOverLong(lengths))\nprint(md.Descriptors.MediumOverLong(lengths))\n```\n\n    0.0001053619852081641\n    1.0504929488912333e-05\n    35825.784590642164\n    3.1378134875053776e-05\n    0.334785019273531\n    \n\nOr all at once:\n\n\n```python\nmd.Descriptors.CalcAllDesc(lengths)\n```\n\n\n\n\n    {'Flattness': 0.0001053619852081641,\n     'Cubeularity': 1.0504929488912333e-05,\n     'Plateularity': 35825.784590642164,\n     'ShortOverLong': 3.1378134875053776e-05,\n     'MediumOverLong': 0.334785019273531}\n\n\n\n### Explainations of descriptors\n\nTo explain what the descriptors mean, place `help(...)` around the function to output the docstring.\n\n\n```python\nhelp(md.Descriptors.ShortOverLong)\n```\n\n    Help on function ShortOverLong in module Molecular3DLengthDescriptors.Descriptors:\n    \n    ShortOverLong(lengths)\n        A measure of how cubic a molecules is.\n        \n        0 means either a needle or plate shape.\n        1 means perfect cube\n        \n        ShortOverLong = Shortest / Longest\n    \n    \n\n\n```python\nhelp(md.Descriptors.CalcAllDesc)\n```\n\n    Help on function CalcAllDesc in module Molecular3DLengthDescriptors.Descriptors:\n    \n    CalcAllDesc(lengths)\n        Flattness =\u003e Shortest length\n            Measure of how flat a molecules is.\n        \n        Cubularity =\u003e (Shortest*Medium*Longest)/(Longest)**3\n            1 is a perfect cube. \n        \n        Plateularity =\u003e (Medium*Longest)/ Shortest\n            Larger value, more 2D plate-like.\n            \n        ShortOverLong =\u003e Shortest / Longest\n            1 is perfect cube, 0 is needle or plate-like\n            \n        MediumOverLong =\u003e Medium / Longest\n            1 is perfect plate-like shape, 0 is perfect needle shape\n    \n    \n\n### Reference\n\nIf you use this package please feel free to reference us with:\n\nJewson, T., \u0026 Cooper, R. I. (2021). Molecular3DLengthDescriptors (1.0.0). https://github.com/ThomasJewson/Molecular3DLengthDescriptors\n\nOr add this BibTeX entry to your .bib library:\n```\n@misc{Jewson2021,\nauthor = {Jewson, Thomas and Cooper, Richard I.},\ntitle = {{Molecular3DLengthDescriptors}},\nurl = {https://github.com/ThomasJewson/Molecular3DLengthDescriptors},\nyear = {2021}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomasjewson%2Fmolecular3dlengthdescriptors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthomasjewson%2Fmolecular3dlengthdescriptors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomasjewson%2Fmolecular3dlengthdescriptors/lists"}