chemosim-lab / ProLIF

Interaction Fingerprints for protein-ligand complexes and more
https://prolif.readthedocs.io
Apache License 2.0
372 stars 71 forks source link

Plotting ligand interaction network from molecular docking results. #137

Closed Sumbul1631 closed 1 year ago

Sumbul1631 commented 1 year ago

I am trying to plot ligand interaction network from docking results , I have used the code that have been provided in discussions section....My code looks like this: !pip install rdkit !pip install prolif from rdkit import Chem import prolif as plf from prolif.plotting.network import LigNetwork

Load ligand

lig_suppl = plf.sdf_supplier("/content/d2 top.sdf")

Load protein

prot_pdb = Chem.MolFromPDBFile("/content/final prepared structure of protein.pdb", removeHs=False) prot = plf.Molecule(prot_pdb)

Run prolif

fp = plf.Fingerprint() fp.run_from_iterable(lig_suppl, prot) df = fp.to_dataframe() print(df)

Visualize

df_atoms = fp.to_dataframe(return_atoms=True) net = LigNetwork.from_ifp(df_atoms, lig_suppl[0], kind="frame", frame=0) net.show("pdb_lig_network.html")

Plifs get displayed but not the interaction network and it says....localhost refused o connect

cbouy commented 1 year ago

Hi @Sumbul1631, how are you running this code snippet: Google colab, Jupyter notebook, python script?

Sumbul1631 commented 1 year ago

Google colab

On Sat, 15 Jul 2023, 11:11 pm Cédric Bouysset, @.***> wrote:

Hi @Sumbul1631 https://github.com/Sumbul1631, how are you running this code snippet: Google colab, Jupyter notebook, python script?

— Reply to this email directly, view it on GitHub https://github.com/chemosim-lab/ProLIF/issues/137#issuecomment-1636846923, or unsubscribe https://github.com/notifications/unsubscribe-auth/BBJGYZHYAEJTEZUJEKS3FDTXQLMNNANCNFSM6AAAAAA2LFUZ3U . You are receiving this because you were mentioned.Message ID: @.***>

cbouy commented 1 year ago

Looks like Colab doesn't make it easy to display an HTML file saved locally looking at this stackoverflow thread.

Can you try replacing the last line net.show("pdb_lig_network.html") with net.display() ? If you need to save the html file you can still just do net.save("/path/to/output.html") before/after.

Sumbul1631 commented 1 year ago

Yes..I tried it and it worked..thank you

On Sun, 16 Jul 2023, 12:40 am Cédric Bouysset, @.***> wrote:

Looks like Colab doesn't make it easy to display an HTML file saved locally looking at this stackoverflow thread https://stackoverflow.com/questions/59091645/serving-an-iframe-in-google-colab-notebook-localhost-refused-to-connect .

Can you try replacing the last line net.show("pdb_lig_network.html") with net.display() ? If you need to save the html file you can still just do net.save("/path/to/output.html") before/after.

— Reply to this email directly, view it on GitHub https://github.com/chemosim-lab/ProLIF/issues/137#issuecomment-1636871379, or unsubscribe https://github.com/notifications/unsubscribe-auth/BBJGYZEQXLCYXNQ5CWKFEH3XQLWZHANCNFSM6AAAAAA2LFUZ3U . You are receiving this because you were mentioned.Message ID: @.***>