Interface

AtomSelectionSpec

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.

View Source specs.ts, line 155

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

Array | object

# and Optional

take the intersection of the provided lists of AtomSelectionSpecs

Properties:
Name Type Attributes Description
___cached_results any <optional>

View Source specs.ts, line 212

string

# atom Optional

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

Inherited From:

View Source specs.ts, line 74

number

# b Optional

Atom b factor data

Inherited From:

View Source specs.ts, line 104

Array

# bondOrder Optional

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

Inherited From:

View Source specs.ts, line 94

Array

# bondStyles Optional

custom bond styling by position in bonds

Inherited From:

View Source specs.ts, line 149

number

# bonds Optional

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

Overrides:

View Source specs.ts, line 182

boolean

# byres Optional

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

View Source specs.ts, line 197

function

# callback Optional

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

Inherited From:

View Source specs.ts, line 119

string

# chain Optional

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

Inherited From:

View Source specs.ts, line 54

boolean

# clickable Optional

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

Inherited From:

View Source specs.ts, line 114

ColorSpec

# color Optional

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

Inherited From:

View Source specs.ts, line 34

string

# elem Optional

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

Inherited From:

View Source specs.ts, line 44

number | string

# expand Optional

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

View Source specs.ts, line 202

boolean

# hetflag Optional

Set to true if atom is a heteroatom

Inherited From:

View Source specs.ts, line 49

function

# hover_callback Optional

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

Inherited From:

View Source specs.ts, line 129

boolean

# hoverable Optional

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

Inherited From:

View Source specs.ts, line 124

number | Array

# index Optional

index of the atom or atoms to select

Overrides:

View Source specs.ts, line 177

boolean

# invert Optional

if set, inverts the meaning of the selection

Overrides:

View Source specs.ts, line 192

GLModel | number | Array | Array

# model Optional

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).

View Source specs.ts, line 172

AtomSelectionSpec

# not Optional

take the inverse of the provided AtomSelectionSpec

View Source specs.ts, line 224

Array | object

# or Optional

take the union of the provided lists of AtomSelectionSpecs

Properties:
Name Type Attributes Description
___cached_results any <optional>

View Source specs.ts, line 218

string

# pdbline Optional

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

Inherited From:

View Source specs.ts, line 109

function

# predicate Optional

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

View Source specs.ts, line 187

Record.<string, any>

# properties Optional

Optional mapping of additional properties

Inherited From:

View Source specs.ts, line 99

number

# resi Optional

Residue number

Inherited From:

View Source specs.ts, line 59

string

# resn Optional

Parent residue name

Inherited From:

View Source specs.ts, line 14

number

# serial Optional

Atom's serial id number

Inherited From:

View Source specs.ts, line 64

boolean

# singleBonds Optional

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

Inherited From:

View Source specs.ts, line 89

string

# ss Optional

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

Inherited From:

View Source specs.ts, line 84

AtomStyleSpec

# style Optional

style of atom

Inherited From:

View Source specs.ts, line 144

ColorSpec

# surfaceColor Optional

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

Inherited From:

View Source specs.ts, line 39

function

# unhover_callback Optional

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

Inherited From:

View Source specs.ts, line 134

WithinSelectionSpec

# within Optional

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

View Source specs.ts, line 207

number

# x Optional

Atom's x coordinate

Inherited From:

View Source specs.ts, line 19

number

# y Optional

Atom's y coordinate

Inherited From:

View Source specs.ts, line 24

number

# z Optional

Atom's z coordinate

Inherited From:

View Source specs.ts, line 29