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

Error with creating generators with initial geometries #29

Open
rdguha1995 opened this issue Feb 29, 2024 · 0 comments
Open

Error with creating generators with initial geometries #29

rdguha1995 opened this issue Feb 29, 2024 · 0 comments

Comments

@rdguha1995
Copy link
Contributor

@orionarcher . As discussed 1-on-1, there are some issues with creating the generators when initial geometries are provided. This is the stacktrace for a simple benzene molecule.

File /global/u2/r/rdguha/.conda/envs/op_mm/code/pymatgen-io-openmm/pymatgen/io/openmm/utils.py:517, in add_conformers(openff_mol, geometries, max_conformers)
    515 is_isomorphic, atom_map = get_atom_map(inferred_mol, openff_mol)
    516 if not is_isomorphic:
--> 517     raise ValueError(
    518         f"An isomorphism cannot be found between smile {openff_mol.to_smiles()} "
    519         f"and the provided geometry {geometry.xyz}."
    520     )
    521 new_mol = pymatgen.core.Molecule.from_sites(
    522     [geometry.xyz.sites[i] for i in atom_map.values()]
    523 )
    524 openff_mol.add_conformer(new_mol.cart_coords * angstrom)

ValueError: An isomorphism cannot be found between smile [H][c]1[c]([H])[c]([H])[c]([H])[c]([H])[c]1[H] and the provided geometry Full Formula (H6 C6)
Reduced Formula: HC
Charge = 0, Spin Mult = 1
Sites (12)
0 C    -3.115850     0.207740     1.067370
1 C    -2.005660     1.051040     1.067370
2 C    -0.720240     0.511230     1.067370
3 C    -0.545020    -0.871880     1.067370
4 C    -1.655210    -1.715180     1.067370
5 C    -2.940630    -1.175370     1.067370
6 H    -2.142310     2.129710     1.067370
7 H     0.145590     1.168910     1.067370
8 H    -3.806460    -1.833050     1.067370
9 H    -4.118340     0.628730     1.067370
10 H     0.457470    -1.292870     1.067370
11 H    -1.518560    -2.793850     1.067370

If the generator is called without the geometry like so:-

dry_benzene = [
    {
        "smile": 'c1ccccc1',
        "count": 1,
        "name": "benzene",
    },
]
i=0
input_set = openmm_generator.get_input_set(dry_benzene, density = 0.00001)
input_set.write_input(f"input_benzene_{i+1}")

It works

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

1 participant