Making Pretty Pictures with PyMOL

There’s few things I like more in our field than the opportunity to make a really nice image of a protein structure. Don’t judge me, but I’ve been known to spend the occasional evening in front of the TV with a cup of tea and PyMOL open in front of me! I’ve presented on the subject at a couple of our research group retreats, and have wanted to type it up into a blog post for a while – and this is the last opportunity I will have, since I will be leaving in just a few weeks time, after nearly eight years (!) as an OPIGlet. So, here goes – my tips and tricks for making pretty pictures with PyMOL!

Ray Tracing

set ray_trace_mode, number

I always ray trace my images to make them higher quality. It can take a while for large proteins, but it’s always worth it! My favourite setting is 1, but 3 can be fun to make things a bit more cartoon-ish.

You can also improve the quality of the image by increasing the ‘surface_quality’ and ‘cartoon_sampling’ settings.


Ambient Light

set ambient, number

I think the default lighting in PyMOL is quite dark, and the colours aren’t quite as vibrant as I’d like them. So normally I change the ‘ambient’ setting to 0.5 – maintains some shadows, but whites actually look white!


Cartoon Transparency

set cartoon_transparency, number

You can make important parts of the protein stand out by making the rest of the structure slightly transparent. Sections that are transparent are also not outlined when ray traced, making them even more distinctive.


Field of View

set field_of_view, number

Some interesting/potentially useful effects can be achieved by increasing the field of view, to change the perspective. For example, I changed the field of view setting to 70 for this image of an antibody, to make one antigen binding site more prominent.


Colouring by Secondary Structure

set cartoon_discrete_colours, on/off

When colouring cartoon representations by secondary structure, by default the colour for beta strands can extend slightly into the loop regions. Change the setting above to ‘on’ to stop this – I think it makes the image look a lot tidier!

Also, sometimes you may end up with very small secondary structure elements that can block your view of things, and just generally make things slightly messy (i.e. a couple of residues of alpha helix in the middle of a loop). You can change this manually, e.g.:

alter <selection name>, ss='l' rebuild


Layering

Overlaying different representations of the same structure can sometimes be useful, e.g. here showing the hydrogen bonds making up a beta sheet in the context of the whole protein. For this, you have to save multiple images of your protein without moving it between them, and the ‘opaque_background’ setting should be turned off.

It might be useful here to save a particular view so you can go back to it later:

view <number>, store

To go back to a saved view:

view <number>


Creating Peptides

fab <sequence>, <name>, ss=4

I am actually unsure how I would use this for anything useful, but I think it’s cool anyway! Use the command above to make a peptide of any sequence, with a specified secondary structure type (1=alpha helix, 2=antiparallel beta, 3=parallel beta, 4=flat). See if you can work out what this says!


Grid Mode

Grid mode can be useful when comparing homologous structures, when you want to view and rotate aligned structures side by side instead of on top of one another. I used it to make this image of ultralong antibody H3 loops:


And Finally…

Yes, I sometimes add filters to my protein pictures. Not for anything super-official, like a paper, but when I have the freedom to be a bit more artsy I like to go for it! Many of the OPIG websites feature images of proteins made by me – for example SAbDab, our Twitter profile, and for OAS I even added a filter to a basic plot of amino acid usage across antibody sequences… Below is one of the images I made for my thesis – I did one for the beginning of every chapter! I added a background with a radial gradient (in something like Inkscape), and then used some photo editing software to add a filter.


That’s it! Happy PyMOL-ing 🙂

Author