I don’t know if this is the issue but Are the order of atoms the same between the pdb file and the smiles string?
--- Sent from Workspace ONE Boxer<https://whatisworkspaceone.com/boxer> On July 16, 2022 at 8:14:51 PM PDT, He, Amy <he.1...@buckeyemail.osu.edu> wrote: Dear RDKit experts, I am new to RDKit and I have a simple question about atom indexing with RDKit. I am using RDKit in Python to process a collection of small molecule, for each I have the SMILES and a pdb file without explicit hydrogens. To draw the 2D images of the molecules, I used AssignBondOrdersFromTemplate to assign the bond order. pdbmol = rdmolfiles.MolFromPDBFile(<the pdb file>) smilemol = Chem.MolFromSmiles(<the smiles string>) newmol = AllChem.AssignBondOrdersFromTemplate(smilemol, pdbmol) rdDepictor.Compute2DCoords(newmol) for atom in newmol.GetAtoms(): atom.SetAtomMapNum(atom.GetIdx()) Using the above lines, I was able to draw the ligand in 2D with Idx of atoms. However, I noticed that the Idx of atoms have changed in the newmol… Is there a way to keep the original indexing from the PDB file in the newmol (perhaps by an alternative way to set bond order)? I wanted to label a couple of atoms in the 2D picture, but I only know their Idx in the PDB file, so I really wish to keep the original indexing. Any comments/suggestions would be greatly appreciated. Thank you for your time and kind advice in advance!! Many Thanks, Amy -- Amy He Chemistry Graduate Teaching Assistant Hadad Research Group Ohio State University he.1...@osu.edu<mailto:he.1...@osu.edu> <ATT00001.txt> <ATT00002.txt>
_______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss