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.

Source

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>
Source

atom :string

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

Type:
  • string
Inherited From
Source

b :number

Atom b factor data

Type:
  • number
Inherited From
Source

bondOrder :Array

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

Type:
  • Array
Inherited From
Source

bondStyles :Array

custom bond styling by position in bonds

Type:
  • Array
Inherited From
Source

bonds :number

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

Type:
  • number
Source

byres :boolean

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

Type:
  • boolean
Source

callback :function

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

Type:
  • function
Inherited From
Source

chain :string

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

Type:
  • string
Inherited From
Source

clickable :boolean

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

Type:
  • boolean
Inherited From
Source

color :ColorSpec

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

Inherited From
Source

elem :string

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

Type:
  • string
Inherited From
Source

expand :number|string

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

Type:
  • number | string
Source

frame :number

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

Type:
  • number
Source

hetflag :boolean

Set to true if atom is a heteroatom

Type:
  • boolean
Inherited From
Source

hover_callback :function

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

Type:
  • function
Source

hoverable :boolean

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

Type:
  • boolean
Inherited From
Source

index :number|Array

index of the atom or atoms to select

Type:
  • number | Array
Source

invert :boolean

if set, inverts the meaning of the selection

Type:
  • boolean
Source

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:
Source

not :AtomSelectionSpec

take the inverse of the provided AtomSelectionSpec

Source

or :Array|object

take the union of the provided lists of AtomSelectionSpecs

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

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
Source

predicate :function

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

Type:
  • function
Source

properties :Record.<string, any>

Optional mapping of additional properties

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

resi :number|SelectionRange|Array

overloaded to allow ranges and lists of residues, e.g. {resi: "5-10"} or {resi: [5,10,32]}

Type:
  • number | SelectionRange | Array
Overrides
Source

resn :string

Parent residue name

Type:
  • string
Inherited From
Source

serial :number

Atom's serial id number

Type:
  • number
Inherited From
Source

singleBonds :boolean

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

Type:
  • boolean
Inherited From
Source

ss :string

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

Type:
  • string
Inherited From
Source

style :AtomStyleSpec

style of atom

Inherited From
Source

surfaceColor :ColorSpec

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

Inherited From
Source

unhover_callback :function

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

Type:
  • function
Source

within :WithinSelectionSpec

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

Source

x :number

Atom's x coordinate

Type:
  • number
Inherited From
Source

y :number

Atom's y coordinate

Type:
  • number
Inherited From
Source

z :number

Atom's z coordinate

Type:
  • number
Inherited From
Source