Discrete objects

From PyMOLWiki
Jump to navigation Jump to search

A discrete object is a molecular object where every state has its own atom instances.

Details

Properties of discrete objects include:

  • states can be colored independently
  • states can be selected independently
  • bonds can be created/deleted per state (see bond, unbond)

In regular objects, PyMOL stores most atom data (like identifiers, properties, color, visibility of representation, etc.) in an atom table which is shared across all states. Coordinates are stored in separate tables per state. In a discrete object, atom data is not shared, every atom exists in only one state. If the same atom (same identifiers) exists in a another state, it's actually a full copy which can also be selected or colored independently from the other states.

Creating a discrete object

Commands line load, fetch and create have a discrete=-1/0/1 argument.

load 1nmr.pdb, discrete=1
fetch 1nmr, discrete=1
fragment ala
fragment his
create discreteobj, ala, 1, 1, discrete=1
create discreteobj, his, 1, 2, discrete=1

File formats like .sdf and .mol2 are loaded as discrete objects by default, because they typically contain a library of different molecules rather than an ensemble of different conformations. To load them as regular objects, use discrete=0.

Examples

Load a 20-state NMR model, once regular, once discrete:

fetch 1nmr, 1nmr_regular, async=0
fetch 1nmr, 1nmr_discrete, async=0, discrete=1

count_atoms 1nmr_regular
# -> 1290 atoms, every atom counts only once (state count doesn't matter)

count_atoms 1nmr_discrete & state 1
# -> 1290 atoms, same number of atoms in first state of discrete object

count_atoms 1nmr_discrete
# -> 25800 atoms (= 1290 * 20), discrete object has 20 copies of each atom

See Also