When in Pymol, don’t call your model “model”

Sometimes it pays to read the blurb that loads in a textport when software loads.

Folks, there is an inherent problems when viewing your Swissmodel results in Pymol. Like many people I usually look away from the screen when I boot a program as I know it will often take a few seconds while either a boot screen appears, or more commonly with molecular modelling programs, a bunch of text scrolls by in the terminal, or in a textport window somewhere in the GUI.

Turns out that in the case of Pymol I should have been paying a bit more attention. I am an enthusiastic user of Pymol and may be guilty of proselytising a bit in it’s favour on Twitter. When Pymol boots, a lot of information scrolls by in it’s textport


Pymol boot screen


As a part-time homology modeller I use a range of software, and recently I’ve been using Swissmodel frequently. I like it quite a lot as it’s:

  1. Free
  2. Easy to use
  3. Web-based and frequently updated
  4. Gives good models as starting points for more rigorous study

However for years there’s been one aspect of results from Swissmodel that have been infuriating. When you download your results you get a lovely html-based nest of folders containing the different models produced. Unfortunately it names every model “model.pdb”. Not even model1.pdb, model2.pdb…

Swissmodel output files

When you load any of these results in Pymol a whole bunch of operations are blocked. You cannot use the “actions” menu, or even “Show Cartoons”. Over the years I’ve used a couple of workarounds. The simplest is to rename the model to something more useful. It should have dawned on me that there was something intrinsically wrong with the name model.pdb but I didn’t bother to pursue it.

Using the Pymol Actions dropdown to extract the selection to a new object

If I forget beforehand to rename* the file I simply used to use the Pymol “extract object” feature to take the entire molecule out of the file “model”, and then continue work. Now if I had bothered to look more closely at the textport I would have seen that:

Executive-Warning: name “model” collides with a selection language keyword.

Update: It is of course easy to rename model.pdb using the “set_name” command in pymol to something that allows you to keep working, rather than going through the trouble of extracting into a new object as I had been doing. The correct syntax is:

set_name model, newname

It doesn’t help to know this now of course, I still have to use a workaround. It would just be nice if there was an option to have the 16 different models that Swissmodel produced in this case named something different (like model1, model2, model3…

POSTSCRIPT. I hope that this brief post doesn’t sound like too much of a whinge. I aim to write a bit more about Swissmodel, which is an excellent resource for people looking at getting into homology modelling in particular in the near future. If you have any questions about today’s post, or about Swissmodel, leave a comment or you can always send me a Tweet @MartinStoermer over on Twitter.

POSTSCRIPT. I saw this great tip from Cult of Mac for bulk renaming files with renumbering in the Mac Finder, which I didn’t know about. It works great, even on nested files in folders.


The inbuilt bulk rename/renumber tool in the MacOS Finder

About martin

almost on holidays
This entry was posted in Chem, Chem_Comp, modeling, Pymol, software. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s