Difference between revisions of "Load/Filter"

From Jmol
Jump to navigation Jump to search
(Loading only some models from multimodel files)
(loading with filter)
 
Line 1: Line 1:
 +
<p style="font-size:x-large; ">Loading parts of a model file</p>
 +
 +
Rather than a documentation, this page is a collection of ready-to-be-used examples that illustrate the quite particular syntax of this command. For details and explanation of the options visit {{ScriptingDoc}}#load and search for "filter ", or {{ScriptingDoc}}#loadmodels.
 +
 
== Loading part of the model using a filter ==
 
== Loading part of the model using a filter ==
  
The use of <code>load</code> with the <code>filter</code> option will make Jmol to read the file and either load or discard each atom based on the provided criteria.
+
The use of <code>load</code> with the <code>filter</code> option will direct 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).
 
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 {{ScriptingDoc}}#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|pdb}} and {{file|mmCif}} formatted files.
 
These apply to {{file|pdb}} and {{file|mmCif}} formatted files.
Line 26: Line 28:
 
=== To load only the first alternative conformation ===
 
=== To load only the first alternative conformation ===
 
  load "myfile.pdb" filter "%A"
 
  load "myfile.pdb" filter "%A"
Some atoms in some models have alternative positions (the <code>AltLoc</code> 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.
+
Some atoms in some models have alternative positions (the <code>AltLoc</code> field in the pdb format), usually labelled A, B, etc. This loads all atoms that have no alternative positions, and only the first one (A) of those who have several.
  
 
== Loading only some models from multimodel files ==
 
== Loading only some models from multimodel files ==
 +
Multimodel files are typical of NMR results, holding alternative conformations of the whole protein.
  
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.
+
Note that model numbers here refer to the order of models as found in the file, starting with 0, and typically will NOT match the model numbers indicated in PDB MODEL records (see farther below for this option).
  
 
To load only the first model:
 
To load only the first model:
Line 50: Line 53:
 
To load just one model according to its number indicated in PDB MODEL records:
 
To load just one model according to its number indicated in PDB MODEL records:
 
  load "myfile.pdb" 2
 
  load "myfile.pdb" 2
will load model=2
+
that will load the <code>MODEL 2</code> record

Latest revision as of 10:48, 20 October 2016

Loading parts of a model file

Rather than a documentation, this page is a collection of ready-to-be-used examples that illustrate the quite particular syntax of this command. For details and explanation of the options visit http://chemapps.stolaf.edu/jmol/docs/#load and search for "filter ", or http://chemapps.stolaf.edu/jmol/docs/#loadmodels.

Loading part of the model using a filter

The use of load with the filter option will direct 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).

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, and only the first one (A) of those who have several.

Loading only some models from multimodel files

Multimodel files are typical of NMR results, holding alternative conformations of the whole protein.

Note that model numbers here refer to the order of models as found in the file, starting with 0, and typically will NOT match the model numbers indicated in PDB MODEL records (see farther below for this option).

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

that will load the MODEL 2 record

Contributors

AngelHerraez