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

- AtomSpec

# Members

Type: `Array` | `object`

#### # and Optional

take the intersection of the provided lists of `AtomSelectionSpec`s

##### Properties:

Name | Type | Description
--- | --- | ---
`___cached_results` | `any` |

View Source specs.ts, line 201

Type: `string`

#### # atom Optional

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

Inherited From:
  - AtomSpec#atom

View Source specs.ts, line 73

Type: `number`

#### # b Optional

Atom b factor data

Inherited From:
  - AtomSpec#b

View Source specs.ts, line 103

Type: `Array`

#### # bondOrder Optional

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

Inherited From:
  - AtomSpec#bondOrder

View Source specs.ts, line 93

Type: `Array`

#### # bondStyles Optional

custom bond styling by position in bonds

Inherited From:
  - AtomSpec#bondStyles

View Source specs.ts, line 143

Type: `number`

#### # bonds Optional

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

Overrides:
  - AtomSpec#bonds

View Source specs.ts, line 171

Type: `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

Type: `function`

#### # callback Optional

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

Inherited From:
  - AtomSpec#callback

View Source specs.ts, line 118

Type: `string`

#### # chain Optional

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

Inherited From:
  - AtomSpec#chain

View Source specs.ts, line 53

Type: `boolean`

#### # clickable Optional

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

Inherited From:
  - AtomSpec#clickable

View Source specs.ts, line 113

Type: `ColorSpec`

#### # color Optional

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

Inherited From:
  - AtomSpec#color

View Source specs.ts, line 33

Type: `string`

#### # elem Optional

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

Inherited From:
  - AtomSpec#elem

View Source specs.ts, line 43

Type: `number` | `string`

#### # expand Optional

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

View Source specs.ts, line 191

Type: `boolean`

#### # hetflag Optional

Set to true if atom is a heteroatom

Inherited From:
  - AtomSpec#hetflag

View Source specs.ts, line 48

Type: `function`

#### # hover_callback Optional

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

Inherited From:
  - AtomSpec#hover_callback

View Source specs.ts, line 128

Type: `boolean`

#### # hoverable Optional

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

Inherited From:
  - AtomSpec#hoverable

View Source specs.ts, line 123

Type: `number`

#### # index Optional

Index of atom in molecule

Inherited From:
  - AtomSpec#index

View Source specs.ts, line 68

Type: `boolean`

#### # invert Optional

if set, inverts the meaning of the selection

Overrides:
  - AtomSpec#invert

View Source specs.ts, line 181

Type: `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

Type: `AtomSelectionSpec`

#### # not Optional

take the inverse of the provided `AtomSelectionSpec`

View Source specs.ts, line 213

Type: `Array` | `object`

#### # or Optional

take the union of the provided lists of `AtomSelectionSpec`s

##### Properties:

Name | Type | Description
--- | --- | ---
`___cached_results` | `any` |

View Source specs.ts, line 207

Type: `string`

#### # pdbline Optional

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

Inherited From:
  - AtomSpec#pdbline

View Source specs.ts, line 108

Type: `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

Type: `Record.<string, any>`

#### # properties Optional

Optional mapping of additional properties

Inherited From:
  - AtomSpec#properties

View Source specs.ts, line 98

Type: `number`

#### # resi Optional

Residue number

Inherited From:
  - AtomSpec#resi

View Source specs.ts, line 58

Type: `string`

#### # resn Optional

Parent residue name

Inherited From:
  - AtomSpec#resn

View Source specs.ts, line 13

Type: `number`

#### # serial Optional

Atom's serial id number

Inherited From:
  - AtomSpec#serial

View Source specs.ts, line 63

Type: `boolean`

#### # singleBonds Optional

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

Inherited From:
  - AtomSpec#singleBonds

View Source specs.ts, line 88

Type: `string`

#### # ss Optional

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

Inherited From:
  - AtomSpec#ss

View Source specs.ts, line 83

Type: `AtomStyleSpec`

#### # style Optional

style of atom

Inherited From:
  - AtomSpec#style

View Source specs.ts, line 138

Type: `ColorSpec`

#### # surfaceColor Optional

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

Inherited From:
  - AtomSpec#surfaceColor

View Source specs.ts, line 38

Type: `WithinSelectionSpec`

#### # within Optional

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

View Source specs.ts, line 196

Type: `number`

#### # x Optional

Atom's x coordinate

Inherited From:
  - AtomSpec#x

View Source specs.ts, line 18

Type: `number`

#### # y Optional

Atom's y coordinate

Inherited From:
  - AtomSpec#y

View Source specs.ts, line 23

Type: `number`

#### # z Optional

Atom's z coordinate

Inherited From:
  - AtomSpec#z

View Source specs.ts, line 28