Trajectories¶
- CreateCoordGroup(atoms)¶
- Parameters:
atoms (
AtomHandleList
) – List of atoms. All atoms must be from the same entity.- Return type:
- Returns:
A coord group with zero frames
- class CoordGroupHandle¶
A collection of coordinate frames, e.g. an MD trajectory. Create with
CreateCoordGroup()
.- entity¶
The attached entity.
- Type:
- atoms¶
The atoms of this coord group. The order of atoms is the same as the positions in the coord frames. All atoms are from the same entity.
- Type:
AtomHandleList
- AddFrames(frames)¶
Combine two trajectories by appending the frames of the second to the first :param frames: a valid coord group :type frames:
CoordGroupHandle
- Capture()¶
Record the atom positions of the entity attached to this coord group in a new coordinate frame. Note that the atom positions transformed by the entity transform will be stored. Only available for mutable coord groups.
- See:
- CaptureInto(frame_index)¶
Same as
Capture()
, but doesn’t create a new frame and stores the coordinates directly into frame with index frame_index. Only available for mutable coord groups.- Parameters:
frame_index (int) – index of the frame
- CopyFrame(frame_index)¶
Copies the coordinates of frame with index frame_index to the attached entity.
- Parameters:
frame_index (int) – index of the frame
- Filter(view)¶
Returns a new trajectory containing only coordinates of the atoms in view. Useful to remove water and other solvent molecules from a trajectory to save memory.
- Parameters:
view (
EntityView
) – a valid entity view- Return type:
- GetAtomCount()¶
Returns the number of atoms in the coord group
- Return type:
int
- GetAtomList()¶
Returns the atoms of the coord group in the same order they appear in the coordinate frames.
- Return type:
AtomHandleList
- GetAtomPos(frame_index, atom)¶
Get position of atom in frame with index frame_index.
- Parameters:
frame_index (int) – frame index
atom (
AtomHandle
) – A valid atom
- Return type:
Vec3
- GetEntity()¶
Returns the attached entity
- Return type:
- GetFrameCount()¶
Returns the number of frames of this coord group
- Return type:
int
- IsValid()¶
Whether this coord group is valid
- Return type:
bool
- SetAtomPos(frame_index, atom, pos)¶
Set position of atom in frame with index frame_index to pos
- Parameters:
frame_index (int) – index of the frame
atom (
AtomHandle
) – a valid atompos (
Vec3
) – new position of the atom
- class CoordFrame¶
A single frame of coordinates in a
CoordGroupHandle
.- GetAngle(atom1, atom2, atom3)¶
- Parameters:
atom1 (
AtomHandle
) – first atomatom2 (
AtomHandle
) – second (central) atomatom3 (
AtomHandle
) – third atom
- Returns:
the angle in radians between the 3 atoms
- Return type:
float
- GetAtomPos(atom)¶
Returns the position of the atom in the coord frame
- Parameters:
atom (
AtomHandle
) – A valid atom handle- Return type:
Vec3
- GetCenterOfMassPos(view)¶
- Parameters:
view (
EntityView
) – A valid entity view- Return type:
Vec3
- GetDihedralAngle(atom1, atom2, atom3, atom4)¶
Get dihedral angle of the four atoms.
- Parameters:
atom1 (
AtomHandle
) – First atom. Must be validatom2 (
AtomHandle
) – Second atom. Must be validatom3 (
AtomHandle
) – Third atom. Must be validatom3 – Fourth atom. Must be valid
- Return type:
float
- GetDistanceBetwAtoms(atom1, atom2)¶
Get distance in (Angstroem) between atom1 and atom2 in coord frame.
- Parameters:
atom1 (
AtomHandle
) – First atom. Must be validatom2 (
AtomHandle
) – Second atom. Must be valid
- Return type:
float
- GetDistanceBetwCenterOfMass(view1, view2)¶
Get distance between center of mass of the first selection and the second.
- Parameters:
view1 (
EntityView
) – First view. Must be validview2 (
EntityView
) – Second view. Must be valid
- Return type:
float
- GetRMSD(view1, view2)¶
Get RMSD between two views in the coord frame. The coordinates of the views are taken as is without superposition. The two views must have the same number of atoms. Atoms are matches as they appear in
EntityView.atoms
.- Parameters:
view1 (
EntityView
) – First view. Must be validview2 (
EntityView
) – Second view. Must be valid
- Return type:
float