Skip to content
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

Open
steinmig opened this issue May 28, 2023 · 4 comments
Open

Propyl radical gives empty list of molecules #38

steinmig opened this issue May 28, 2023 · 4 comments

Comments

@steinmig
Copy link

I tried various options, but all of them returned an empty list for the propyl radical.

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
@steinmig
Copy link
Author

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?

@nbehrnd
Copy link

nbehrnd commented May 28, 2023

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 -h already includes the option to process radicals.

@steinmig
Copy link
Author

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?

xyz2mol h2o.xyz does not give me any output.

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

@nbehrnd
Copy link

nbehrnd commented May 28, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants