PyMOL scripts

Have you ever tried to represent your protein as a “sausage”-style cartoon, with the tube diameter scaled by values in the B-factor column ? We present an array of useful PyMOL scripts links to solve your problem.

PyMOL is, as defined on its home page: “.. a USER-SPONSORED molecular visualization system on an OPEN-SOURCE foundation”. Indeed it is one of the most popular molecular viewers out there. One of the main strengths of PyMOL is its inherent scripting abilities. I’m sure that many of you knew that, but have never really taken the time to write such scripts, and why would you ? others have done the job for you!

We present to you a pile of PyMOL scripts, some are extremely useful, others can color your protein salmon pink. 

  • The PyMOL wiki is a great PyMOL resource by itself, but its scripts library is the real gem. 
    • cool script: a Wizard to draw planes between three picked points.
  • Dr. Robert L. Campbell, shares with us his own little directory of useful PyMOL scripts.
    • cool script: Extract data produced by other programs and alter the B-factor or occupancy of a molecule within PyMOL.
  • As Does Dr. Gareth Stockwell, from the EBI.
    • cool script: Draws pretty h-bonds, with arrows.
  • On Cam’s PyMOL page you’ll find lots of examples for specific tasks and amongst them the highly coveted…
    • cool script: “sausage”-style cartoon representation, with the tube diameter scaled by values in the B-factor column.
    • Update: as indicated in the comments “cartoon putty” will do the trick since v0.98
  • Extending beyond the reach of scripts, at the sourceforge PyMOL plugins page you can find some PyMOL plugins for useful tasks such as visualizing electrostatic potentials, identifying and visualizing access routes to protein cavities, download a PDB file straight into PyMOL, loading of multiple pdb files, dihedral restraints checks, NOE restraints checks, and superposition routines.
    • cool plugin: visualizing surfaces and voids using the CASTp algorithm.

What’s your favorite Pymol script ? share with us in the comments.

By Nir London.

Be Sociable, Share!
Written by Nir London in: Resources | Tags: , , , ,

Enjoyed this Post ?

Subscribe by E-mail:

