mda equivalent of Rdkit's addHs #4889
Answered
by
hmacdope
corey-taylor2
asked this question in
Q&A
|
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. |
Answered by
hmacdope
Jan 13, 2025
Replies: 1 comment 6 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. |
6 replies
Answer selected by
corey-taylor2
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use the RDKit converter to go directly to RDKit and then add the Hs there!