mda equivalent of Rdkit's addHs #4889
-
G'day all, Looking to extract a ligand and surrounding residues from a Universe but then to cap valences in a manner similar to Rdkit's addHs module to feed into some qchem workflows. Directly saving the selection as a pdb shows there are indeed unsatisfied valences. I've Googled and searched and can't find a way to do this, so either it's so blindingly obvious that this topic will prove a useful reminder to others.... Or it's not as straightforward as I'd like it to be. Anyone have some code laying around to achieve my dreams? Cheers all. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
You can use the RDKit converter to go directly to RDKit and then add the Hs there! from rdkit import Chem
import MDAnalysis as mda
u = mda.Universe("protein.pdb")
atoms = u.select_atoms("name CA")
rdkit_mol = atoms.convert_to("RDKIT")
# do whatever you like in RDKit. |
Beta Was this translation helpful? Give feedback.
You can use the RDKit converter to go directly to RDKit and then add the Hs there!