61b518a2a177dbcd193d96a6f87797afaea0fc5d,rdkit_fixer.py,,AddMissingAtoms,#,364

Before Change


    // TODO: add backbone peptide bonds, if they were missing
    // TODO: try to better guess the types of atoms (if possible)

    try:
        fixed_residue = ConstrainedEmbed(template, residue)
    except ValueError as e:
        residue2 = SimplifyMol(Chem.Mol(residue))
        template2 = SimplifyMol(Chem.Mol(template))
        fixed_residue = ConstrainedEmbed(template2, residue2)
    assert fixed_residue is not None
    matched_atoms = fixed_residue.__sssAtoms
    assert len(matched_atoms) > 0

After Change


    // TODO: add backbone peptide bonds, if they were missing
    // TODO: try to better guess the types of atoms (if possible)

    matched_atoms = template.GetSubstructMatch(residue)
    if matched_atoms:  // instead of catching ValueError
        fixed_residue = ConstrainedEmbed(template, residue)
    else:
        residue2 = SimplifyMol(Chem.Mol(residue))
        template2 = SimplifyMol(Chem.Mol(template))
        matched_atoms = template2.GetSubstructMatch(residue2)
        if matched_atoms:
            fixed_residue = ConstrainedEmbed(template2, residue2)
        else:
            raise ValueError("No matching found at missing atom stage.",
                             template.GetProp("_Name"),
                             Chem.MolToSmiles(template),
                             Chem.MolToSmiles(residue),
                             )

    new_amap = []
    for i in range(fixed_residue.GetNumAtoms()):
        if i not in matched_atoms:
            atom = fixed_residue.GetAtomWithIdx(i)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: oddt/oddt
Commit Name: 61b518a2a177dbcd193d96a6f87797afaea0fc5d
Time: 2018-05-17
Author: maciek@wojcikowski.pl
File Name: rdkit_fixer.py
Class Name:
Method Name: AddMissingAtoms


Project Name: oddt/oddt
Commit Name: 61b518a2a177dbcd193d96a6f87797afaea0fc5d
Time: 2018-05-17
Author: maciek@wojcikowski.pl
File Name: rdkit_fixer.py
Class Name:
Method Name: AddMissingAtoms


Project Name: onnx/onnxmltools
Commit Name: 8ae70fc5866ac29542aa1681c712f4a6ff5dec88
Time: 2019-02-19
Author: vinitras@gmail.com
File Name: onnxmltools/utils/main.py
Class Name:
Method Name: save_model


Project Name: onnx/onnxmltools
Commit Name: 8ae70fc5866ac29542aa1681c712f4a6ff5dec88
Time: 2019-02-19
Author: vinitras@gmail.com
File Name: onnxmltools/utils/main.py
Class Name:
Method Name: save_text