Package jgromacs.data

Class Trajectory

java.lang.Object
jgromacs.data.Trajectory
All Implemented Interfaces:
Cloneable

public class Trajectory extends Object implements Cloneable
Objects of this class represent a single trajectory
  • Constructor Details

    • Trajectory

      public Trajectory()
      Constructs a new Trajectory object
    • Trajectory

      public Trajectory(String name)
      Constructs a new Trajectory object of given name
    • Trajectory

      public Trajectory(Structure structure)
      Constructs a new Trajectory object of given structure
    • Trajectory

      public Trajectory(Structure[] ensemble)
      Constructs a new Trajectory object made from an ensemble of structures
  • Method Details

    • getFrames

      public ArrayList<PointList> getFrames()
      Returns frames of the trajectory as an ArrayList object
      Returns:
      frames as an ArrayList
    • getFrameAsPointList

      public PointList getFrameAsPointList(int i)
      Returns frame #i of the trajectory as a PointList object
      Returns:
      frame #i as a PointList
    • getFrameAsStructure

      public Structure getFrameAsStructure(int i)
      Returns frame #i of the trajectory as a Structure object
      Returns:
      frame #i as a Structure
    • getNumberOfFrames

      public int getNumberOfFrames()
      Returns the number of frames in the trajectory
      Returns:
      number of frames
    • getName

      public String getName()
      Returns the name of trajectory
      Returns:
      name of trajectory
    • setName

      public void setName(String name)
      Sets the name of trajectory
      Parameters:
      name - name of trajectory
    • getStartTime

      public double getStartTime()
      Returns the start time of trajectory
      Returns:
      start time of trajectory
    • setStartTime

      public void setStartTime(double startTime)
      Sets the start time of trajectory
      Parameters:
      startTime - start time of trajectory
    • getTimeStep

      public double getTimeStep()
      Returns the time step of trajectory
      Returns:
      time step of trajectory
    • setTimeStep

      public void setTimeStep(double timeStep)
      Sets the time step of trajectory
      Parameters:
      timeStep - time step of trajectory
    • setStructure

      public void setStructure(Structure structure)
      Sets the structure described by the trajectory
      Parameters:
      structure - structure described by the trajectory
    • getMeanFrame

      public PointList getMeanFrame()
      Returns the mean frame of trajectory
      Returns:
      mean frame
    • getNumberOfAtoms

      public int getNumberOfAtoms()
      Returns the number of atoms in the trajectory
      Returns:
      number of atoms
    • getNumberOfResidues

      public int getNumberOfResidues()
      Returns the number of residues in the trajectory
      Returns:
      number of residues
    • getFirstFrameAsPointList

      public PointList getFirstFrameAsPointList()
      Returns the initial frame of trajectory as a PointList
      Returns:
      initial frame
    • getFirstFrameAsStructure

      public Structure getFirstFrameAsStructure()
      Returns the initial frame of trajectory as a Structure
      Returns:
      initial frame
    • getLastFrameAsPointList

      public PointList getLastFrameAsPointList()
      Returns the last frame of trajectory as a PointList
      Returns:
      last frame
    • getLastFrameAsStructure

      public Structure getLastFrameAsStructure()
      Returns the last frame of trajectory as a Structure
      Returns:
      last frame
    • addFrame

      public void addFrame(PointList frame)
      Adds a new frame to the trajectory
      Parameters:
      frame - new frame
    • removeFrame

      public void removeFrame(int i)
      Removes frame #i from the trajectory
    • setFrame

      public void setFrame(int i, PointList frame)
      Replaces frame #i with a new frame
      Parameters:
      frame - new frame
    • convertFrameIndexToTime

      public double convertFrameIndexToTime(int frameindex)
      Converts frame index to simulation time
      Parameters:
      frameindex - frame index
      Returns:
      simulation time
    • convertTimeToFrameIndex

      public int convertTimeToFrameIndex(double time)
      Converts simulation time to frame index
      Parameters:
      time - simulation time
      Returns:
      frame index
    • getSubTrajectory

      public Trajectory getSubTrajectory(int startframe, int endframe)
      Returns the subtrajectory between the given start and end frames
      Parameters:
      startframe - start frame
      endframe - end frame
      Returns:
      subtrajectory
    • getSubTrajectory

      public Trajectory getSubTrajectory(int startframe, int endframe, int frequency)
      Returns the subtrajectory between the given start and end frames using the given sampling frequency
      Parameters:
      startframe - start frame
      endframe - end frame
      frequency - sampling frequency
      Returns:
      subtrajectory
    • getSubTrajectory

      public Trajectory getSubTrajectory(IndexSet indices)
      Returns the subtrajectory defined by the given index set
      Parameters:
      indices - index set of subtrajectory
      Returns:
      subtrajectory
    • getSubTrajectory

      public Trajectory getSubTrajectory(FrameIndexSet framelist)
      Returns the subtrajectory defined by the given frame list
      Parameters:
      framelist - frame list
      Returns:
      subtrajectory
    • toString

      public String toString()
      Returns the String representation of trajectory
      Overrides:
      toString in class Object
      Returns:
      String representation
    • equals

      public boolean equals(Object other)
      Returns true if the two trajectories are identical
      Overrides:
      equals in class Object
      Parameters:
      other - the other trajectory
    • hashCode

      public int hashCode()
      Returns hash code
      Overrides:
      hashCode in class Object
    • clone

      public Object clone()
      Returns an identical Trajectory object
      Overrides:
      clone in class Object
      Returns:
      clone of the trajectory