[Rdkit-discuss] How to Set AtomPDBResidueInfo to None?
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
From: Wang S. <shu...@gm...> - 2023-10-26 16:08:49
|
Hi all, If I create a molecule from smiles: ``` from rdkit import Chem mol = Chem.MolFromSmiles("C") for atm in mol.GetAtoms(): print(atm.GetPDBResidueInfo()) ``` then the pdb residue info for each atom is None However, if I created a molecule from pdb, is it possible to delete the pdb residue info associated to each atom, so that None is returned still? For illustrative purposes: ``` from rdkit import Chem from rdkit.Chem import AllChem mol = Chem.MolFromSmiles("C") mol = AllChem.AssignBondOrdersFromTemplate( mol, Chem.MolFromPDBBlock(Chem.MolToPDBBlock(mol)) ) ## !! This would instead return an "ValueError: MonomerInfo is not a PDB Residue" for atm in mol.GetAtoms(): atm.SetMonomerInfo(Chem.AtomMonomerInfo()) print(atm.GetPDBResidueInfo()) ``` Is it possible to set PDBResidueInfo to None? Or will I have to work around it by say writing out an intermediate sdf file and read it back in? Thank you |