Dear Jose,
you need to AlignMol your conformers onto the original coordinates of
your constrained core using the mapped atoms as superimposition points.
In fact, the internal coordinates of the constrained core are preserved,
but the Cartesian coordinates may be different. An AlignMol() operation
should give you what you are looking for.
Cheers,
p.
On 11/14/18 21:37, Jose A. wrote:
Dear RDKitters,
I am writing a code to generate conformers of a given molecule
constraining some atoms to occupy fixed positions with the coordMap
option. However, the coordMap option does not see to work, as in the
conformers generated the constraint atoms are at very different
positions in each conformer. I use the following code:
def gen_confs(mol, fixed_atoms =None, atomic_positions =None):
num_confs = 50
print("%i initial configurations tried for the conformer search" %
num_confs)
ps = AllChem.ETKDG()
ps.pruneRmsThersh =0.1 # Disabling pruning by RMS, very little distorted geometries # wrt
the first conformer are discarded ps.numThreads =0 if fixed_atomsis None:
AllChem.EmbedMultipleConfs(m, num_confs, ps)
else:
coord_dict =dict()
for idxin fixed_atoms:
atom = idx -1 coord_dict[atom] = atomic_positions[atom]
ps.coordMap = coord_dict
print("Fixing coordinates of atoms:", coord_dict)
AllChem.EmbedMultipleConfs(m, num_confs, ps)
def cluster_confs(mol, rms):
dm = AllChem.GetConformerRMSMatrix(mol)
rms_clusters = Butina.ClusterData(dm, mol.GetNumConformers(), rms,\
isDistData =True, reordering =True)
clustered_mol = Chem.Mol(mol)
clustered_mol.RemoveAllConformers()
centroid_ids =list()
for clusterin rms_clusters:
centroid_ids.append(cluster[0])
cidx =0 for idxin centroid_ids:
clustered_mol.AddConformer(mol.GetConformer(idx))
Chem.Conformer.SetId(clustered_mol.GetConformer(idx), cidx)
cidx +=1 print('{:d} distinct conformers
generated'.format(clustered_mol.GetNumConformers()))
return clustered_mol
smi ="CC(=O)Oc1c(C(=O)O)cccc1" fixed_atoms = [4, 8]
atomic_positions = [[0.9348789, 0.03381682, -0.838997], [-2.0378193,
2.60057272, 0.27807491]]
gen_confs(m, fixed_atoms = fixed_atoms, atomic_positions = atomic_positions)
rms_cluster =1. clustered_mol = cluster_confs(m, rms_cluster)
Is there something wrong with the code? Any suggestion is really
appreciated.
Thanks a lot.
--
José
_______________________________________________
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