Hey! This question has been asked in one way or another a couple of times, so I'll try to be specific.
I need to write a Pymol script to generate an image of a protein-peptide complex, focusing on the peptide showing its details. Generally, Pymol should be able to get a correct view of the peptide by using orient peptide
(where peptide
is naturally my peptide object). On some cases, though, it fails, and while the peptide might be aligned with the view, it's partially or completely obscured by the receptor molecule. This is because Pymol's orient
chooses the shortest camera rotation in needs in order to align it with the main axes of the peptide. It doesn't appear to be taking account on the line of view from the camera to the peptide. By rotating the image manually, I am able to run orient
again and get a better view.
I am constrained to Pymol as my script is supposed to run as part of a larger framework which relies on Pymol.
I tried a couple of ways to "force" Pymol to choose the better angle myself, but none worked.
My thought was to either calculate the moment matrix myself, or, probably simpler, after orienting, choosing the better side by passing a line between the camera and the different peptide residues, and seeing whether certain 90 degree rotations might reveal more of the peptide.
Before I do so, I wanted to ask and see whether someone already did this?
Thanks!
Yuval
P.S. I know of these related questions:
- Generate Image Of Pdb File From Script Or Command Line
- Automagically Determining The Best View Of A Pdb Structure For A Given Set Of Amino Acids
EDIT: here's an example of a problematic image
fetch 2hle
extract receptor, chain A
extract peptide, chain B and resi 119-125
hide everything
show surface, receptor
color white, receptor
show sticks, peptide
hide (peptide and hydro)
util.cbac peptide
orient peptide
Would any 90 degree rotations fix your example above? It seems to me that many more rotations would need to be tested.
At first this sounded like a niche use case, but it seems like any software that has to focus on a ligand binding site would want to optimize this view.