Skip to content

Commit 8419180

Browse files
authored
Merge branch 'release/v4.0.0' into split-utils
2 parents 0b328cd + 28c8a78 commit 8419180

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

src/moldrug/opt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def pickle(self, title: str, compress: bool = False):
182182
Parameters
183183
----------
184184
title : str
185-
Name of the object which will be completed with the corresponding
185+
Name of the object which will be compleated with the correposnding
186186
extension depending if compress is set to True or False.
187187
compress : bool, optional
188188
Use compression, by default False. If True :meth:`moldrug.compressed_pickle` will be used;

src/moldrug/utils.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,18 @@ def confgen(mol: Chem.rdchem.Mol, return_mol: bool = False, randomseed: Union[in
465465
else:
466466
return pdbqt_string
467467

468+
AllChem.EmbedMolecule(mol, randomSeed=randomSeed)
469+
# The optimization introduce some sort of non-reproducible results.
470+
# For that reason is not used when randomseed is set
471+
if not randomseed:
472+
AllChem.MMFFOptimizeMolecule(mol, maxIters=500)
473+
preparator = MoleculePreparation()
474+
mol_setups = preparator.prepare(mol)
475+
pdbqt_string = PDBQTWriterLegacy.write_string(mol_setups[0])[0]
476+
if return_mol:
477+
return (pdbqt_string, mol)
478+
else:
479+
return pdbqt_string
468480

469481
def update_reactant_zone(parent: Chem.rdchem.Mol, offspring: Chem.rdchem.Mol,
470482
parent_replace_ids: List[int] = None, parent_protected_ids: List[int] = None):

0 commit comments

Comments
 (0)