Subscribe in a reader. Follow us on twitter.

  • Darrell

    The b-factor scaling is already incorporated into PyMOL. Just type “cartoon putty” on the command line to invoke it.

  • Pingback: What is your favorite molecular viewer ? | Macromolecular Modeling Blog ™()

  • thierry

    Hi, As you seems to be quite good in pymol modelling, I would like to ask to make a special bond in pymol. Actually in my protein I have a real covalent bond between an Asn and a Lys.. Obviously, Pymol doesn’t know how to draw it. Can you help me ?

  • admin

    Pymol just draws bonds based on distances, not based on topological
    information. If atoms are within contact distance, a bond will be
    drawn, whatever the atoms are. If one feels need for an additional
    bond, it is possible to add them using:

    bond selection1, selection2

    This will draw bonds between all atoms of selection1 and all atoms of
    selection2. In Thierry’s case it would be something like:

    bond resi X and resn asn and name CD, resi Y and resn lys and name NZ

    assuming this is about a side chain – side chain amide bond.

    Hope it helps,


  • Cameron Mura

    The variable-width, B-factor-scaled “sausage” representation described on my page was implemented as the “putty” cartoon style in PyMOL v0.98+. So, as Darrell points-out, now all one needs to do it type “cartoon putty” (the patch on my page was useful before this was integrated into the PyMOL codebase). Also, note that “Cam’s PyMOL page” (which is now rather old and in need of a major update) has moved to

  • admin

    Thanks Cameron, I updated the link. Good luck with the new lab!!

  • ram

    Hi, may i please ask your suggestion on a modeling question i had ? i would like to model chimeric fusion proteins where each component protein is part of a known crystal structure. I would also like to append custom peptide linkers between the component proteins. Could you please recommend the best strategy to do this using macpymol ? I am appreciative of your assistance and time.

  • Nir London

    Dear ram,
    If I understand correctly you wish to model the way your chimeric protein would look. For this purpose you’ll need a molecular modeling software (Such as Rosetta, Tasser, Modeler, Yasara etc..) PyMol is a molecular viewer and cannot do extensive modeling. If you just wish to very roughly estimate the chimera feasibility you can edit the structures in pymol (i.e. remove the unnecessary atoms) and manually place them to get an idea..
    Hope this helps.

  • Marianna

    Hi everyone,
    i am having some difficulties with pymol’s fuse command. I have 2 pdb files that represent 2 adjacent fragments of my protein and i am trying to ligate the amino terminus of the first to the carboxy terminus of the second, in order to create one structure – pdb file.
    I am using the fuse command, specifying the correct residues and atom names, but what i get is a strange “molecule” that has big gaps in specific locations. If i dispay the sequence of the final molecule it seems as if the 2 individual sequences have interjected into one another.
    Any suggestions/ideas? I am really curious as to why this happens..!
    If anyone knows of another way to perform the same task, it would be really appreciated :)
    Thanks in advance,

  • Michael Zimmermann

    I have no experience with fuse, but my guess would be Mariana might
    want to just use ‘bond’ and translate one termini as needed. If she
    doesn’t want to “manually” translate, there is always energy
    minimization to correct bond lengths.
    Take Care.

  • Robert Campbell

    Hi Marianna,

    Given that you say that the sequence is display as if the 2 original sequences have been interjected into one another, then I think the problem is that you have the same chain ID for the two and the residue numbers overlap. Perhaps if they had different chain IDs or if the second molecule is renumbered to have residue numbers that start after the first molecule it would work correctly.


  • Ram

    Thank you, Nir. I figured out how to use the Fuse command but as Marianna asks, the residues of the fusion protein become ordered based on their numbering. This results in a protein that is interspersed with residues from both the fused domains. Rob is absolutely right about this. Is there any way to edit the numbering on the residues of the two domains (separate objects) so that they appear in sequence and can be fused sequentially without such ‘interjection’ ?

    Thanks again!

  • Marianna

    Hey everyone and thanks for all the answers :)
    Robert is indeed absolutely right on this, it makes perfect sense.
    Ram, there is a way to change it, besides manually change the pdb file with a text editor, that sounds horrifying :)
    Try this tool
    Pros: it’s free, has GUI
    Cons: its slow (java based)
    You can easily edit the residue column only of the object you want, and also perform other useful tasks.
    Hope it helps!

  • Teek

    If it’s just a question of renumbering all the residues in an object/selection based on some offset, then just use alter in PyMol. Adapted from the alter documentation:

    alter (objectname/selection), resi=str(int(resi)+100)


  • Angela

    Hi everyone,

    I am trying to find a way, in Pymol, to remove an amino acid from a peptide and insert any other amino acid. I have been able to do this for one residue at a time using the command


    but I have to do this in two parts so that the new amino acid binds at both ends. I was wondering if there is a way in which Pymol can “swap” an existing side chain at position N on the peptide for any other side chain in an automated fashion?

    Any help much appreciated.


  • Kaushik

    how can we represent protein-protein interactions using pymol??

  • admin

    You can load any structure of a protein-protein complex and examine the different features of the interactions such as the details of the interface.

  • ken_mo

    hi every1,

    I am trying to get pymol to color based on occupancy (which i’ve edited to suit my purpose), but there seems to be no option to do it.There, only seems to be an option to color it by b-factor……..pls help

  • barry kesner

    I am trying to copy the color of one object from another. How do you do this?

  • Dustin


    I am having some trouble and thought someone here might be able to answer my question. I am trying to make a model of a fusion protein using pymol. I want to create a model composed of four triangular proteins arranged into a tetrahedron, but not placed against each other. The proteins are to be connected by a peptide linker. Does anyone know how to spacially modify proteins independently of one another? Also I was trying to fuse a peptide to a protein but I received an error that “bond was not created”. The peptide and protein is located far from each other, as I noted I don’t know how to manipulate things independantly, is that the problem. I appreciate any help and advice.



  • Anto01

    Hi, I would like to ask if anyone knows how to build D aminoacid peptide with PYMOL, Thanks for any help!

  • amber

    can some body tell me the way to find hydrophobic and ionic interaction using pymol????

    Thanks in advance

  • Ajay joshi

    Hi Angela , the problem u can solve easily on VMD software

  • Xiaofeng Ban

    hey, have you found a way to present ionic interaction? i have the same question as you. hope you can help me. thanks

  • DJ


    I have the exact same problem that Angela had. I was wondering if you have a protocol for it. Googled and I didn’t come accros anything, except to remove atoms.

    Many thanks- any help is more than welcome :)


Powered by WordPress | Aeros Theme | WordPress Themes
© 2009 Rosetta Design Group LLC