import os
from rdkit import Chem
from rdkit.Chem.Draw import IPythonConsole
from rdkit.RDConfig import RDContribDir
import py3Dmol
import sys
import shutil
libpath = os.path.join(RDContribDir, 'CalcLigRMSD')
datapath = os.path.join(RDContribDir, 'CalcLigRMSD/data')
path = os.path.join(RDContribDir, 'CalcLigRMSD')
sys.path.append(path)
from CalcLigRMSD import CalcLigRMSD
docked_ligand = Chem.MolFromPDBFile(os.path.join(datapath, "docked_2c6e_JVE_pH74_netcharge1.pdb"))
crystal_ligand = Chem.MolFromPDBFile(os.path.join(datapath, "4uzh_JVE.pdb"))
shutil.copy2(os.path.join(datapath, "docked_2c6e_JVE_pH74_netcharge1.pdb"), './')
shutil.copy2(os.path.join(datapath, "4uzh_JVE.pdb"), './')
'./4uzh_JVE.pdb'
rmsd2 = CalcLigRMSD(docked_ligand, crystal_ligand, rename_lig2 = True, output_filename = 'JVE_renamed.pdb')
print(f"RMSD: {rmsd2:.2f}")
RMSD: 1.66
IPythonConsole.drawMol3D(docked_ligand)
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol
IPythonConsole.drawMol3D(crystal_ligand)
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol
view = py3Dmol.view()
view.addModel(Chem.MolToMolBlock(docked_ligand), 'sdf', {'keepH': False})
view.setStyle({'stick':{}})
view.addModel(Chem.MolToMolBlock(crystal_ligand), 'sdf', {'keepH': False})
view.setStyle({'stick':{}})
view.zoom()
view.show()
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol