AtomSelectionSpec

Atom selection object. Used to specify what atoms should be selected. Can include
any field from AtomSpec in which case atoms must equal the specified value.
All fields must match for the selection to hold. If values
are provided as a list, then only one value of the list must match.

Example

$3Dmol.download("pdb:2EJ0",viewer,{},function(){
 viewer.setStyle({chain:'B'},{cartoon:{color:'spectrum'}});
 viewer.setStyle({chain:'B',invert:true},{cartoon:{}});
 viewer.setStyle({bonds: 0},{sphere:{radius:0.5}}); //water molecules
 viewer.setStyle({resn:'PMP',byres:true,expand:5},{stick:{colorscheme:"greenCarbon"}});
 viewer.setStyle({resi:["91-95","42-50"]},{cartoon:{color:"green",thickness:1.0}});
 viewer.render();
});

Extends

Members

and :Array|object

take the intersection of the provided lists of AtomSelectionSpecs

Type:
  • Array | object
Properties
NameTypeAttributesDescription
___cached_resultsany<optional>

atom :string

Atom name; may be more specific than 'elem' (e.g 'CA' for alpha carbon)

Type:
  • string
Inherited From

b :number

Atom b factor data

Type:
  • number
Inherited From

bondOrder :Array

Array of this atom's bond orders, corresponding to bonds identfied by 'bonds'

Type:
  • Array
Inherited From

bondStyles :Array

custom bond styling by position in bonds

Type:
  • Array
Inherited From

bonds :number

overloaded to select number of bonds, e.g. {bonds: 0} will select all nonbonded atoms

Type:
  • number

byres :boolean

if set, expands the selection to include all atoms of any residue that has any atom selected

Type:
  • boolean

callback :function

Callback click handler function to be executed on this atom and its parent viewer

Type:
  • function
Inherited From

chain :string

Chain this atom belongs to, if specified in input file (e.g 'A' for chain A)

Type:
  • string
Inherited From

clickable :boolean

Set this flag to true to enable click selection handling for this atom

Type:
  • boolean
Inherited From

color :ColorSpec

Atom's color, as hex code or built-in color string

Inherited From

elem :string

Element abbreviation (e.g. 'H', 'Ca', etc)

Type:
  • string
Inherited From

expand :number|string

expands the selection to include all atoms within a given distance from the selection

Type:
  • number | string

frame :number

frame index of individual frame to style; will apply to all frames if not set

Type:
  • number

hetflag :boolean

Set to true if atom is a heteroatom

Type:
  • boolean
Inherited From

hover_callback :function

Callback hover handler function to be executed on this atom and its parent viewer

Type:
  • function

hoverable :boolean

Set this flag to true to enable hover selection handling for this atom

Type:
  • boolean
Inherited From

index :number|Array

index of the atom or atoms to select

Type:
  • number | Array

invert :boolean

if set, inverts the meaning of the selection

Type:
  • boolean

model :GLModel|number|Array|Array

a single model or list of models from which atoms should be selected. Can also specify by numerical creation order. Reverse indexing is allowed (-1 specifies last added model).

Type:

not :AtomSelectionSpec

take the inverse of the provided AtomSelectionSpec

or :Array|object

take the union of the provided lists of AtomSelectionSpecs

Type:
  • Array | object
Properties
NameTypeAttributesDescription
___cached_resultsany<optional>

pdbline :string

If applicable, this atom's record entry from the input PDB file (used to output new PDB from models)

Type:
  • string
Inherited From

predicate :function

user supplied function that gets passed an AtomSpec and should return true if the atom should be selected

Type:
  • function

properties :Record.<string, any>

Optional mapping of additional properties

Type:
  • Record.<string, any>
Inherited From

resi :number

Residue number

Type:
  • number
Inherited From

resn :string

Parent residue name

Type:
  • string
Inherited From

serial :number

Atom's serial id number

Type:
  • number
Inherited From

singleBonds :boolean

true if this atom forms only single bonds or no bonds at all

Type:
  • boolean
Inherited From

ss :string

Secondary structure identifier (for cartoon render; e.g. 'h' for helix)

Type:
  • string
Inherited From

style :AtomStyleSpec

style of atom

Inherited From

surfaceColor :ColorSpec

Hex code for color to be used for surface patch over this atom

Inherited From

unhover_callback :function

Callback handling "unhover" to be executed on this atom and its parent viewer

Type:
  • function

within :WithinSelectionSpec

intersects the selection with the set of atoms within a given distance from another selection

x :number

Atom's x coordinate

Type:
  • number
Inherited From

y :number

Atom's y coordinate

Type:
  • number
Inherited From

z :number

Atom's z coordinate

Type:
  • number
Inherited From