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