Dear Paolo,
Thank you very much. It was very helpful.
I get atom idx of the corresponding structure in each molecule successful!
But there is another problem.

When I used:

a = mols[0].GetSubstructMatch(generic)
b = mols[1].GetSubstructMatch(generic)
AllChem.GetBestRMS(mols[0],mols[1],map=list(zip(a,b)))

The AllChem.GetBestRMS arise a ValueError:

---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-74-fd80273b39cc> in <module>
1 a = mols[0].GetSubstructMatch(generic)
2 b = mols[1].GetSubstructMatch(generic)
----> 3 AllChem.GetBestRMS(mols[0],mols[1],map=list(zip(a,b)))

ValueError: sequence does not support length query

Is its usage different from the atomMap parameter in Chem. rdMolAlign.AlignMol?

Best Regards,
M.

At 2019-07-26 01:07:13, "Paolo Tosco" <paolo.tosco.m...@gmail.com> wrote:


Dear Masgils,

you may try something along these lines, i.e. make atoms and/or bonds generic 
on one of the molecules withrdmolops.AdjustQueryProperties() in order to get 
subtructures to match, and then use rdMolAlign.GetBestRMS():


piperidine=Chem.AddHs(Chem.MolFromSmiles("C1CC(C)CCN1"))AllChem.EmbedMolecule(piperidine)AllChem.MMFFOptimizeMolecule(piperidine)piperidine_noh=Chem.RemoveHs(piperidine)
piperazine=Chem.AddHs(Chem.MolFromSmiles("C1CN(C)CCN1"))AllChem.EmbedMolecule(piperazine)AllChem.MMFFOptimizeMolecule(piperazine)piperazine_noh=Chem.RemoveHs(piperazine)
piperidine_noh
piperazine_noh
piperidine_noh.GetSubstructMatches(piperazine_noh)
()
params=AllChem.AdjustQueryParameters()
params.makeAtomsGeneric=True
params.makeBondsGeneric=True
piperazine_noh_generic=AllChem.AdjustQueryProperties(piperazine_noh,params)
piperazine_noh_generic
piperidine_noh.GetSubstructMatches(piperazine_noh_generic)
((0, 1, 2, 3, 4, 5, 6),)
AllChem.GetBestRMS(piperazine_noh_generic,piperidine_noh)
0.39432427325884206


Hope this helps, cheers
p.


On 07/25/19 16:53, Masgils wrote:

Hi, all

Is it possible use GetSubstructMatches() to match a substructure with one or 
two atom different from ref_mol? (eg. a Piperidine ring and a Piperazing ring)

And how to get the RMSD between corresponding atoms of two substructures?





_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.nethttps://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