/ . / chimera / selection / Selection
Base class for selections.
Selection(name, description) => Selection instance
A Selection is a set of selectable objects.
This class must be subclassed.
Methods
|
|
|
bonds
|
bonds ( self, **kw )
|
|
__str__
|
__str__ ( self )
Return the printable string representation of the selection.
str(selection) => string
Exceptions
|
|
TypeError, "Instance must be of a subtype of Selection"
|
|
|
vertices
|
vertices ( self, asDict=False )
Return all vertices in the selection.
selection.vertices() => [vertex-objs]
if asDict is True, the vertices are returned as a
dictionary (keys are vertices, arbitrary values)
This is a default implementation that uses the apply function.
|
|
residues
|
residues ( self, **kw )
|
|
barrenGraphs
|
barrenGraphs ( self, asDict=False )
Graphs that have no vertices/edges
Since contained graphs are normally computed from
vertices/edges, such barren graphs have to be
tracked separately. If asDict is True, then a
dictionary (keys: barren graphs, values: arbitrary)
is returned instead of a list.
Must be implemented by subclasses
Exceptions
|
|
AssertionError, "Selection subclass does not implement barrenGraphs()"
|
|
|
subgraphs
|
subgraphs ( self, asDict=False )
Return the implicitly selected graphs
selection.subgraphs() => [subgraphs]
if asDict is True, the subgraphs are returned as a
dictionary (keys are subgraphs, arbitrary values)
|
|
graphs
|
graphs ( self, asDict=False )
|
|
edges
|
edges ( self, asDict=False )
Return all edges in the selection.
selection.edges() => [edge-objs]
if asDict is True, the edges are returned as a
dictionary (keys are edges, arbitrary values)
This is a default implementation that uses the apply function.
|
|
contents
|
contents ( self, asDict=False )
Return all vertices/edges selected by the selection.
selection.contents() => ( [vertex-objs], [edge-objs] )
if asDict is True, the vertices/edges are returned as
dictionaries (keys are vertices/edges, arbitrary values)
This is a default implementation that uses the apply function.
|
|
molecules
|
molecules ( self, **kw )
|
|
apply
|
apply (
self,
vFunc=None,
eFunc=None,
)
Call given functions for objects that match selection.
selection.apply(vFunc, eFunc) => None
vFunc is the function for vertices while eFunc is the
function for edges.
All calls to the eFunc are made before any calls to the vFunc.
This function must be implemented in subclasses.
Exceptions
|
|
AssertionError, "Selection subclass does not implement apply()"
|
|
|
atoms
|
atoms ( self, **kw )
|
|
chains
|
chains ( self, **kw )
|
|
__len__
|
__len__ ( self )
Total count of items in selection
|
|
|