Subsections


pymol.macro_write

Image pymol_icon Image document-save

Synopsis

Create PyMOL macros.

Defaults

pymol.macro_write(data_type=None, style=`classic', colour_start_name=None, colour_start_rgb=None, colour_end_name=None, colour_end_rgb=None, colour_list=None, file=None, dir=`pymol', force=False)

Keyword arguments

data_type: The data type to map to the structure.

style: The style of the macro.

colour_start_name: The name of the starting colour of the linear colour gradient. This can be either one of the X11 or one of the Molmol colour names listed in the description. If this is set, then the starting colour RGB colour array cannot be given.

colour_start_rgb: The starting colour of the linear colour gradient. This is an RGB colour array with values ranging from 0 to 1. If this is set, then the starting colour name cannot be given.

colour_end_name: The name of the ending colour of the linear colour gradient. This can be either one of the X11 or one of the Molmol colour names listed in the description. If this is set, then the ending colour RGB colour array cannot be given.

colour_end_rgb: The ending colour of the linear colour gradient. This is an RGB colour array with values ranging from 0 to 1. If this is set, then the ending colour name cannot be given.

colour_list: The colour list to search for the colour names. This can be either `molmol' or `x11'.

file: The optional name of the file.

dir: The optional directory to save the file to.

force: A flag which, if set to True, will cause the file to be overwritten.

Description

This allows residues specific values to be mapped to a structure through the creation of a PyMOL macro which can be executed in PyMOL by clicking on `File, Macro, Execute User...'. Currently only the `classic' style, which is described below, is available.

Colour

The values are coloured based on a linear colour gradient which is specified through starting and ending colours. These can either be a string to identify one of the RGB (red, green, blue) colour arrays listed in the tables below, or you can give the RGB vector itself. For example, `white' and [1.0, 1.0, 1.0] both select the same colour. Leaving both colours unset will select the default colour gradient which for each type of analysis is described below.

When supplying the colours as strings, two lists of colours can be selected from which to match the strings. These are the default Molmol colour list and the X11 colour list, both of which are described in the tables below. The default behaviour is to first search the Molmol list and then the X11 colour list, raising an error if neither contain the name. To explicitly select these lists, set the colour list to either `molmol' or `x11'.

Model-free classic style

Creator: Edward d'Auvergne

Argument string: "classic"

Description: The classic style draws the backbone of a protein in a cylindrical bond style. Rather than colouring the amino acids to which the NH bond belongs, the three covalent bonds of the peptide bond from Ca to Ca in which the NH bond is located are coloured. Deselected residues are shown as black lines.

Supported data types:

Please see Table 17.22 on page [*].

Molmol RGB colour arrays

The following table is a list of colours used in Molmol and their corresponding RGB colour values ranging from 0 to 1.

Please see Table 17.23 on page [*].

X11 RGB colour arrays

The following table is the list of X11 colour names and their corresponding RGB colour values ranging from 0 to 255.

Please see Table 17.24 on page [*].

Prompt examples

To create a PyMOL macro mapping the order parameter values, S2, onto the structure using the classic style, type:

[numbers=none]
relax> pymol.macro_write('s2')

[numbers=none]
relax> pymol.macro_write(data_type='s2')

[numbers=none]
relax> pymol.macro_write(data_type='s2', style="classic", file='s2.pml', dir='pymol')


The relax user manual (PDF), created 2020-08-26.