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 149

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 Description
___cached_results any

View Source specs.ts, line 201

string

# atom Optional

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

Inherited From:

View Source specs.ts, line 73

number

# b Optional

Atom b factor data

Inherited From:

View Source specs.ts, line 103

Array

# bondOrder Optional

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

Inherited From:

View Source specs.ts, line 93

Array

# bondStyles Optional

custom bond styling by position in bonds

Inherited From:

View Source specs.ts, line 143

number

# bonds Optional

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

Overrides:

View Source specs.ts, line 171

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 186

function

# callback Optional

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

Inherited From:

View Source specs.ts, line 118

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 53

boolean

# clickable Optional

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

Inherited From:

View Source specs.ts, line 113

ColorSpec

# color Optional

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

Inherited From:

View Source specs.ts, line 33

string

# elem Optional

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

Inherited From:

View Source specs.ts, line 43

number | string

# expand Optional

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

View Source specs.ts, line 191

boolean

# hetflag Optional

Set to true if atom is a heteroatom

Inherited From:

View Source specs.ts, line 48

function

# hover_callback Optional

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

Inherited From:

View Source specs.ts, line 128

boolean

# hoverable Optional

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

Inherited From:

View Source specs.ts, line 123

number

# index Optional

Index of atom in molecule

Inherited From:

View Source specs.ts, line 68

boolean

# invert Optional

if set, inverts the meaning of the selection

Overrides:

View Source specs.ts, line 181

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 166

AtomSelectionSpec

# not Optional

take the inverse of the provided AtomSelectionSpec

View Source specs.ts, line 213

Array | object

# or Optional

take the union of the provided lists of AtomSelectionSpecs

Properties:
Name Type Description
___cached_results any

View Source specs.ts, line 207

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 108

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 176

Record.<string, any>

# properties Optional

Optional mapping of additional properties

Inherited From:

View Source specs.ts, line 98

number

# resi Optional

Residue number

Inherited From:

View Source specs.ts, line 58

string

# resn Optional

Parent residue name

Inherited From:

View Source specs.ts, line 13

number

# serial Optional

Atom's serial id number

Inherited From:

View Source specs.ts, line 63

boolean

# singleBonds Optional

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

Inherited From:

View Source specs.ts, line 88

string

# ss Optional

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

Inherited From:

View Source specs.ts, line 83

AtomStyleSpec

# style Optional

style of atom

Inherited From:

View Source specs.ts, line 138

ColorSpec

# surfaceColor Optional

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

Inherited From:

View Source specs.ts, line 38

WithinSelectionSpec

# within Optional

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

View Source specs.ts, line 196

number

# x Optional

Atom's x coordinate

Inherited From:

View Source specs.ts, line 18

number

# y Optional

Atom's y coordinate

Inherited From:

View Source specs.ts, line 23

number

# z Optional

Atom's z coordinate

Inherited From:

View Source specs.ts, line 28