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

Random structure generation fails if no ligand is specified #247

Open
fredauski opened this issue Jul 10, 2024 · 3 comments
Open

Random structure generation fails if no ligand is specified #247

fredauski opened this issue Jul 10, 2024 · 3 comments
Assignees

Comments

@fredauski
Copy link

Dear all,

I'm running into a problem trying to recreate the generation of random structures as shown in Fig. 19 in the User's Manual (v1.0).

Here's the input file fig19.in (copied from Fig. 19):

-coord 6
-ligalign 1
-rundir runs_fig19/
-spin 1
-ligctg build
-rgen 10
-distort 0
-lignum 4
-core Fe
-liggrp all
-geometry oct
-rkHs yes
-oxstate 0

and here the Traceback after running molsimplify -i fig19.in:

TensorFlow connection successful
Input file detected, reading arguments from input file
molSimplify is starting!

************************************************************
******** Welcome to molSimplify! Let's get started. ********
************************************************************


The directory for  this calculation is: runs_fig19/
Checking input...
WARNING: No ligand numbers specified. Defaulting to 6 of the first ligand and 0 of all others.
Traceback (most recent call last):
  File "/Users/user/.pyenv/versions/molSimplify/bin/molsimplify", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/user/.pyenv/versions/3.12.4/envs/molSimplify/lib/python3.12/site-packages/molSimplify/__main__.py", line 184, in main
    startgen(sys.argv, False, gui)
  File "/Users/user/.pyenv/versions/3.12.4/envs/molSimplify/lib/python3.12/site-packages/molSimplify/Scripts/generator.py", line 170, in startgen
    emsg = checkinput(args)
           ^^^^^^^^^^^^^^^^
  File "/Users/user/.pyenv/versions/3.12.4/envs/molSimplify/lib/python3.12/site-packages/molSimplify/Scripts/inparse.py", line 164, in checkinput
    for lig in args.lig[1:]:
               ~~~~~~~~^^^^
TypeError: 'NoneType' object is not subscriptable

The input from Fig. 17 works like a charm.

Is there still a way of generating structures with all random ligands?

@dbkchu
Copy link
Member

dbkchu commented Jul 10, 2024

Hi @fredauski,

Please refer to the tutorials on our website rather than the manual (which is very outdated). Random structure generation is not tested and may not work well (see issue #179)... We will try to restore this functionality, but I am not sure when we will get to it.

If you would like to use random ligands right now, you would likely need to use molSimplify in a Python script and randomly select ligands outside the calls to molSimplify.

@gianmarco-terrones
Copy link
Contributor

Piggybacking off of this, you can add custom ligands for use by adding XYZ or MOL files to the molSimplify/Ligands folder, and adding lines to the ligands.dict file.

Also, an alternative to using the command line for molSimplify structure generation is startgen_pythonic, in case that is useful. For example:

from molSimplify.Scripts.generator import startgen_pythonic

input_dict = {
'-core': 'ir',
'-lig': f'{some_bidentate_ligand} {another_bidentate_ligand}',
'-ligocc': '2 1',
'-oxstate': '3',
'-geometry': 'oct',
'-coord': '6',
'-spin': '1',
}

startgen_pythonic(input_dict=input_dict, write=True)

@fredauski
Copy link
Author

Thank you all for the tips, I will implement what I need in Python with the startgen_pythonic function.

Feel free to close this issue if it is of no further relevance to you guys!

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

4 participants