Package schrodinger :: Package application :: Package desmond :: Package packages :: Module traj :: Class Frame
[hide private]
[frames] | no frames]

Class Frame

object --+
         |
        Frame


This class, as its name suggests, represents a single trajectory frame.
So far, we allow a frame to be mutated in the following ways:
- Assign a new chemical time
- Reduce to a subset of particles
- Coordinates of all particles are translated

We call changes generally as ``decorations''. They might not make into
the frame data, or at least not immediately. Why? This avoids making
multiple expensive copies of the data.

Instance Methods [hide private]
 
__init__(self, source, index)
x.__init__(...) initializes x; see help(type(x)) for signature
 
__str__(self)
str(x)
 
__deepcopy__(self, memo={})
 
_frame(self)
 
_mapped_index(self, i)
 
_copy_and_decorate(self, obj, indices)
Makes a copy of the native trajectory-frame object and decorates the copied object if necessary.
 
_get_native_object(self, indices=None)
 
_make(self, force=False)
Solidifies decorations.
 
source(self)
 
copy(self)
 
natoms(self)
 
pos(self, i=None)
Return the position of particle i.
 
vel(self, i=None)
Return the velocity of particle i.
 
_getTime(self)
 
_setTime(self, value)
 
box(self)
 
reduce(self, indices, is_sorted=False)
Keep only the atoms specified by indices, the other atoms will be deleted from this frame.
 
moveby(self, x, y, z)
Translate all positions by the given x, y, and z.
 
write(self, writer)
Write out this frame using the given writer.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Class Variables [hide private]
  time = property(_getTime, _setTime)
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, source, index)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

__str__(self)
(Informal representation operator)

 

str(x)

Overrides: object.__str__
(inherited documentation)

_copy_and_decorate(self, obj, indices)

 

Makes a copy of the native trajectory-frame object and decorates the copied object if necessary.

Parameters:
  • obj (A native frame type, e.g., molfile.Frame) - A native frame

_make(self, force=False)

 

Solidifies decorations. If there are decorations or force == True, this function might make a copy of the frame data.

natoms(self)

 
Decorators:
  • @property

pos(self, i=None)

 

Return the position of particle i.

Parameters:
  • i - Gid of the particle.

vel(self, i=None)

 

Return the velocity of particle i. This method may throw if this frame doesn't have velocity data.

Parameters:
  • i - Gid of the particle.

box(self)

 
Decorators:
  • @property