createIndexSelection(self,
frame,
cmp=None,
key=None)
|
|
Create a FrameIndexSelection from this instance.
Because FrameAslSelections do not imply an ordering of atoms, two
methods of ordering the new selection are available. The first is to
provide a cmp method. This method should expect two _StructureAtom
instances as arguments and should behave like the cmp argument to the
sort method of the built-in list. The second ordering method is to
specify a _StructureAtom attribute on which to sort.
If neither of these is specified, the selection will be returned in
order of atom indices. In this case, the frame instance is not needed and
can be specified as None.
Raises a ValueError if the FrameAslSelection is dynamic.
- Parameters:
cmp (callable) - A comparison function expecting two _StructureAtom instances.
key (str) - A _StructureAtom attribute on which to order the selection.
frame (_DesmondFrame)
- Returns: FrameIndexSelection
- A FrameIndexSelection with the same atom selection as the current
instance.
|