Skip to content

Commit

Permalink
v1.3.2, more reliable conf gen for large mols with random coords
Browse files Browse the repository at this point in the history
  • Loading branch information
beef-broccoli committed Aug 18, 2023
1 parent 99d791d commit f41188d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
/build/
/db_access/
/dist/
/.ipynb_checkpoints/
/.ipynb_checkpoints/
6 changes: 3 additions & 3 deletions autoqchem/molecule.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
class molecule(object):
"""Wrapper class for molecule"""

def __init__(self, smiles, num_conf=5, engine='rdkit', rdkit_ff='MMFF94', ob_gen3D_option='best') -> None:
def __init__(self, smiles, num_conf=5, engine='rdkit', rdkit_ff='MMFF94', ob_gen3D_option='best', large_mol=False) -> None:
"""Initialize the molecule with a conformational ensemble
:arg smiles: SMILES string
Expand All @@ -43,8 +43,8 @@ def __init__(self, smiles, num_conf=5, engine='rdkit', rdkit_ff='MMFF94', ob_gen
self.elements, \
self.conformer_coordinates, \
self.connectivity_matrix, \
self.charges = generate_conformations_from_rdkit(smiles=smiles, num_conf=num_conf,
rdkit_ff=rdkit_ff)
self.charges = generate_conformations_from_rdkit(smiles=smiles, num_conf=num_conf, rdkit_ff=rdkit_ff, large_mol=large_mol)

elif engine == 'openbabel':
self.elements, \
self.conformer_coordinates, \
Expand Down
4 changes: 3 additions & 1 deletion autoqchem/rdkit_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def add_conformers_to_rdmol(mol: Chem.Mol, conformer_coordinates: np.ndarray) ->
mol.AddConformer(conformer, assignId=True)


def generate_conformations_from_rdkit(smiles, num_conf, rdkit_ff='MMFF94') -> tuple:
def generate_conformations_from_rdkit(smiles, num_conf, rdkit_ff, large_mol) -> tuple:
"""Generate conformational ensemble using rdkit
:param smiles: SMILES string
Expand All @@ -131,6 +131,8 @@ def generate_conformations_from_rdkit(smiles, num_conf, rdkit_ff='MMFF94') -> tu
params.ETversion = 2
params.pruneRmsThresh = 0.35
params.numThreads = n_threads
if large_mol:
params.useRandomCoords = True

# embed and optimized conformers
AllChem.EmbedMultipleConfs(rdmol, num_conf, params)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='auto-qchem',
version='1.3.1',
version='1.3.2',
packages=['autoqchem'],
data_files=['config.yml'],
url='https://github.com/doyle-lab-ucla/auto-qchem',
Expand Down

0 comments on commit f41188d

Please sign in to comment.