-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Propyl radical gives empty list of molecules #38
Comments
As I now checked other molecules from my dataset, I noticed that I have the same behavior for all radicals. Is there no solution for those? |
With Python 3.11.2 (as provided by Linux Debian 12/bookworm), I created a virtual environment $ python3 -m virtualenv sup
$ source sup/bin/activate
$ pip install -r requirements.txt
$ pip install rdkit
$ cat example.xyz
8
C -0.3027758391 0.5794019014 1.0345046298
C 0.0425157439 -0.4399390123 0.1832077568
C 0.2724509312 -0.2796867185 -1.1600106986
H -0.4707683461 0.4079216362 2.0816470556
H -0.4162158143 1.5863557406 0.6730322879
H 0.1401386036 -1.4356735654 0.5989624308
H 0.5435628550 -1.1069559010 -1.7895205051
H 0.1910918658 0.6885759191 -1.6218229572
$
$ python xyz2mol.py example.xyz --no-charged-fragments
[CH2]C=C
$
$ python xyz2mol.py example.xyz --no-charged-fragments -o sdf
RDKit 3D
8 7 0 0 0 0 0 0 0 0999 V2000
-0.3028 0.5794 1.0345 C 0 0 0 0 0 3 0 0 0 0 0 0
0.0425 -0.4399 0.1832 C 0 0 0 0 0 0 0 0 0 0 0 0
0.2725 -0.2797 -1.1600 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.4708 0.4079 2.0816 H 0 0 0 0 0 0 0 0 0 0 0 0
-0.4162 1.5864 0.6730 H 0 0 0 0 0 0 0 0 0 0 0 0
0.1401 -1.4357 0.5990 H 0 0 0 0 0 0 0 0 0 0 0 0
0.5436 -1.1070 -1.7895 H 0 0 0 0 0 0 0 0 0 0 0 0
0.1911 0.6886 -1.6218 H 0 0 0 0 0 0 0 0 0 0 0 0
1 2 1 0
1 4 1 0
1 5 1 0
2 3 2 0
2 6 1 0
3 7 1 0
3 8 1 0
M RAD 1 1 2
M END
$ The set of files I used is an old one, fetched by 2022-07-21. But running the script with |
Ah great, thanks! I never tried this option in my script, because I got lazy and tried some options only on the command line, but turns out that your cli entry point is broken?
The installed cli entry point is import re
import sys
from xyz2mol import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
print(sys.argv)
sys.exit(main()) but the main function is simply def main():
return |
So far, I used the script only in its own virtual environment, activated only
if this script is needed. My reasoning for this and against a system-wide
installation is `xyz2mol` relies on functionality beyond Python's standard
library. I wasn't aware (yet) that the functionality eventually was added to
RDKit, a note added to `README.md` about two weeks ago; I still want to use
the script as such "alone", no intent (so far) to import it into other scripts.
I'm not surprised the simple input
```shell
xyz2mol h2o.xyz
```
does not provide a useful result. Still in the active virtual environment (in
Linux Debian), I had to add the missing shebang (`#!/usr/bin/env python3`) on
top and the executable bit (`chmod +x ./xyz2mol.py`). You do not indicate the
operating system accessible to you, the hint to the interpreter's location for
pure Windows (no WSL), or MacOS might differ here.
|
I tried various options, but all of them returned an empty list for the propyl radical.
The text was updated successfully, but these errors were encountered: