Hi Gustavo,

that's because a2.pdb has formal charges whereas a1.pdb has none. If you neutralize a2 then you'll find a match. You could use |Chem.MolStandardize.rdMolStandardize.||Uncharger| or something as below:

from rdkit import Chem

a1 = Chem.MolFromPDBFile("a1.pdb")
a2 = Chem.MolFromPDBFile("a2.pdb")

for a in a2.GetAtoms():
    if a.GetFormalCharge():
        a.SetFormalCharge(0)
Chem.SanitizeMol(a2)

print(a1.GetSubstructMatch(a2))

(7, 11, 13, 15, 3, 4, 17, 19, 25, 0, 23, 22, 10, 12, 14, 16, 9, 6, 26, 18, 5, 
8, 20, 1, 21, 24, 2)

HTH, cheers
p.

On 04/04/2020 18:54, Gustavo Seabra wrote:
HI all,

I'm trying to use get the substructure matches between two different PDB
files with the same molecule, but different atom order and naming. However,
GetSubstructMatches Just returns nothing, i.e. no matches (files attached):

For example:
ref_mol = Chem.MolFromPDBFile(str("a1.pdb"))
tgt_mol = Chem.MolFromPDBFile(str("a2.pdb"))
ref_mol.GetNumAtoms(),tgt_mol.GetNumAtoms()
(27, 27)

ref_mol.GetSubstructMatches(tgt_mol)
()

ref_mol.HasSubstructMatch(tgt_mol)
False

Could anyone here suggest a different way to get the atom mapping between
the two molecules?

Thanks a lot,
--
Gustavo Seabra



_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to