{"id":20296954,"url":"https://github.com/nbehrnd/xyz2mol_b","last_synced_at":"2026-04-20T06:10:46.038Z","repository":{"id":187237417,"uuid":"676548509","full_name":"nbehrnd/xyz2mol_b","owner":"nbehrnd","description":"based on a structure provided as .xyz file, attempt the generation of a .sdf block","archived":false,"fork":false,"pushed_at":"2025-05-02T07:52:59.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-02T08:42:15.605Z","etag":null,"topics":["computational-chemistry","conversion","rdkit","sdf","structure","xyz"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nbehrnd.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-08-09T13:03:06.000Z","updated_at":"2025-05-02T07:44:26.000Z","dependencies_parsed_at":"2024-11-14T15:43:21.327Z","dependency_job_id":"5f2a6446-506d-4f58-902b-b0cecc2cc415","html_url":"https://github.com/nbehrnd/xyz2mol_b","commit_stats":null,"previous_names":["nbehrnd/xyz2mol_b"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/nbehrnd/xyz2mol_b","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbehrnd%2Fxyz2mol_b","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbehrnd%2Fxyz2mol_b/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbehrnd%2Fxyz2mol_b/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbehrnd%2Fxyz2mol_b/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nbehrnd","download_url":"https://codeload.github.com/nbehrnd/xyz2mol_b/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbehrnd%2Fxyz2mol_b/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32035294,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["computational-chemistry","conversion","rdkit","sdf","structure","xyz"],"created_at":"2024-11-14T15:42:18.698Z","updated_at":"2026-04-20T06:10:46.033Z","avatar_url":"https://github.com/nbehrnd.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://github.com/psf/black\"\u003e\u003cimg alt=\"Code style: black\" src=\"https://img.shields.io/badge/code%20style-black-000000.svg\"\u003e\u003c/a\u003e\n\n# background\n\nBased on an algorithm by Kim and Kim[^1], Jan Jensen implemented\nxyz2mol[^2] relying on RDKit to convert .xyz files into .sdf including\nassignment of bond orders different than one. As presented in 2020\n([recording](https://www.youtube.com/watch?v=HD6IpXMVKeo), [pdf\nslides](https://github.com/rdkit/UGM_2020/blob/master/Presentations/JanJensen.pdf)),\nthe approach works best on small molecules which do not carry\norganometallic bonds. With release of RDKit 2022.09.3, this\nfunctionality became available in RDKit,[^3] and was presented in Greg\nLandrum's blog,[^4] too.\n\nThis repository provides a moderator script to provide this\nfunctionality until RDKit as packaged by DebiChem (for Debian, Ubuntu,\netc) would catch up (cf. notes in repology[^5]) however can be \"handy\"\nfor a rapid conversion if one forgot the required syntax in RDKit.\n\nIf you get a copy by cloning / downloading a .zip archive from GitHub,\nresolve the dependencies with\n\n``` shell\npip -r install requirements.txt\n```\n\nFor an easier systemwide deployment, the [release\npage](https://github.com/nbehrnd/xyz2mol_b/releases) provides a platform\nindependent Python wheel which in turn resolves dependencies like RDKit\nand numpy from the PyPI.\n\n# intended use\n\nBy default, the submitted structure in the input .xyz file is presumed\nto be balanced and overall neutral (see for instance `ethane.xyz` in\nsubfolder `tests`). Call e.g.,\n\n``` shell\n$ cat ethane.xyz \n8\ncharge 0, ethane\nC         -4.58735        0.92696        0.00000\nC         -3.11050        0.92696        0.00000\nH         -4.93786        1.78883        0.58064\nH         -4.93786       -0.00682        0.45608\nH         -4.93786        0.99888       -1.03672\nH         -2.75999        0.85505        1.03672\nH         -2.75998        1.86075       -0.45608\nH         -2.75998        0.06509       -0.58064\n$ xyz2mol_b ethane.xyz\n\n     RDKit          3D\n\n  8  7  0  0  0  0  0  0  0  0999 V2000\n   -4.5873    0.9270    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n   -3.1105    0.9270    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n   -4.9379    1.7888    0.5806 H   0  0  0  0  0  0  0  0  0  0  0  0\n   -4.9379   -0.0068    0.4561 H   0  0  0  0  0  0  0  0  0  0  0  0\n   -4.9379    0.9989   -1.0367 H   0  0  0  0  0  0  0  0  0  0  0  0\n   -2.7600    0.8550    1.0367 H   0  0  0  0  0  0  0  0  0  0  0  0\n   -2.7600    1.8607   -0.4561 H   0  0  0  0  0  0  0  0  0  0  0  0\n   -2.7600    0.0651   -0.5806 H   0  0  0  0  0  0  0  0  0  0  0  0\n  2  1  1  0\n  3  1  1  0\n  4  1  1  0\n  5  1  1  0\n  6  2  1  0\n  7  2  1  0\n  8  2  1  0\nM  END\n\n```\n\nwhich can be redirected into a permanent record. For input structures\nlike the acetate anion (file `acetate.xyz`, again sub folder `tests`),\nor the tetramethylammonium cation (file `NMe4_cation.xyz`, a successful\nconversion requires a user assigned overall charge indicated by either\nflag `--charge` (or `-c`). This can be combined freely with the optional\nflag `--x3` to report the structure in the syntax of sdf (V3000)\n\n``` shell\n$ xyz2mol_b acetate.xyz -c -1\n\n     RDKit          3D\n\n  7  6  0  0  0  0  0  0  0  0999 V2000\n   -4.7169    0.8992    0.0571 C   0  0  0  0  0  0  0  0  0  0  0  0\n   -3.2490    0.9840   -0.2283 C   0  0  0  0  0  0  0  0  0  0  0  0\n   -5.0417    1.7438    0.6786 H   0  0  0  0  0  0  0  0  0  0  0  0\n   -5.0171   -0.0221    0.5634 H   0  0  0  0  0  0  0  0  0  0  0  0\n   -5.2108    0.9687   -0.9121 H   0  0  0  0  0  0  0  0  0  0  0  0\n   -2.6591    2.0570   -0.3402 O   0  0  0  0  0  0  0  0  0  0  0  0\n   -2.6341   -0.1870   -0.4868 O   0  0  0  0  0  0  0  0  0  0  0  0\n  2  1  1  0\n  3  1  1  0\n  4  1  1  0\n  5  1  1  0\n  6  2  2  0\n  7  2  1  0\nM  CHG  1   7  -1\nM  END\n\n```\n\nand\n\n``` shell\n$ xyz2mol_b NMe4_cation.xyz -c 1 --x3\n\n     RDKit          3D\n\n  0  0  0  0  0  0  0  0  0  0999 V3000\nM  V30 BEGIN CTAB\nM  V30 COUNTS 17 16 0 0 0\nM  V30 BEGIN ATOM\nM  V30 1 N 1.068110 0.072580 0.009700 0 CHG=1\nM  V30 2 C 0.562820 -1.304500 0.392100 0\nM  V30 3 C 0.562820 1.092290 1.011060 0\nM  V30 4 C 0.562800 0.429910 -1.374090 0\nM  V30 5 C 2.583990 0.072570 0.009700 0\nM  V30 6 H 0.937390 -1.544150 1.392220 0\nM  V30 7 H -0.531490 -1.284440 0.386550 0\nM  V30 8 H 0.937390 -2.025520 -0.341190 0\nM  V30 9 H 0.937400 2.078230 0.718560 0\nM  V30 10 H -0.531490 1.077450 0.996480 0\nM  V30 11 H 0.937390 0.817740 2.002150 0\nM  V30 12 H 0.937410 1.425510 -1.631870 0\nM  V30 13 H 0.937400 -0.316360 -2.081690 0\nM  V30 14 H -0.531470 0.424720 -1.353950 0\nM  V30 15 H 2.929140 -0.187130 1.015360 0\nM  V30 16 H 2.929140 -0.668510 -0.718050 0\nM  V30 17 H 2.929140 1.073360 -0.268230 0\nM  V30 END ATOM\nM  V30 BEGIN BOND\nM  V30 1 1 2 1\nM  V30 2 1 3 1\nM  V30 3 1 4 1\nM  V30 4 1 5 1\nM  V30 5 1 6 2\nM  V30 6 1 7 2\nM  V30 7 1 8 2\nM  V30 8 1 9 3\nM  V30 9 1 10 3\nM  V30 10 1 11 3\nM  V30 11 1 12 4\nM  V30 12 1 13 4\nM  V30 13 1 14 4\nM  V30 14 1 15 5\nM  V30 15 1 16 5\nM  V30 16 1 17 5\nM  V30 END BOND\nM  V30 END CTAB\nM  END\n\n```\n\nNote the context of the structures you submit. As one can check with\nfile `C9H11.xyz` in the `tests` subfolder, one input file can lead to\nboth a .sdf file of a cation (`--charge 1`), and anion (`-c\n  -1`).[^6]\n\n[^1]: Kim, Y and Kim, W. Y. Universal Structure Conversion Method for\n    Organic Molecules: From Atomic Connectivity to Three-Dimensional\n    Geometry. *Bull. Korean Chem. Soc.* **2015**, *36*, 1769-1777, [doi\n    10.1002/bkcs.10334](https://doi.org/10.1002/bkcs.10334).\n\n[^2]: \u003chttps://github.com/jensengroup/xyz2mol\u003e\n\n[^3]: \u003chttps://github.com/jensengroup/xyz2mol/issues/40\u003e\n\n[^4]: \u003chttps://greglandrum.github.io/rdkit-blog/posts/2022-12-18-introducing-rdDetermineBonds.html\u003e\n\n[^5]: \u003chttps://repology.org/project/rdkit/packages\u003e\n\n[^6]: The same Hill formula equally applies to the neutral\n    2-phenyl-2-propyl radical, PubChem [CID\n    140141](https://pubchem.ncbi.nlm.nih.gov/compound/140141).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnbehrnd%2Fxyz2mol_b","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnbehrnd%2Fxyz2mol_b","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnbehrnd%2Fxyz2mol_b/lists"}