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 AtomSelectionSpec
s
- Array |
object
Name | Type | Attributes | Description |
---|---|---|---|
___cached_results | any | <optional> |
- Source
atom :string
Atom name; may be more specific than 'elem' (e.g 'CA' for alpha carbon)
- string
- Inherited From
- Source
b :number
Atom b factor data
- number
- Inherited From
- Source
bondOrder :Array
Array of this atom's bond orders, corresponding to bonds identfied by 'bonds'
- Array
- Inherited From
- Source
bondStyles :Array
custom bond styling by position in bonds
- Array
- Inherited From
- Source
bonds :number
overloaded to select number of bonds, e.g. {bonds: 0} will select all nonbonded atoms
- number
- Overrides
- Source
byres :boolean
if set, expands the selection to include all atoms of any residue that has any atom selected
- boolean
- Source
callback :function
Callback click handler function to be executed on this atom and its parent viewer
- function
- Inherited From
- Source
chain :string
Chain this atom belongs to, if specified in input file (e.g 'A' for chain A)
- string
- Inherited From
- Source
clickable :boolean
Set this flag to true to enable click selection handling for this atom
- 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)
- string
- Inherited From
- Source
expand :number|string
expands the selection to include all atoms within a given distance from the selection
- number |
string
- Source
frame :number
frame index of individual frame to style; will apply to all frames if not set
- number
- Source
hetflag :boolean
Set to true if atom is a heteroatom
- boolean
- Inherited From
- Source
hover_callback :function
Callback hover handler function to be executed on this atom and its parent viewer
- function
- Inherited From
- Source
hoverable :boolean
Set this flag to true to enable hover selection handling for this atom
- boolean
- Inherited From
- Source
index :number|Array
index of the atom or atoms to select
- number |
Array
- Overrides
- Source
invert :boolean
if set, inverts the meaning of the selection
- boolean
- Overrides
- Source
lchain :string
Label chain (not author)
- string
- Inherited From
- Source
lresi :number
Label residues number (not author)
- number
- Inherited From
- Source
lresn :string
Residue label name
- string
- Inherited From
- 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).
- GLModel |
number | Array | Array
- Source
not :AtomSelectionSpec
take the inverse of the provided AtomSelectionSpec
- Source
or :Array|object
take the union of the provided lists of AtomSelectionSpec
s
- Array |
object
Name | Type | Attributes | Description |
---|---|---|---|
___cached_results | any | <optional> |
- Source
pdbline :string
If applicable, this atom's record entry from the input PDB file (used to output new PDB from models)
- string
- Inherited From
- Source
predicate :function
user supplied function that gets passed an AtomSpec
and should return true if the atom should be selected
- function
- Source
properties :Record.<string, any>
Optional mapping of additional properties
- 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]}
- number |
SelectionRange | Array
- Overrides
- Source
resn :string
Parent residue name
- string
- Inherited From
- Source
serial :number
Atom's serial id number
- number
- Inherited From
- Source
singleBonds :boolean
true if this atom forms only single bonds or no bonds at all
- boolean
- Inherited From
- Source
ss :string
Secondary structure identifier (for cartoon render; e.g. 'h' for helix)
- 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
- function
- Inherited From
- 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
- number
- Inherited From
- Source
y :number
Atom's y coordinate
- number
- Inherited From
- Source
z :number
Atom's z coordinate
- number
- Inherited From
- Source