-
Hi, I am trying to figure out how to load molecules from RDKit. I would like to first load an SDF file using RDkit then run the RMSD calculations on that. Any tips or example code would be great. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @Tonylac77, thank you for your interest in The from spyrmsd.molecule import Molecule
m = Molecule().from_rdkit(YOUR_RDKIT_MOLECULE) You can then use Alternatively, you can use the attributes of the Finally, you can bypass the spyrmsd/spyrmsd/optional/rdkit.py Lines 149 to 165 in 952e356 from rdkit import Chem
from rdkit.Chem import AllChem
# Instead of the following 4 lines of code, load your RDKit molecules from SDF files
rdmol1 = Chem.MolFromSmiles("c1ccccc1")
rdmol2 = Chem.MolFromSmiles("c1ccccc1")
AllChem.EmbedMolecule(rdmol1)
AllChem.EmbedMolecule(rdmol2)
from spyrmsd.molecule import Molecule
from spyrmsd.rmsd import rmsdwrapper
mol1 = Molecule.from_rdkit(rdmol1)
mol2 = Molecule.from_rdkit(rdmol2)
rmsdwrapper(mol1, mol2) I hope this helps. I will try to improve the tutorial/documentation in this regard. |
Beta Was this translation helpful? Give feedback.
Hi @Tonylac77, thank you for your interest in
spyrmsd
.The
spyrmsd.molecules.Molecule
class has a special constructor to build aspyrmsd
molecule directly from and RDKit molecule:You can then use
spyrmsd.rmsd.rmsdwrapper
which works directly withspyrmsd
molecules.Alternatively, you can use the attributes of the
spyrmsd.molecule.Molecule
directly in the call to the more bare-bonespyrmsd.rmsd.symmrmsd
, as shown in the tutorial.Finally, you can bypass the
spyrmsd.molecule.Molecule
class entirely by extracting the relevant information needed byspyrmsd.rmsd.symmrmsd
directly from an RDKit molecule as fol…