Skip to content

Persistent Conformer Generation Issue in psiresp.Molecule.from_rdkit() #108

Open
@n-kristovskiy

Description

@n-kristovskiy

Dear Lily Wang,

I'm developing a molecule parameterization protocol using psiresp and have encountered a persistent issue with conformer generation when using Molecule.from_rdkit().

Problem Description
After initially using the minimize='mmff94' flag in Molecule.from_rdkit(), the conformer generation now consistently produces only 1 conformer regardless of specified parameters. This behavior persists despite:

Removing all conformers after molecule creation (RESP_mol.conformers.clear())

  1. Reverting minimize to None
  2. Trying different environments
  3. Various parameter combinations
  4. Complete Reproduction Code

Complete Reproduction Code


trimers_smi = {'GKcrG': '[H]N([H])C([H])([H])C(=O)N([H])[C@@]([H])(C(=O)N([H])C([H])([H])C([H])=O)C([H])([H])C([H])([H])C([H])([H])C([H])([H])N([H])C(=O)C(\\[H])=C(/[H])C([H])([H])[H]'}
trimers_chem = {'GKcrG': Chem.MolFromSmiles(trimers_smi, sanitize)}
constraint_dict = {
    'GKcrG': {
        'symmetric_list': [],
        'charge_atom_dict': {4:-0.34790, 26:0.27470, 5:-0.24000, 6:0.73410, 7:-0.58940, 27:0.14260},
        'charge_of_monomer': 0.0000,
    }
}

param_mol_name = 'GKcrG'
psiresp_dict = {}

# Problematic molecule creation
RESP_mol = psiresp.Molecule.from_rdkit(
    trimers_chem[param_mol_name],
    optimize_geometry=True,
    charge=0,
    conformer_generation_options={
        'n_conformer_pool': 10000,
        'n_max_conformers': 10,
        'energy_window': 150,
        'keep_original_conformer': False,
        'minimize': 'mmff94'  # Initially caused the issue
    }
)

# Attempted solutions that didn't work:
# RESP_mol.conformers.clear()
# minimize=None in conformer_generation_options

psiresp_dict[param_mol_name] = RESP_mol

# Constraints setup (works normally)
constraints = psiresp.ChargeConstraintOptions(symmetric_atoms_are_equivalent=False)
constraints = pt.add_constraint(
    RESP_mol,
    constraint_dict[param_mol_name]['symmetric_list'],
    constraint_dict[param_mol_name]['charge_atom_dict'],
    constraint_dict[param_mol_name]['charge_of_monomer'],
    constraints=constraints
)

# Execution
folder_name = 'psiresp_data/'
path_folder = f'{folder_name}/{str(*psiresp_dict.keys())}'
name_of_system = pt.get_unique_folder_name(path_folder)
print(f'The psiresp data will be recorded at: {name_of_system}')
pt.show_list_of_conf(f'{name_of_system}/optimization/', True) 
# checks the number of files in the optimization folder with the msgpack extension.

Observed Behavior

Output always shows only 1 conformer being generated:

generate-conformers: 100%|██████████| 1/1 [00:00<00:00, 12710.01it/s]
SystemExit: Exiting to allow running QM computations; commands are in .../run_optimization.sh
Number of conformers: 1

Key Observations

  1. Works normally with Molecule.from_smiles()
  2. Requires from_rdkit() due to stereochemistry handling
  3. Problem persists even after:
  • Environment recreation
  • Removing all conformers
  • Resetting minimization options

Could this be related to some internal state being preserved? Any insight would be greatly appreciated.

Best regards,
Nick

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions