chemosim-lab / ProLIF

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

Different visualization area in a view of pymol3d in the tutorial #228

Open xavgit opened 6 days ago

xavgit commented 6 days ago

Hi, in the tutorial for the section https://prolif.readthedocs.io/en/stable/notebooks/docking.html#docking about "You can also compare two different poses on the same view, and the protein residues that have different interactions in the other pose or are missing will be highlighted in magenta:" the width of the visualization area on left is bigger than that on the right side. How it is possible to have the same width on both sides? It is possible to compare more than two poses with the given code?

Thanks.

Saverio

image

P.S. Thanks for this very useful package.

cbouy commented 4 days ago

Hi @xavgit

They should be of the same size, have you tried just specifying a smaller size for the view? By default it's size=(900, 600) but you can adjust this and hopefully it will all fit in your window

xavgit commented 3 days ago

Hi, thanks , I try. If possible another question. Regarding the instructions

df = fp.to_dataframe(index_col="Pose") # show only the 5 first poses df.head(5)

how it is possible to get only the list of the interacting residues present at level protein? In the tutorial protein TYR38.A TYR109.A TRP125.A LEU126.A ... PRO338.B PHE346.B LEU348.B PHE351.B ASP352.B THR355.B TYR359.B This for knowing only what are the interacting residue whit the ligand poses of a specified ligand.

Thanks.

Saverio

xavgit commented 3 days ago

Hi, I've used the following code on a WQXGA monitor:

from prolif.plotting.complex3d import Complex3D

pose_index = 0 comp3D = Complex3D.from_fingerprint( fp, pose_iterable[pose_index], protein_mol, frame=pose_index )

pose_index = 4 other_comp3D = Complex3D.from_fingerprint( fp, pose_iterable[pose_index], protein_mol, frame=pose_index )

view = comp3D.compare(other_comp3D , size = ( 800 , 500 ) ) view

The result is the same or similar with the browser in full screen. I don't know if the added size = ( 600 , 600 ) is in the right place.

Thanks.

Saverio

cbouy commented 3 days ago

Regarding the view size I really don't know what to say, have you tried with a different browser?

For your question around extracting the list of residues:

# for all poses combined
df.columns.get_level_values("protein").unique().to_list()

# for a specific pose
pose_num = 1
(pose := df.iloc[pose_num])[pose].index.get_level_values("protein").unique()