Load/Filter

From Jmol
Revision as of 17:07, 19 October 2016 by AngelHerraez (talk | contribs) (Loading only some models from multimodel files)
Jump to navigation Jump to search

Loading part of the model using a filter

The use of load with the filter option will make Jmol to read the file and either load or discard each atom based on the provided criteria.

This is useful in general to reduce the data to be managed in Jmol, without the need for scripts that will hide part of it (a part that might reappear due to other script).

Rather than a documentation (see https://chemapps.stolaf.edu/jmol/docs/#load and search for "filter "), this page is a collection of examples that illustrate the quite particular syntax of this command.

These apply to File icon.gifpdb and File icon.gifmmCif formatted files.

To avoid loading the water molecules

load "myfile.pdb" filter "![HOH]"

will work as long as the water groups are labelled HOH (which is the usual name in PDB database)

To load just chain A

load "myfile.pdb" filter "*:A"

To load just protein backbone

load "myfile.pdb" filter "*.CA"

This loads the alpha carbons, useful to reduce the load of very large models; Jmol will be able to render cartoons, ribbons or trace of such CA-only models and so provide a good representation, similar to the one obtained with the full model as long as you do not need details of the residues.

To load just protein and nucleic acid backbones

load "myfile.pdb" filter "*.CA,*.P"

Similar to the previous one but catering for nucleic acids together with proteins. As before, only the backbone atoms are loaded but that is enough for the schematic rendering.

To load only the first alternative conformation

load "myfile.pdb" filter "%A"

Some atoms in some models have alternative positions (the AltLoc field in the pdb format), usually labelled A, B, etc. This loads all atoms that have no alternative positions, but only the first one of those who have several.

Loading only some models from multimodel files

Note that model numbers refer to the sequence of models encountered in the file, starting with 0, and typically do NOT correspond to the model numbers indicated in PDB MODEL records.

To load only the first model:

load models ({0}) "myfile.pdb"

To load only the first and third models:

load models ({0 2}) "myfile.pdb"

To load only the 1st, 4th and 5th models:

load models ({0 3:4}) "myfile.pdb"

To load every other model (the odd ones: 1st, 3rd, etc.):

load models {0 -1 2} "myfile.pdb"

To load every other model (the even ones: 2nd, 4th, etc.):

load models {1 -1 2} "myfile.pdb"


To load just one model according to its number indicated in PDB MODEL records:

load "myfile.pdb" 2

will load model=2

Contributors

AngelHerraez