Personal tools
Document Actions

Changing default parameters

This How-to applies to: 1.4.5
This How-to is intended for: Any audience.

Explains how-to change default parameters using _pmvrc.

If you are using certain commands and change default parameters frequently, you can add a line in your ~/.mgltools/1.4.5/Pmv/_pmvrc to change these values. To find the syntax of a command, run the command you are interested in, and click on the Message Box icon textBox on the ToolBar. Here are a couple of examples.

Make Color by Atom Type the Default

When reading a molecule, PMV displays white lines between bonded atoms. If you like these lines colored by atom type instead, append the following line to _pmvrc:

self.setOnAddObjectCommands(['buildBondsByDistance', 'displayLines', 'colorByAtomType'], log=0)

Change Default Ball Radii

To change ball radii in display sticks and balls, run DisplaySticks And Balls, change Ball Radii from 0.3 to, e.g., 0.5 and click OK. Check the Message Box to see the command log. There should be a line somewhat similar to the following:

self.displaySticksAndBalls("HIS", log=0, cquality=0, sticksBallsLicorice='Sticks and Balls', bquality=0, cradius=0.2, only=False, bRad=0.3, negate=False, bScale=0.0)

This shows the command that has been executed self.displaySticksAndBalls and corresponding arguments. The one we are interested is bRad. Now edit ~/.mgltools/14.5/Pmv/_pmvrc and append the following line to the end:

self.displaySticksAndBalls.lastUsedValues['default']['bRad'] = 0.5
Next time you start PMV or ADT, the default for ball radii would be set to 0.5.

Display Sticks and Balls Colored by Atom Type

Q: If you change the display from lines to sticks and balls, the molecule becomes colorless even if you already colored the lines by atom type. Is there a way to keep the color scheme?

A: Append the following code to _pmvrc:

self.setOnAddObjectCommands(['buildBondsByDistance','displayLines','displaySticksAndBalls','colorByAtomType','undisplaySticksAndBalls'],log=0)



see also:

Change camera size
How-to change Camera size on start-up or on-the-fly.
Change the default font
Describes how-to change the default font.
by Sargis Dallakyan last modified 2007-07-09 16:32 Molecular Graphics Laboratory, TSRI

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: