42038c294a32f708b41255a7f29164e5d094eeba,deepchem/utils/rdkit_util.py,,add_hydrogens_to_mol,#Any#,34

Before Change


def add_hydrogens_to_mol(mol):
  molecule_file = None
  try:
    molecule_file = str(tempfile.NamedTemporaryFile().name)
    Chem.MolToPDBFile(mol, molecule_file)
    fixer = PDBFixer(filename=molecule_file)
    fixer.addMissingHydrogens(7.4)
    PDBFile.writeFile(fixer.topology, fixer.positions, open(molecule_file, "w"))

After Change


    fixer = PDBFixer(pdbfile=pdb_stringio)
    fixer.addMissingHydrogens(7.4)

    hydrogenated_io = StringIO()
    PDBFile.writeFile(fixer.topology, fixer.positions, hydrogenated_io)
    hydrogenated_io.seek(0)
    return Chem.MolFromPDBBlock(
        hydrogenated_io.read(), sanitize=False, removeHs=False)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: deepchem/deepchem
Commit Name: 42038c294a32f708b41255a7f29164e5d094eeba
Time: 2017-03-06
Author: lilleswing@gmail.com
File Name: deepchem/utils/rdkit_util.py
Class Name:
Method Name: add_hydrogens_to_mol


Project Name: idaholab/raven
Commit Name: 8ad7ca870d68695fd47d9962e565a1e0f7f73f8c
Time: 2021-01-25
Author: paul.talbot@inl.gov
File Name: framework/Models/EnsembleModel.py
Class Name: EnsembleModel
Method Name: __advanceModel


Project Name: Theano/Theano
Commit Name: cd6f4ef94f6adca1bf84795e74d96f80f532363e
Time: 2017-04-13
Author: nouiz@nouiz.org
File Name: theano/gof/fg.py
Class Name: FunctionGraph
Method Name: replace